2010-04-04 28 views

回答

5

Action爲您的服務方法的soap操作定義了您的輸入uri。

回覆操作定義了服務方法的輸出uri。

它們基本上用於定製兩者的uri。見下文。

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

您的WSDL中,你會看到

<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 " /> 

這有意義嗎?