12

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

任何帮助表示赞赏!

4

2 回答 2

9

使用 JAX-WS 2.x,您可以通过配置文件或 Java 5 注释启用 SOAP 1.2。有关更多详细信息,请参见此处原始链接,现已断开链接)。

于 2011-04-28T18:13:22.010 回答
0

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

按类注解

@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>
于 2020-10-19T09:51:24.603 回答