开发者

Action and ReplyAction in WCF Proxy

What is the use of Action and ReplyActio开发者_开发问答n in OperationContract attribute ?


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?


Its for WS addressing.

Introduction to WS-Addressing: http://www.fpml.org/_wgmail/_bpwgmail/pdfdz3oYx1M9e.pdf http://www.w3.org/Submission/ws-addressing/

Look at the reply soap message: http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.action.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜