Send 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
向服务发送消息的活动。
public ref class Send sealed : System::Activities::Activity
[System.Windows.Markup.ContentProperty("Content")]
public sealed class Send : System.Activities.Activity
[<System.Windows.Markup.ContentProperty("Content")>]
type Send = class
inherit Activity
Public NotInheritable Class Send
Inherits Activity
- 继承
- 属性
示例
以下示例演示如何创建 Send 活动并将其添加到工作流。 该示例还演示如何使用 ReceiveReply 活动来接收回复消息。
Variable<string> message = new Variable<string>("message", "client");
Variable<string> result = new Variable<string> { Name = "result" };
Endpoint endpoint = new Endpoint
{
AddressUri = new Uri(Common.Constants.ServiceBaseAddress),
Binding = new BasicHttpBinding(),
};
Send requestEcho = new Send
{
ServiceContractName = XName.Get("Echo", "http://tempuri.org/"),
Endpoint = endpoint,
OperationName = "Echo",
Content = new SendParametersContent
{
Parameters =
{
{ "message", new InArgument<string>(message) }
}
}
};
workflow = new CorrelationScope
{
Body = new Sequence
{
Variables = { message, result },
Activities =
{
new WriteLine {
Text = new InArgument<string>("Hello")
},
requestEcho,
new ReceiveReply
{
Request = requestEcho,
Content = new ReceiveParametersContent
{
Parameters =
{
{ "echo", new OutArgument<string>(result) }
}
}
},
new WriteLine {
Text = new InArgument<string>(result)
}
}
}
};
构造函数
| 名称 | 说明 |
|---|---|
| Send() |
初始化 Send 类的新实例。 |
属性
| 名称 | 说明 |
|---|---|
| Action |
获取或设置要发送的消息的操作标头的值。 |
| CacheId |
获取在工作流定义范围内唯一的缓存的标识符。 (继承自 Activity) |
| Constraints |
获取可配置为提供验证的活动Constraint集合Activity。 (继承自 Activity) |
| Content |
获取或设置活动发送 Send 的内容。 |
| CorrelatesWith |
获取或设置一个关联句柄,该句柄用于将消息路由到相应的工作流实例。 |
| CorrelationInitializers |
获取相关初始值设定项的集合。 |
| DisplayName |
获取或设置用于调试、验证、异常处理和跟踪的可选友好名称。 (继承自 Activity) |
| Endpoint |
获取或设置要向其发送消息的终结点。 |
| EndpointAddress |
获取或设置要向其发送消息的终结点的地址。 |
| EndpointConfigurationName |
获取或设置终结点配置的名称。 |
| Id |
获取工作流定义范围中唯一的标识符。 (继承自 Activity) |
| Implementation |
获取或设置返回 Activity 包含执行逻辑的委托。 (继承自 Activity) |
| ImplementationVersion |
获取或设置所使用的实现的版本。 (继承自 Activity) |
| KnownTypes |
获取要调用的服务操作的已知类型的集合。 |
| OperationName |
获取或设置要调用的服务操作的名称。 |
| ProtectionLevel |
获取或设置一个值,该值指示消息的保护级别。 |
| SerializerOption |
获取或设置一个值,该值指定发送消息时要使用的序列化程序。 |
| ServiceContractName |
要调用的服务实现的协定的名称。 |
| TokenImpersonationLevel |
获取或设置一个值,该值指示消息接收方允许的令牌模拟级别。 |
方法
| 名称 | 说明 |
|---|---|
| CacheMetadata(ActivityMetadata) |
创建并验证活动参数、变量、子活动和活动委托的说明。 (继承自 Activity) |
| Equals(Object) |
确定指定的对象是否等于当前对象。 (继承自 Object) |
| GetHashCode() |
用作默认哈希函数。 (继承自 Object) |
| GetType() |
获取当前实例的 Type。 (继承自 Object) |
| MemberwiseClone() |
创建当前 Object的浅表副本。 (继承自 Object) |
| OnCreateDynamicUpdateMap(UpdateMapMetadata, Activity) |
创建动态更新映射时引发事件。 (继承自 Activity) |
| ShouldSerializeDisplayName() |
指示是否 DisplayName 应序列化属性。 (继承自 Activity) |
| ToString() |
返回一个String包含Id和 DisplayName //Activity (继承自 Activity) |