Modifica

Condividi tramite


MessagePartCollection.Add(MessagePart) Method

Definition

Adds the specified MessagePart to the end of the MessagePartCollection.

public:
 int Add(System::Web::Services::Description::MessagePart ^ messagePart);
public int Add (System.Web.Services.Description.MessagePart messagePart);
member this.Add : System.Web.Services.Description.MessagePart -> int
Public Function Add (messagePart As MessagePart) As Integer

Parameters

messagePart
MessagePart

The MessagePart to add to the collection.

Returns

The zero-based index where the messagePart parameter has been added.

Examples

MessagePart^ myMessagePart = gcnew MessagePart;
myMessagePart->Name = "parameters";
myMessagePart->Element = gcnew XmlQualifiedName( "AddResponse",myServiceDescription->TargetNamespace );
myMessage->Parts->Add( myMessagePart );
MessagePart myMessagePart = new MessagePart();
myMessagePart.Name = "parameters";
myMessagePart.Element = new
   XmlQualifiedName("AddResponse",myServiceDescription.TargetNamespace);
myMessage.Parts.Add(myMessagePart);
Dim myMessagePart As New MessagePart()
myMessagePart.Name = "parameters"
myMessagePart.Element = New XmlQualifiedName("AddResponse", _
   myServiceDescription.TargetNamespace)
myMessage.Parts.Add(myMessagePart)

Applies to