SendMessageContent 构造函数
定义
初始化 SendMessageContent 类的新实例。Initializes a new instance of the SendMessageContent class.
重载
| SendMessageContent() |
初始化 SendMessageContent 类的新实例。Initializes a new instance of the SendMessageContent class. |
| SendMessageContent(InArgument) |
使用要发送的指定数据初始化 SendMessageContent 类的新实例。Initializes a new instance of the SendMessageContent class with the specified data to send. |
| SendMessageContent(InArgument, Type) |
使用指定的消息和消息类型初始化 SendMessageContent 类的新实例。Initializes a new instance of the SendMessageContent class with the specified message and message type. |
SendMessageContent()
初始化 SendMessageContent 类的新实例。Initializes a new instance of the SendMessageContent class.
public:
SendMessageContent();
public SendMessageContent ();
Public Sub New ()
适用于
SendMessageContent(InArgument)
使用要发送的指定数据初始化 SendMessageContent 类的新实例。Initializes a new instance of the SendMessageContent class with the specified data to send.
public:
SendMessageContent(System::Activities::InArgument ^ message);
public SendMessageContent (System.Activities.InArgument message);
new System.ServiceModel.Activities.SendMessageContent : System.Activities.InArgument -> System.ServiceModel.Activities.SendMessageContent
Public Sub New (message As InArgument)
参数
- message
- InArgument
要发送的数据。The data to send.
示例
下面的示例演示如何使用此构造函数。The following example shows how to use this constructor.
Variable<PurchaseOrder> po = new Variable<PurchaseOrder>();
Variable<Customer> customer = new Variable<Customer>();
Endpoint clientEndpoint = new Endpoint
{
Binding = Constants.Binding,
AddressUri = new Uri(Constants.ServiceAddress)
};
Send submitPO = new Send
{
Endpoint = clientEndpoint,
ServiceContractName = Constants.POContractName,
OperationName = Constants.SubmitPOName,
Content = new SendMessageContent(new InArgument<PurchaseOrder>(po))
};
适用于
SendMessageContent(InArgument, Type)
使用指定的消息和消息类型初始化 SendMessageContent 类的新实例。Initializes a new instance of the SendMessageContent class with the specified message and message type.
public:
SendMessageContent(System::Activities::InArgument ^ message, Type ^ declaredMessageType);
public SendMessageContent (System.Activities.InArgument message, Type declaredMessageType);
new System.ServiceModel.Activities.SendMessageContent : System.Activities.InArgument * Type -> System.ServiceModel.Activities.SendMessageContent
Public Sub New (message As InArgument, declaredMessageType As Type)
参数
- message
- InArgument
要发送的数据。The data to send.
- declaredMessageType
- Type
服务说明中显示的数据类型。The data type that appears on the service description. 它必须与 message 或 message 的任意基类属于同一类型。It must be the same type as message or any base type of message.