Este artigo foi traduzido por máquina. Para visualizar o arquivo em inglês, marque a caixa de seleção Inglês. Você também pode exibir o texto Em inglês em uma janela pop-up, movendo o ponteiro do mouse sobre o texto.
Tradução
Inglês
Esta documentação foi arquivada e não está sendo atualizada.

Método ServiceDescription.Write (String)

Grava o ServiceDescription sistema autônomo um arquivo WSDL (linguagem WSDL) no caminho especificado.

Namespace:  System.Web.Services.Description
Assembly:  System.Web.Services (em System.Web.Services.dll)

public void Write(
	string fileName
)

Parâmetros

fileName
Tipo: System.String
O caminho para o qual o arquivo WSDL é gravado.

// Read a ServiceDescription from existing WSDL.
ServiceDescription myServiceDescription =
   ServiceDescription.Read("Input_CS.wsdl");
myServiceDescription.TargetNamespace = "http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection myServiceCollection = myServiceDescription.Services;

// Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services[0]);

// Build a new Service.
Service myService = new Service();
myService.Name = "MathService";
XmlQualifiedName myXmlQualifiedName = 
   new XmlQualifiedName("s0:MathServiceSoap");

// Build a new Port for SOAP.
Port mySoapPort= new Port();

mySoapPort.Name = "MathServiceSoap";

mySoapPort.Binding = myXmlQualifiedName;

SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding();
mySoapAddressBinding.Location = 
   "http://localhost/ServiceCollection_Item/AddSub_CS.asmx";
mySoapPort.Extensions.Add(mySoapAddressBinding);

// Build a new Port for HTTP-GET.
XmlQualifiedName myXmlQualifiedName2 = 
   new XmlQualifiedName("s0:MathServiceHttpGet");

Port myHttpGetPort= new Port();
myHttpGetPort.Name="MathServiceHttpGet";
myHttpGetPort.Binding=myXmlQualifiedName2;
HttpAddressBinding myHttpAddressBinding = new HttpAddressBinding();
myHttpAddressBinding.Location = 
   "http://localhost/ServiceCollection_Item/AddSub_CS.asmx";
myHttpGetPort.Extensions.Add(myHttpAddressBinding);

// Add the ports to the service.
myService.Ports.Add(myHttpGetPort);
myService.Ports.Add(mySoapPort);

// Add the service to the ServiceCollection.
myServiceCollection .Add(myService);

// Write to a new WSDL file.
myServiceDescription.Write("output.wsdl");


// Read a ServiceDescription from existing WSDL.
ServiceDescription myServiceDescription = ServiceDescription.
    Read("Input_JSL.wsdl");
myServiceDescription.set_TargetNamespace("http://tempuri.org/");
// Get the ServiceCollection of the ServiceDescription.
ServiceCollection myServiceCollection = myServiceDescription.
    get_Services();
// Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.get_Services().
    get_Item(0));
// Build a new Service.
Service myService = new Service();
myService.set_Name("MathService");
XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName(
    "s0:MathServiceSoap");
// Build a new Port for SOAP.
Port mySoapPort = new Port();

mySoapPort.set_Name("MathServiceSoap");

mySoapPort.set_Binding(myXmlQualifiedName);

SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding();
mySoapAddressBinding.set_Location("http://localhost/"
    + "ServiceCollection_Item/AddSub_JSL.asmx");
mySoapPort.get_Extensions().Add(mySoapAddressBinding);
// Build a new Port for HTTP-GET.
XmlQualifiedName myXmlQualifiedName2 = new XmlQualifiedName(
    "s0:MathServiceHttpGet");

Port myHttpGetPort = new Port();
myHttpGetPort.set_Name("MathServiceHttpGet");
myHttpGetPort.set_Binding(myXmlQualifiedName2);
HttpAddressBinding myHttpAddressBinding = new HttpAddressBinding();
myHttpAddressBinding.set_Location("http://localhost/"
    + "ServiceCollection_Item/AddSub_JSL.asmx");
myHttpGetPort.get_Extensions().Add(myHttpAddressBinding);
// Add the ports to the service.
myService.get_Ports().Add(myHttpGetPort);
myService.get_Ports().Add(mySoapPort);
// Add the service to the ServiceCollection.
myServiceCollection.Add(myService);
// Write to a new WSDL file.
myServiceDescription.Write("output.wsdl");


Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

o.NET Framework e.NET Compact Framework não oferecem suporte a todas as versões de cada plataforma. Para obter uma lista de versões suportadas, consulte Requisitos de sistema do .NET framework.

.NET Framework

Compatível com: 3.5, 3.0, 2.0, 1.1, 1.0
Mostrar: