ServiceDescription.Write Metodo

Definizione

Scrive l'oggetto ServiceDescription come file del linguaggio di descrizione dei servizi Web (WSDL, Web Services Description Language).

Overload

Write(String)

Scrive l'oggetto ServiceDescription come file del linguaggio di descrizione dei servizi Web (WSDL, Web Services Description Language) nel percorso specificato.

Write(Stream)

Scrive l'oggetto ServiceDescription nell'oggetto Stream specificato.

Write(TextWriter)

Scrive l'oggetto ServiceDescription come file del linguaggio di descrizione dei servizi Web (WSDL, Web Services Description Language) in TextWriter.

Write(XmlWriter)

Scrive l'oggetto ServiceDescription in XmlWriter come file del linguaggio di descrizione dei servizi Web (WSDL, Web Services Description Language).

Write(String)

Origine:
ServiceDescription.cs
Origine:
ServiceDescription.cs
Origine:
ServiceDescription.cs

Scrive l'oggetto ServiceDescription come file del linguaggio di descrizione dei servizi Web (WSDL, Web Services Description Language) nel percorso specificato.

public:
 void Write(System::String ^ fileName);
public void Write (string fileName);
member this.Write : string -> unit
Public Sub Write (fileName As String)

Parametri

fileName
String

Percorso in cui viene scritto il file WSDL.

Esempio

// 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 = gcnew Service;
myService->Name = "MathService";
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MathServiceSoap" );

// Build a new Port for SOAP.
Port^ mySoapPort = gcnew Port;
mySoapPort->Name = "MathServiceSoap";
mySoapPort->Binding = myXmlQualifiedName;
SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding;
mySoapAddressBinding->Location = "http://localhost/ServiceCollection_Item/AddSub_CS.asmx";
mySoapPort->Extensions->Add( mySoapAddressBinding );

// Build a new Port for HTTP-GET.
XmlQualifiedName^ myXmlQualifiedName2 = gcnew XmlQualifiedName( "s0:MathServiceHttpGet" );
Port^ myHttpGetPort = gcnew Port;
myHttpGetPort->Name = "MathServiceHttpGet";
myHttpGetPort->Binding = myXmlQualifiedName2;
HttpAddressBinding^ myHttpAddressBinding = gcnew 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_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.
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read("Input.vb.wsdl")
myServiceDescription.TargetNamespace = "http://tempuri.org/"

' Get the ServiceCollection of the ServiceDescription.
Dim myServiceCollection As ServiceCollection = _
   myServiceDescription.Services

' Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services.Item(0))

' Build a new Service.
Dim myService As New Service()
myService.Name = "MathService"
Dim myXmlQualifiedName As New XmlQualifiedName("s0:MathServiceSoap")

' Build a new Port for SOAP.
Dim mySoapPort As New Port()

mySoapPort.Name = "MathServiceSoap"

mySoapPort.Binding = myXmlQualifiedName

Dim mySoapAddressBinding As New SoapAddressBinding()
mySoapAddressBinding.Location = _
   "http://localhost/ServiceCollection_Item/AddSub.vb.asmx"
mySoapPort.Extensions.Add(mySoapAddressBinding)

' Build a new Port for HTTP-GET.
Dim myXmlQualifiedName2 As _
   New XmlQualifiedName("s0:MathServiceHttpGet")

Dim myHttpGetPort As New Port()
myHttpGetPort.Name = "MathServiceHttpGet"
myHttpGetPort.Binding = myXmlQualifiedName2
Dim myHttpAddressBinding As New HttpAddressBinding()
myHttpAddressBinding.Location = _
   "http://localhost/ServiceCollection_Item/AddSub.vb.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")

Si applica a

Write(Stream)

Origine:
ServiceDescription.cs
Origine:
ServiceDescription.cs
Origine:
ServiceDescription.cs

Scrive l'oggetto ServiceDescription nell'oggetto Stream specificato.

public:
 void Write(System::IO::Stream ^ stream);
public void Write (System.IO.Stream stream);
member this.Write : System.IO.Stream -> unit
Public Sub Write (stream As Stream)

Parametri

stream
Stream

Oggetto Stream, passato da un riferimento, contenente il file del linguaggio di descrizione dei servizi Web (WSDL, Web Services Description Language) prodotto.

Esempio

FileStream^ myFileStream = gcnew FileStream( "output.wsdl",FileMode::OpenOrCreate,FileAccess::Write );
StreamWriter^ myStreamWriter = gcnew StreamWriter( myFileStream );

// Write the WSDL.
Console::WriteLine( "Writing a new WSDL file." );
myServiceDescription->Write( myStreamWriter );
myStreamWriter->Close();
myFileStream->Close();
FileStream myFileStream = new FileStream("output.wsdl",
   FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter myStreamWriter = new StreamWriter(myFileStream);

// Write the WSDL.
Console.WriteLine("Writing a new WSDL file.");
myServiceDescription.Write(myStreamWriter);
myStreamWriter.Close();
myFileStream.Close();
Dim myFileStream As New FileStream("output.wsdl", _
   FileMode.OpenOrCreate, FileAccess.Write)
Dim myStreamWriter As New StreamWriter(myFileStream)

' Write the WSDL.
Console.WriteLine("Writing a new WSDL file.")
myServiceDescription.Write(myStreamWriter)
myStreamWriter.Close()
myFileStream.Close()

Si applica a

Write(TextWriter)

Origine:
ServiceDescription.cs
Origine:
ServiceDescription.cs
Origine:
ServiceDescription.cs

Scrive l'oggetto ServiceDescription come file del linguaggio di descrizione dei servizi Web (WSDL, Web Services Description Language) in TextWriter.

public:
 void Write(System::IO::TextWriter ^ writer);
public void Write (System.IO.TextWriter writer);
member this.Write : System.IO.TextWriter -> unit
Public Sub Write (writer As TextWriter)

Parametri

writer
TextWriter

Oggetto TextWriter che contiene il file WSDL prodotto.

Si applica a

Write(XmlWriter)

Origine:
ServiceDescription.cs
Origine:
ServiceDescription.cs
Origine:
ServiceDescription.cs

Scrive l'oggetto ServiceDescription in XmlWriter come file del linguaggio di descrizione dei servizi Web (WSDL, Web Services Description Language).

public:
 void Write(System::Xml::XmlWriter ^ writer);
public void Write (System.Xml.XmlWriter writer);
member this.Write : System.Xml.XmlWriter -> unit
Public Sub Write (writer As XmlWriter)

Parametri

writer
XmlWriter

Oggetto XmlWriter, passato per riferimento, contenente il file WSDL prodotto.

Esempio

ServiceDescription_Read#4

Si applica a