【问题标题】:How to change JAVAX-WS Endpoint binding to SOAP 1.2?如何将 JAVAX-WS 端点绑定更改为 SOAP 1.2?
【发布时间】:2011-04-28 16:15:51
【问题描述】:

我正在使用Endpoint.publish() 发布一个测试 WS 实现,以便在 Visual Studio 中使用。根据the documentation,默认SOAP 绑定是1.1,并且可以更改绑定,但我无法具体弄清楚如何将绑定更改为1.2

感谢任何帮助!

【问题讨论】:

    标签: java eclipse web-services soap java-metro-framework


    【解决方案1】:

    使用 JAX-WS 2.x,您可以通过配置文件或 Java 5 注释启用 SOAP 1.2。有关详细信息,请参阅here (original, now broken link)。

    【讨论】:

    • java.net 现已关闭,没有替代在线。有例子吗?
    • 您可以在 SEI impl 类上使用:@BindingType(SOAPBinding.SOAP12HTTP_BINDING)。我不确定 config 属性是什么。
    • 修复了链接,javaee.github.io上的资源又出现了。
    【解决方案2】:

    由于当前答案无效且链接已损坏

    按类注解

    @BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
    

    按代码配置

    JaxWsClientFactoryBean factory = new JaxWsClientFactoryBean();
    ...
    factory.setBindingId(SOAPBinding.SOAP12HTTP_BINDING);
    

    通过xml配置

    <binding name="headwig">
      <wsoap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="weave">
          <wsoap12:operation soapAction="" style="documment"/>
          <input name="grain">
            <wsoap12:body .../>
            <wsoap12:header message="QName" part="partName"
                           use="literal|encoded"
                            encodingStyle="encodingURI"
                            namespace="namespaceURI" />
          </input>
    ...
    </binding>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-28
      • 1970-01-01
      • 1970-01-01
      • 2017-01-16
      • 1970-01-01
      相关资源
      最近更新 更多