共存肥皂1.1和肥皂1.2

时间:2014-04-16 08:21:22

标签: soap

我有一个使用soap 1.1开发的Web服务。在使用此Web服务的客户中,有人需要使用soap 1.2。我考虑过进行必要的更改,但在这种情况下,我将打破仍在使用soap 1.1的其他客户的工作。 我的问题是:是否可以在同一个应用程序中共存soap 1.1和soap 1.2,或者必须部署两个应用程序。

1 个答案:

答案 0 :(得分:3)

经过一些研究后,我发现可以在同一个应用程序中部署soap 1.1和soap 1.2。事实上,使用jax-ws实现只需正确配置sun-jaxws.xml文件和端点类。

<endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"
version="2.0">
<endpoint name="Service11" implementation="mypackage.Service11Impl"
    url-pattern="/Service/11" enable-mtom="true" wsdl="/wsdl/service.wsdl" />
<endpoint name="Service12" implementation="mypackage.Service12Impl"
    url-pattern="/Service/12"
    binding="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/"
    enable-mtom="true" wsdl="/wsdl/service.wsdl" />

    @BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING)
    @WebService(...)
    public class Service11Impl extends ParentService {

    }

    @BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING)
    @WebService(...)
    public class Service112mpl extends ParentService {

    }
相关问题