ServiceDescription.Write Metoda

Definicja

ServiceDescription Zapisuje plik jako plik WSDL (Web Services Description Language).

Przeciążenia

Write(String)

ServiceDescription Zapisuje plik jako plik WSDL (Web Services Description Language) do określonej ścieżki.

Write(Stream)

Zapisuje element ServiceDescription do określonego Streamelementu .

Write(TextWriter)

ServiceDescription Zapisuje plik jako plik WSDL (Web Services Description Language) w pliku TextWriter.

Write(XmlWriter)

ServiceDescription Zapisuje wartość w XmlWriter pliku jako plik WSDL (Web Services Description Language).

Write(String)

Źródło:
ServiceDescription.cs
Źródło:
ServiceDescription.cs
Źródło:
ServiceDescription.cs

ServiceDescription Zapisuje plik jako plik WSDL (Web Services Description Language) do określonej ścieżki.

C#
public void Write (string fileName);

Parametry

fileName
String

Ścieżka, do której jest zapisywany plik WSDL.

Przykłady

C#
// 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");

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0

Write(Stream)

Źródło:
ServiceDescription.cs
Źródło:
ServiceDescription.cs
Źródło:
ServiceDescription.cs

Zapisuje element ServiceDescription do określonego Streamelementu .

C#
public void Write (System.IO.Stream stream);

Parametry

stream
Stream

Plik Streamprzekazany przez odwołanie, który zawiera utworzony plik WSDL (Web Services Description Language).

Przykłady

C#
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();

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0

Write(TextWriter)

Źródło:
ServiceDescription.cs
Źródło:
ServiceDescription.cs
Źródło:
ServiceDescription.cs

ServiceDescription Zapisuje plik jako plik WSDL (Web Services Description Language) w pliku TextWriter.

C#
public void Write (System.IO.TextWriter writer);

Parametry

writer
TextWriter

Element TextWriter zawierający wygenerowany plik WSDL.

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0

Write(XmlWriter)

Źródło:
ServiceDescription.cs
Źródło:
ServiceDescription.cs
Źródło:
ServiceDescription.cs

ServiceDescription Zapisuje wartość w XmlWriter pliku jako plik WSDL (Web Services Description Language).

C#
public void Write (System.Xml.XmlWriter writer);

Parametry

writer
XmlWriter

Element XmlWriterprzekazany przez odwołanie, który zawiera wygenerowany plik WSDL.

Przykłady

ServiceDescription_Read#4

Dotyczy

.NET Framework 4.8.1 i inne wersje
Produkt Wersje
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0