Condividi tramite


ServiceDescription.Messages Proprietà

Definizione

Ottiene l'insieme degli elementi Message contenuti in ServiceDescription.

public:
 property System::Web::Services::Description::MessageCollection ^ Messages { System::Web::Services::Description::MessageCollection ^ get(); };
public System.Web.Services.Description.MessageCollection Messages { get; }
member this.Messages : System.Web.Services.Description.MessageCollection
Public ReadOnly Property Messages As MessageCollection

Valore della proprietà

MessageCollection

Raccolta di elementi del messaggio contenuti nella descrizione servizio.

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")

Commenti

La MessageCollection proprietà restituita da questa proprietà corrisponde all'elenco di message elementi racchiusi nell'elemento radice WSDL (Web Services Description Language). definitions Per altre informazioni su WSDL, vedere la specifica WSDL.

Si applica a