Message Class
Provides an abstract definition of data passed by an XML Web service. This class cannot be inherited.
For a list of all members of this type, see Message Members.
System.Object
System.Web.Services.Description.DocumentableItem
System.Web.Services.Description.Message
[Visual Basic] NotInheritable Public Class Message Inherits DocumentableItem [C#] public sealed class Message : DocumentableItem [C++] public __gc __sealed class Message : public DocumentableItem [JScript] public class Message extends DocumentableItem
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Remarks
A Message can contain either document-oriented or procedure-oriented information. Procedure-oriented messages contain parameters and return values, while document-oriented messages contain documents.
The Message class corresponds to a Web Services Description Language (WSDL) <message> element enclosed by the <definitions> root element. For more information about WSDL, see the specification at http://www.w3.org/TR/wsdl/.
Example
[Visual Basic] ' Creates a Message with name = messageName having one MessagePart ' with name = partName. Public Shared Function CreateMessage(messageName As String, _ partName As String, element As String, targetNamespace As String) _ As Message Dim myMessage As New Message() myMessage.Name = messageName Dim myMessagePart As New MessagePart() myMessagePart.Name = partName myMessagePart.Element = New XmlQualifiedName(element, targetNamespace) myMessage.Parts.Add(myMessagePart) Return myMessage End Function 'CreateMessage [C#] // Creates a Message with name = messageName having one MessagePart // with name = partName. public static Message CreateMessage(string messageName,string partName, string element,string targetNamespace) { Message myMessage = new Message(); myMessage.Name = messageName; MessagePart myMessagePart = new MessagePart(); myMessagePart.Name = partName; myMessagePart.Element = new XmlQualifiedName(element,targetNamespace); myMessage.Parts.Add(myMessagePart); return myMessage; } [C++] // Creates a Message with name = messageName having one MessagePart // with name = partName. public: static Message* CreateMessage(String* messageName,String* partName, String* element,String* targetNamespace) { Message* myMessage = new Message(); myMessage->Name = messageName; MessagePart* myMessagePart = new MessagePart(); myMessagePart->Name = partName; myMessagePart->Element = new XmlQualifiedName(element,targetNamespace); myMessage->Parts->Add(myMessagePart); return myMessage; }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Namespace: System.Web.Services.Description
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: System.Web.Services (in System.Web.Services.dll)