Message 類別

定義

提供 XML Web Service 所傳遞資料的抽象定義。 此類別無法獲得繼承。

public ref class Message sealed : System::Web::Services::Description::DocumentableItem
public ref class Message sealed : System::Web::Services::Description::NamedItem
public sealed class Message : System.Web.Services.Description.DocumentableItem
[System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")]
public sealed class Message : System.Web.Services.Description.NamedItem
type Message = class
    inherit DocumentableItem
[<System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")>]
type Message = class
    inherit NamedItem
Public NotInheritable Class Message
Inherits DocumentableItem
Public NotInheritable Class Message
Inherits NamedItem
繼承
繼承
屬性

範例

   // 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 = gcnew Message;
      myMessage->Name = messageName;
      MessagePart^ myMessagePart = gcnew MessagePart;
      myMessagePart->Name = partName;
      myMessagePart->Element = gcnew XmlQualifiedName( element,targetNamespace );
      myMessage->Parts->Add( myMessagePart );
      return myMessage;
   }
// 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;
}
' 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

備註

Message可以包含檔導向或程式導向的資訊。 程式導向訊息包含參數和傳回值,而檔導向訊息則包含檔。

類別 Message 會對應至根項目所 definitions 括住的 Web 服務描述語言 (WSDL) message 元素。 如需 WSDL 的詳細資訊,請參閱 WSDL 規格。

建構函式

Message()

初始化 Message 類別的新執行個體。

屬性

Documentation

取得或設定 DocumentableItem 的執行個體的文字文件。

(繼承來源 DocumentableItem)
DocumentationElement

取得或設定 DocumentableItem 的文件項目。

(繼承來源 DocumentableItem)
ExtensibleAttributes

取得或設定型別 XmlAttribute 的陣列,表示符合 Web 服務互通性 (WS-I) Basic Profile 1.1 的 WSDL 屬性擴充。

(繼承來源 DocumentableItem)
Extensions

取得與這個 ServiceDescriptionFormatExtensionCollection 關聯的 Message

Extensions

取得與這個 ServiceDescriptionFormatExtensionCollection 關聯的 DocumentableItem

(繼承來源 DocumentableItem)
Name

取得或設定目前 Message 的名稱。

Name

取得或設定項目的名稱。

(繼承來源 NamedItem)
Namespaces

取得或設定命名空間前置詞和命名空間的字典,用於在建構 ServiceDescription 物件時保留命名空間前置詞和命名空間。

(繼承來源 DocumentableItem)
Parts

取得包含於 MessagePart 中的 Message 物件的集合。

ServiceDescription

取得 ServiceDescription,目前 Message 為其中的成員。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
FindPartByName(String)

搜尋 MessagePartCollection 屬性傳回的 Parts,並傳回具名的 MessagePart

FindPartsByName(String[])

搜尋 MessagePartCollection 屬性傳回的 Parts,並傳回含有具名執行個體的 MessagePart 型別陣列。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於