tags:

views:

244

answers:

1

What is the use of Action and ReplyAction in OperationContract attribute ?

+1  A: 

Action defines your input uri for the soap operation for your service method.

Reply Action defines the output uri for your service method.

They are basically used to customize the uri for both. See below.

 [ServiceContract]
 public partial interface IServiceContract
 {
    [OperationContract(
            Action = "http://mynamspace/v1/IServiceContract/Input/ServiceMethod",
            ReplyAction = "http://mynamspace/v1/IServiceContract/Output/ServiceMethod")]
    SomeResponseType ServiceMethod(SomeRequestType x);

In your wsdl you would see

 <wsdl:portType name="IServiceContract">
    <wsdl:operation name="ServiceMethod">
    <wsdl:input wsaw:Action="http://mynamspace/v1/IServiceContract/Input/ServiceMethod" name="SomeRequestType" message="tns:SomeRequestType " /> 
    <wsdl:output wsaw:Action="http://mynamspace/v1/IServiceContract/Output/ServiceMethod" name="SomeResponseType" message="tns:SomeResponseType " /> 

That make sense?

Nix