Action和soapAction与Java和WCF的兼容性

时间:2017-10-02 15:58:36

标签: wcf wcf-binding

我正在研究WCF,但是我遇到了一个问题,提供的Java生成的WSDL有一些与WCF配置不匹配的配置。 关键是WSDL需要在portType操作中设置Action,但要在绑定Attribute中将soapAction设置为空,如下所示:

这就是我需要的:

<portType name="Service1">
        <operation name="operation1">
          <input wsam:Action="http://www. wwwmyUrl.com / Service1/ operation1Request" message="tns: operation1 "/>
          <output wsam:Action="http://www. wwwmyUrl.com / Service1/ operation1Response" message="tns: operation1 Response"/>
        </operation>
    </portType>
    <binding name="Service1ImplPortBinding" type="tns: Service1 ">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <operation name=" operation1">
          <soap:operation soapAction=""/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
    </binding>

我在界面操作中设置了属性

[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction= "")]

但是它从porType中删除了Action并且它与所需的匹配。

这是结果:

<portType name="Service1">
    <operation name="operation1">
      <input wsam:Action=" " message="tns: operation1 "/>
      <output wsam:Action=" " message="tns: operation1 Response"/>
    </operation>
</portType>
<binding name="Service1ImplPortBinding" type="tns: Service1 ">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name=" operation1">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
</binding>

0 个答案:

没有答案