SendReply Classe

Definição

Uma atividade que envia a mensagem de resposta como parte de um padrão de troca de solicitação/resposta no lado do serviço.An activity that sends the reply message as part of a request/response message exchange pattern on the service side.

public ref class SendReply sealed : System::Activities::Activity
[System.Windows.Markup.ContentProperty("Content")]
public sealed class SendReply : System.Activities.Activity
[<System.Windows.Markup.ContentProperty("Content")>]
type SendReply = class
    inherit Activity
Public NotInheritable Class SendReply
Inherits Activity
Herança
SendReply
Atributos

Exemplos

O exemplo a seguir mostra como criar uma SendReply atividade e adicioná-la a um fluxo de trabalho no código.The following example shows how to create a SendReply activity and add it to a workflow in code.

Variable<string> message = new Variable<string> { Name = "message" };
Variable<string> echo = new Variable<string> { Name = "echo" };
Receive receiveString = new Receive
{
    OperationName = "Echo",
    ServiceContractName = "Echo",
    CanCreateInstance = true,
    //parameters for receive
    Content = new ReceiveParametersContent
    {
        Parameters = 
        {
            {"message", new OutArgument<string>(message)}
        }
    }
};

Sequence workflow = new Sequence()
{
    Variables = { message, echo },
    Activities =
        {
            receiveString,
            new WriteLine
            {
                Text = new InArgument<string>(env =>("Message received: " + message.Get(env)))
            },
            new Assign<string>
            {
                Value = new InArgument<string>(env =>("<echo> " + message.Get(env))),
                To = new OutArgument<string>(echo)
            },                        
            //parameters for reply
            new SendReply
            {                           
                Request = receiveString,                            
                Content = new SendParametersContent
                {
                    Parameters =
                    {
                        { "echo", new InArgument<string>(echo) }
                    },
                }
            },
            new WriteLine
            {
                Text = new InArgument<string>(env =>("Message sent: " + echo.Get(env)))
            },
        },
};

service = new WorkflowService
{
    Name = "Echo",
    Body = workflow
};

O exemplo a seguir mostra como criar uma SendReply atividade e adicioná-la a um serviço de fluxo de trabalho em XAML.The following example shows how to create a SendReply activity and add it to a workflow service in XAML.

<WorkflowService mc:Ignorable="sap" ConfigurationName="Service1" Name="Service1" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:ssa="clr-namespace:System.ServiceModel.Activities;assembly=System.ServiceModel.Activities" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">  
  <p:Sequence sad:XamlDebuggerXmlReader.FileName="c:\Projects\WFServiceSnippets\WFServiceSnippets\Service1.xamlx" sap:VirtualizedContainerService.HintSize="277,644" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">  
    <p:Sequence.Variables>  
      <p:Variable x:TypeArguments="CorrelationHandle" Name="__handle1" />  
      <p:Variable x:TypeArguments="x:String" Name="Message" />  
      <p:Variable x:TypeArguments="x:String" Name="Echo" />  
    </p:Sequence.Variables>  
    <sap:WorkflowViewStateService.ViewState>  
      <scg3:Dictionary x:TypeArguments="x:String, x:Object">  
        <x:Boolean x:Key="IsExpanded">True</x:Boolean>  
      </scg3:Dictionary>  
    </sap:WorkflowViewStateService.ViewState>  
    <Receive x:Name="__ReferenceID0" CanCreateInstance="True" DisplayName="ReceiveString" sap:VirtualizedContainerService.HintSize="255,90" OperationName="Echo" ServiceContractName="Echo">  
      <Receive.CorrelationInitializers>  
        <RequestReplyCorrelationInitializer CorrelationHandle="[__handle1]" />  
      </Receive.CorrelationInitializers>  
      <ReceiveParametersContent>  
        <p:OutArgument x:TypeArguments="x:String" x:Key="message">[Message]</p:OutArgument>  
      </ReceiveParametersContent>  
    </Receive>  
    <p:WriteLine sap:VirtualizedContainerService.HintSize="255,61" Text="[&quot;Message received: &quot; + Message]" />  
    <p:Assign sap:VirtualizedContainerService.HintSize="255,58">  
      <p:Assign.To>  
        <p:OutArgument x:TypeArguments="x:String">[Echo]</p:OutArgument>  
      </p:Assign.To>  
      <p:Assign.Value>  
        <p:InArgument x:TypeArguments="x:String">["<echo> " + Message]</p:InArgument>  
      </p:Assign.Value>  
    </p:Assign>  
    <SendReply Request="{x:Reference __ReferenceID0}" DisplayName="SendReply" sap:VirtualizedContainerService.HintSize="255,90">  
      <SendParametersContent>  
        <p:InArgument x:TypeArguments="x:String" x:Key="echo">[Echo]</p:InArgument>  
      </SendParametersContent>  
    </SendReply>  
    <p:WriteLine sap:VirtualizedContainerService.HintSize="255,61" Text="[&quot;Message sent: &quot; + Echo]" />  
  </p:Sequence>  
</WorkflowService>  

Construtores

SendReply()

Inicializa uma nova instância da classe SendReply.Initializes a new instance of the SendReply class.

Propriedades

Action

Obtém ou define o valor do cabeçalho de ação da mensagem.Gets or sets the value of the action header of the message.

CacheId

Obtém um identificador do cache que é exclusivo no escopo da definição do fluxo de trabalho.Gets the identifier of the cache that is unique within the scope of the workflow definition.

(Herdado de Activity)
Constraints

Obtém uma coleção de atividades de Constraint que podem ser configuradas para fornecer validação para a Activity.Gets a collection of Constraint activities that can be configured to provide validation for the Activity.

(Herdado de Activity)
Content

Obtém ou define o conteúdo enviado pela atividade SendReply.Gets or sets the content sent by the SendReply activity.

CorrelationInitializers

Obtém uma coleção de inicializadores de correlação.Gets a collection of correlation initializers.

DisplayName

Obtém ou define um nome amigável opcional que é usado para depuração, validação, manipulação de exceções e acompanhamento.Gets or sets an optional friendly name that is used for debugging, validation, exception handling, and tracking.

(Herdado de Activity)
Id

Obtém um identificador que é exclusivo no escopo da definição do fluxo de trabalho.Gets an identifier that is unique in the scope of the workflow definition.

(Herdado de Activity)
Implementation

Obtém ou define o delegado que retorna um Activity que contém a lógica de execução.Gets or sets the delegate that returns an Activity that contains the execution logic.

(Herdado de Activity)
ImplementationVersion

Obtém ou define a versão de implementação usada.Gets or sets the version of the implementation used.

(Herdado de Activity)
PersistBeforeSend

Obtém ou define um valor que especifica se a instância do serviço de fluxo de trabalho deve ser persistida antes de se enviar a mensagem.Gets or sets a value that specifies whether the workflow service instance should be persisted before sending the message.

Request

Obtém ou define uma referência à atividade Receive emparelhada com esta atividade SendReply.Gets or sets a reference to the Receive activity paired with this SendReply activity.

Métodos

CacheMetadata(ActivityMetadata)

Cria e valida uma descrição dos argumentos, das variáveis, das atividades filho e dos representantes da atividade.Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates.

(Herdado de Activity)
Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
FromOperationDescription(OperationDescription, IEnumerable<SendReply>)

Retorna a atividade de envio de resposta da descrição da operação de contrato fornecida.Returns the send reply activity from the given contract operation description.

GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
OnCreateDynamicUpdateMap(UpdateMapMetadata, Activity)

Gera um evento ao criar o mapa de atualização dinâmica.Raises an event when creating dynamic update map.

(Herdado de Activity)
ShouldSerializeDisplayName()

Indica se a propriedade DisplayName deve ser serializada.Indicates whether the DisplayName property should be serialized.

(Herdado de Activity)
ToString()

Retorna um String que contém o Id e DisplayName do Activity.Returns a String that contains the Id and DisplayName of the Activity.

(Herdado de Activity)

Aplica-se a