ServiceDescription.Read Metodo

Definizione

Inizializza un'istanza della classe ServiceDescription caricando direttamente il codice XML.Initializes an instance of the ServiceDescription class by directly loading the XML.

Overload

Read(TextReader, Boolean)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un oggetto TextReader.Initializes an instance of the ServiceDescription class by directly loading the XML from a TextReader.

Read(XmlReader, Boolean)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un oggetto XmlReader.Initializes an instance of the ServiceDescription class by directly loading the XML from an XmlReader.

Read(Stream, Boolean)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un'istanza di Stream.Initializes an instance of the ServiceDescription class by directly loading the XML from a Stream instance.

Read(String, Boolean)

Inizializza un'istanza di un oggetto ServiceDescription caricando il codice XML direttamente dal file specificato.Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file.

Read(String)

Inizializza un'istanza di un oggetto ServiceDescription caricando il codice XML direttamente dal file specificato.Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file.

Read(TextReader)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un oggetto TextReader.Initializes an instance of the ServiceDescription class by directly loading the XML from a TextReader.

Read(Stream)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un'istanza di Stream.Initializes an instance of the ServiceDescription class by directly loading the XML from a Stream instance.

Read(XmlReader)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un oggetto XmlReader.Initializes an instance of the ServiceDescription class by directly loading the XML from an XmlReader.

Read(TextReader, Boolean)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un oggetto TextReader.Initializes an instance of the ServiceDescription class by directly loading the XML from a TextReader.

public:
 static System::Web::Services::Description::ServiceDescription ^ Read(System::IO::TextReader ^ textReader, bool validate);
public:
 static System::Web::Services::Description::ServiceDescription ^ Read(System::IO::TextReader ^ reader, bool validate);
public static System.Web.Services.Description.ServiceDescription Read (System.IO.TextReader textReader, bool validate);
public static System.Web.Services.Description.ServiceDescription Read (System.IO.TextReader reader, bool validate);
static member Read : System.IO.TextReader * bool -> System.Web.Services.Description.ServiceDescription
static member Read : System.IO.TextReader * bool -> System.Web.Services.Description.ServiceDescription
Public Shared Function Read (textReader As TextReader, validate As Boolean) As ServiceDescription
Public Shared Function Read (reader As TextReader, validate As Boolean) As ServiceDescription

Parametri

textReaderreader
TextReader

Istanza di TextReader, passata per riferimento, contenente il testo da leggere.A TextReader instance, passed by reference, which contains the text to be read.

validate
Boolean

Oggetto Boolean che indica se XML deve essere conalidato sulla base dello schema specificato da Schema.A Boolean that indicates whether the XML should be validated against the schema specified by Schema.

Restituisce

ServiceDescription

Istanza del ServiceDescription.An instance of the ServiceDescription.

Si applica a

Read(XmlReader, Boolean)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un oggetto XmlReader.Initializes an instance of the ServiceDescription class by directly loading the XML from an XmlReader.

public:
 static System::Web::Services::Description::ServiceDescription ^ Read(System::Xml::XmlReader ^ reader, bool validate);
public static System.Web.Services.Description.ServiceDescription Read (System.Xml.XmlReader reader, bool validate);
static member Read : System.Xml.XmlReader * bool -> System.Web.Services.Description.ServiceDescription
Public Shared Function Read (reader As XmlReader, validate As Boolean) As ServiceDescription

Parametri

reader
XmlReader

Oggetto XmlReader, passato per riferimento, contenente i dati XML da leggere.An XmlReader, passed by reference, which contains the XML data to be read.

validate
Boolean

Oggetto Boolean che indica se XML deve essere conalidato sulla base dello schema specificato da Schema.A Boolean that indicates whether the XML should be validated against the schema specified by Schema.

Restituisce

ServiceDescription

Istanza del ServiceDescription.An instance of the ServiceDescription.

Si applica a

Read(Stream, Boolean)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un'istanza di Stream.Initializes an instance of the ServiceDescription class by directly loading the XML from a Stream instance.

public:
 static System::Web::Services::Description::ServiceDescription ^ Read(System::IO::Stream ^ stream, bool validate);
public static System.Web.Services.Description.ServiceDescription Read (System.IO.Stream stream, bool validate);
static member Read : System.IO.Stream * bool -> System.Web.Services.Description.ServiceDescription
Public Shared Function Read (stream As Stream, validate As Boolean) As ServiceDescription

Parametri

stream
Stream

Oggetto Stream, passato per riferimento, contenente i byte da leggere.A Stream, passed by reference, which contains the bytes to be read.

validate
Boolean

Oggetto Boolean che indica se XML deve essere conalidato sulla base dello schema specificato da Schema.A Boolean that indicates whether the XML should be validated against the schema specified by Schema.

Restituisce

ServiceDescription

Istanza del ServiceDescription.An instance of the ServiceDescription.

Si applica a

Read(String, Boolean)

Inizializza un'istanza di un oggetto ServiceDescription caricando il codice XML direttamente dal file specificato.Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file.

public:
 static System::Web::Services::Description::ServiceDescription ^ Read(System::String ^ fileName, bool validate);
public static System.Web.Services.Description.ServiceDescription Read (string fileName, bool validate);
static member Read : string * bool -> System.Web.Services.Description.ServiceDescription
Public Shared Function Read (fileName As String, validate As Boolean) As ServiceDescription

Parametri

fileName
String

Percorso del file da leggere.The path to the file to be read.

validate
Boolean

Oggetto Boolean che indica se XML deve essere conalidato sulla base dello schema specificato da Schema.A Boolean that indicates whether the XML should be validated against the schema specified by Schema.

Restituisce

ServiceDescription

Istanza del ServiceDescription.An instance of the ServiceDescription.

Si applica a

Read(String)

Inizializza un'istanza di un oggetto ServiceDescription caricando il codice XML direttamente dal file specificato.Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file.

public:
 static System::Web::Services::Description::ServiceDescription ^ Read(System::String ^ fileName);
public static System.Web.Services.Description.ServiceDescription Read (string fileName);
static member Read : string -> System.Web.Services.Description.ServiceDescription
Public Shared Function Read (fileName As String) As ServiceDescription

Parametri

fileName
String

Percorso del file da leggere.The path to the file to be read.

Restituisce

ServiceDescription

Istanza del ServiceDescription.An instance of the ServiceDescription.

Esempio

ServiceDescription^ myDescription = gcnew ServiceDescription;
myDescription = ServiceDescription::Read( "MyWsdl_CS.wsdl" );
myDescription->Name = "MyServiceDescription";
Console::WriteLine( "Name: {0}", myDescription->Name );
MessageCollection^ myMessageCollection = myDescription->Messages;

// Remove the message at index 0 from the message collection.
myMessageCollection->Remove( myDescription->Messages[ 0 ] );

// Build a new message.
Message^ myMessage = gcnew Message;
myMessage->Name = "AddSoapIn";

// Build a new MessagePart.
MessagePart^ myMessagePart = gcnew MessagePart;
myMessagePart->Name = "parameters";
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:Add" );
myMessagePart->Element = myXmlQualifiedName;

// Add MessageParts to the message.
myMessage->Parts->Add( myMessagePart );

// Add the message to the ServiceDescription.
myDescription->Messages->Add( myMessage );
myDescription->Write( "MyOutWsdl.wsdl" );

ServiceDescription myDescription = new ServiceDescription();
myDescription = ServiceDescription.Read("MyWsdl_CS.wsdl");
myDescription.Name = "MyServiceDescription";
Console.WriteLine("Name: " + myDescription.Name);
MessageCollection myMessageCollection = myDescription.Messages;

// Remove the message at index 0 from the message collection.
myMessageCollection.Remove(myDescription.Messages[0]);

// Build a new message.
Message myMessage = new Message();
myMessage.Name = "AddSoapIn";

// Build a new MessagePart.
MessagePart myMessagePart = new MessagePart();
myMessagePart.Name = "parameters";
XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("s0:Add");
myMessagePart.Element = myXmlQualifiedName;

// Add MessageParts to the message.
myMessage.Parts.Add(myMessagePart);

// Add the message to the ServiceDescription.
myDescription.Messages.Add(myMessage);
myDescription.Write("MyOutWsdl.wsdl");
Dim myDescription As New ServiceDescription()
myDescription = ServiceDescription.Read("MyWsdl_VB.wsdl")
myDescription.Name = "MyServiceDescription"
Console.WriteLine("Name: " & myDescription.Name)
Dim myMessageCollection As MessageCollection = myDescription.Messages

' Remove the message at index 0 from the message collection.
myMessageCollection.Remove(myDescription.Messages(0))

' Build a new Message.
Dim myMessage As New Message()
myMessage.Name = "AddSoapIn"

' Build a new MessagePart.
Dim myMessagePart As New MessagePart()
myMessagePart.Name = "parameters"
Dim myXmlQualifiedName As New XmlQualifiedName("s0:Add")
myMessagePart.Element = myXmlQualifiedName

' Add MessageParts to the message.
myMessage.Parts.Add(myMessagePart)

' Add the message to the ServiceDescription.
myDescription.Messages.Add(myMessage)
myDescription.Write("MyOutWsdl.wsdl")

Si applica a

Read(TextReader)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un oggetto TextReader.Initializes an instance of the ServiceDescription class by directly loading the XML from a TextReader.

public:
 static System::Web::Services::Description::ServiceDescription ^ Read(System::IO::TextReader ^ textReader);
public static System.Web.Services.Description.ServiceDescription Read (System.IO.TextReader textReader);
static member Read : System.IO.TextReader -> System.Web.Services.Description.ServiceDescription
Public Shared Function Read (textReader As TextReader) As ServiceDescription

Parametri

textReader
TextReader

Istanza di TextReader, passata per riferimento, contenente il testo da leggere.A TextReader instance, passed by reference, which contains the text to be read.

Restituisce

ServiceDescription

Istanza del ServiceDescription.An instance of the ServiceDescription.

Esempio

ServiceDescription^ myDescription = gcnew ServiceDescription;

// Create a StreamReader to read a WSDL file.
TextReader^ myTextReader = gcnew StreamReader( "MyWsdl.wsdl" );
myDescription = ServiceDescription::Read( myTextReader );
Console::WriteLine( "Bindings are: " );

// Display the Bindings present in the WSDL file.
System::Collections::IEnumerator^ myEnum = myDescription->Bindings->GetEnumerator();
while ( myEnum->MoveNext() )
{
   Binding^ myBinding = safe_cast<Binding^>(myEnum->Current);
   Console::WriteLine( myBinding->Name );
}
ServiceDescription myDescription = new ServiceDescription();

// Create a StreamReader to read a WSDL file.
TextReader myTextReader = new StreamReader("MyWsdl.wsdl");
myDescription = ServiceDescription.Read(myTextReader);
Console.WriteLine("Bindings are: ");

// Display the Bindings present in the WSDL file.
foreach(Binding myBinding in myDescription.Bindings)
{
   Console.WriteLine(myBinding.Name);
}
Dim myDescription As New ServiceDescription()

' Create a StreamReader to read a WSDL file.
Dim myTextReader = New StreamReader("MyWsdl.wsdl")
myDescription = ServiceDescription.Read(myTextReader)
Console.WriteLine("Bindings are: ")

' Display the Bindings present in the WSDL file.
Dim myBinding As Binding
For Each myBinding In myDescription.Bindings
   Console.WriteLine(myBinding.Name)
Next myBinding

Si applica a

Read(Stream)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un'istanza di Stream.Initializes an instance of the ServiceDescription class by directly loading the XML from a Stream instance.

public:
 static System::Web::Services::Description::ServiceDescription ^ Read(System::IO::Stream ^ stream);
public static System.Web.Services.Description.ServiceDescription Read (System.IO.Stream stream);
static member Read : System.IO.Stream -> System.Web.Services.Description.ServiceDescription
Public Shared Function Read (stream As Stream) As ServiceDescription

Parametri

stream
Stream

Oggetto Stream, passato per riferimento, contenente i byte da leggere.A Stream, passed by reference, which contains the bytes to be read.

Restituisce

ServiceDescription

Istanza del ServiceDescription.An instance of the ServiceDescription.

Esempio

// Create a StreamReader to read a WSDL file.
StreamReader^ myStreamReader = gcnew StreamReader( "MyWsdl.wsdl" );
ServiceDescription^ myDescription = ServiceDescription::Read( myStreamReader );
Console::WriteLine( "Bindings are: " );

// Display the Bindings present in the WSDL file.
System::Collections::IEnumerator^ myEnum = myDescription->Bindings->GetEnumerator();
while ( myEnum->MoveNext() )
{
   Binding^ myBinding = safe_cast<Binding^>(myEnum->Current);
   Console::WriteLine( myBinding->Name );
}
// Create a StreamReader to read a WSDL file.
StreamReader myStreamReader = new StreamReader("MyWsdl.wsdl");
ServiceDescription myDescription =
   ServiceDescription.Read(myStreamReader);
Console.WriteLine("Bindings are:");

// Display the Bindings present in the WSDL file.
foreach(Binding myBinding in myDescription.Bindings)
{
   Console.WriteLine(myBinding.Name);
}
' Create a StreamReader to read a WSDL file.
Dim myStreamReader As New StreamReader("MyWsdl.wsdl")
Dim myDescription As ServiceDescription = _
   ServiceDescription.Read(myStreamReader)
Console.WriteLine("Bindings are :")

' Display the Bindings present in the WSDL file.
Dim myBinding As Binding
For Each myBinding In myDescription.Bindings
   Console.WriteLine(myBinding.Name)
Next myBinding

Si applica a

Read(XmlReader)

Inizializza un'istanza della classe ServiceDescription caricando il codice XML direttamente da un oggetto XmlReader.Initializes an instance of the ServiceDescription class by directly loading the XML from an XmlReader.

public:
 static System::Web::Services::Description::ServiceDescription ^ Read(System::Xml::XmlReader ^ reader);
public static System.Web.Services.Description.ServiceDescription Read (System.Xml.XmlReader reader);
static member Read : System.Xml.XmlReader -> System.Web.Services.Description.ServiceDescription
Public Shared Function Read (reader As XmlReader) As ServiceDescription

Parametri

reader
XmlReader

Oggetto XmlReader, passato per riferimento, contenente i dati XML da leggere.An XmlReader, passed by reference, which contains the XML data to be read.

Restituisce

ServiceDescription

Istanza del ServiceDescription.An instance of the ServiceDescription.

Esempio

// Create a new XmlTextWriter with specified URL.
XmlTextReader^ myXmlReader = gcnew XmlTextReader( "All_CS.wsdl" );
ServiceDescription^ myServiceDescription = ServiceDescription::Read( myXmlReader );
myServiceDescription->TargetNamespace = "http://tempuri.org/";

// Remove the service named MathService.
ServiceCollection^ myServiceDescriptionCollection = myServiceDescription->Services;
myServiceDescriptionCollection->Remove( myServiceDescription->Services[ "MathService" ] );
// Create a new XmlTextWriter with specified URL.
XmlTextReader myXmlReader = new XmlTextReader("All_CS.wsdl");
ServiceDescription myServiceDescription =
   ServiceDescription.Read(myXmlReader);
myServiceDescription.TargetNamespace = "http://tempuri.org/";

// Remove the service named MathService.
ServiceCollection myServiceDescriptionCollection =
   myServiceDescription.Services;
myServiceDescriptionCollection.Remove(
   myServiceDescription.Services["MathService"]);
' Create a new XmlTextWriter with specified URL.
Dim myXmlReader As New XmlTextReader("All_VB.wsdl")
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read(myXmlReader)
myServiceDescription.TargetNamespace = "http://tempuri.org/"

' Remove the service named MathService.
Dim myServiceDescriptionCollection As ServiceCollection = _
   myServiceDescription.Services
myServiceDescriptionCollection.Remove( _
   myServiceDescription.Services("MathService"))

Si applica a