MessageCollection.Add(Message) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定的 Message 加入至 MessageCollection 的結尾。
public:
int Add(System::Web::Services::Description::Message ^ message);
public int Add (System.Web.Services.Description.Message message);
member this.Add : System.Web.Services.Description.Message -> int
Public Function Add (message As Message) As Integer
參數
傳回
已加入 message
參數處的以零起始的索引。
範例
Message^ myMessage = gcnew Message;
myMessage->Name = "AddSoapOut";
MessagePart^ myMessagePart = gcnew MessagePart;
myMessagePart->Name = "parameters";
myMessagePart->Element = gcnew XmlQualifiedName( "AddResponse",myServiceDescription->TargetNamespace );
myMessage->Parts->Add( myMessagePart );
myServiceDescription->Messages->Add( myMessage );
Message myMessage = new Message();
myMessage.Name = "AddSoapOut";
MessagePart myMessagePart = new MessagePart();
myMessagePart.Name = "parameters";
myMessagePart.Element = new
XmlQualifiedName("AddResponse",myServiceDescription.TargetNamespace);
myMessage.Parts.Add(myMessagePart);
myServiceDescription.Messages.Add(myMessage);
Dim myMessage As New Message()
myMessage.Name = "AddSoapOut"
Dim myMessagePart As New MessagePart()
myMessagePart.Name = "parameters"
myMessagePart.Element = New XmlQualifiedName("AddResponse", _
myServiceDescription.TargetNamespace)
myMessage.Parts.Add(myMessagePart)
myServiceDescription.Messages.Add(myMessage)