如何将JAVAX-WS端点绑定更改为SOAP 1.2



我正在发布一个使用Endpoint.publish()在Visual Studio中使用的测试WS实现。根据文档,默认的SOAP绑定是1.1,并且可以更改绑定,但是我不能明确地指出如何将绑定更改为1.2

任何帮助都是感激的!

使用JAX-WS 2。您可以通过配置文件或Java 5注释启用SOAP 1.2。

由于当前答案无效且链接已断开

按类注释

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

By Code配置

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>

最新更新