Message 类
定义
提供 XML Web services 所传递的数据的抽象定义。Provides an abstract definition of data passed by an XML Web service. 此类不能被继承。This class cannot be inherited.
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可以包含面向文档或面向过程的信息。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.
Message类对应于 Web 服务描述语言 (message 由根元素括起来的 WSDL) 元素 definitions 。The Message class corresponds to a Web Services Description Language (WSDL) message element enclosed by the definitions root element. 有关 WSDL 的更多信息,请参阅 WSDL 规范。For more information about WSDL, see the WSDL specification.
构造函数
| Message() |
初始化 Message 类的新实例。Initializes a new instance of the Message class. |
属性
| Documentation |
获取或设置 DocumentableItem 的实例的文本文档。Gets or sets the text documentation for the instance of the DocumentableItem. (继承自 DocumentableItem) |
| DocumentationElement |
获取或设置 DocumentableItem 的文档元素。Gets or sets the documentation element for the DocumentableItem. (继承自 DocumentableItem) |
| ExtensibleAttributes |
获取或设置类型为 XmlAttribute 的数组,该数组表示为符合 Web 服务互操作性 (WS-I) 基本概要 1.1 而进行的 WSDL 特性扩展。Gets or sets an array of type XmlAttribute that represents attribute extensions of WSDL to comply with Web Services Interoperability (WS-I) Basic Profile 1.1. (继承自 DocumentableItem) |
| Extensions |
获取与此 ServiceDescriptionFormatExtensionCollection 关联的 Message。Gets the ServiceDescriptionFormatExtensionCollection associated with this Message. |
| Extensions |
获取与此 ServiceDescriptionFormatExtensionCollection 关联的 DocumentableItem。Gets the ServiceDescriptionFormatExtensionCollection associated with this DocumentableItem. (继承自 DocumentableItem) |
| Name |
获取或设置当前 Message 的名称。Gets or sets the name of the current Message. |
| Name |
获取或设置项的名称。Gets or sets the name of the item. (继承自 NamedItem) |
| Namespaces |
获取或设置命名空间前缀和命名空间的字典,该字典用于在构造 ServiceDescription 对象时,保留命名空间的前缀和命名空间。Gets or sets the dictionary of namespace prefixes and namespaces used to preserve namespace prefixes and namespaces when a ServiceDescription object is constructed. (继承自 DocumentableItem) |
| Parts |
获取 MessagePart 中包含的 Message 对象的集合。Gets the collection of the MessagePart objects contained in the Message. |
| ServiceDescription |
获取当前 ServiceDescription 为其成员的 Message。Gets the ServiceDescription of which the current Message is a member. |
方法
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| FindPartByName(String) |
搜索由 MessagePartCollection 属性返回的 Parts,并返回已命名的 MessagePart。Searches the MessagePartCollection returned by the Parts property, and returns the named MessagePart. |
| FindPartsByName(String[]) |
搜索由 MessagePartCollection 属性返回的 Parts 并返回包含命名实例的 MessagePart 类型的数组。Searches the MessagePartCollection returned by the Parts property and returns an array of type MessagePart that contains the named instances. |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |