You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Forrest Xia <fo...@gmail.com> on 2012/11/07 09:00:14 UTC

What if the SEI is annotated with BindingType "SOAP12HTTP_BINDING", while wsdl file explicitly specify SOAP11 binding?

Hi All,

Recently I tried a jaxws app on CXF 2.6.1 with these configurations:
*1. the SEI is annotated with BindingType "SOAP12HTTP_BINDING"*
Class: jaxws.sample.SamplePortImpl.java

*package jaxws.sample;*
*
*
*import javax.jws.WebService;*
*import javax.xml.ws.BindingType;*
*import javax.xml.ws.Holder;*
*
*
*@BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)*
*@WebService((portName="SampleSOAP11Port",*
*                serviceName="SampleSOAP11Service",*
* targetNamespace="http://SampleSOAP11.sample.jaxws",*
*                endpointInterface="jaxws.sample.SampleSOAP11Port", *
* wsdlLocation="WEB-INF/wsdl/SampleSOAP11.wsdl")*
*public class SamplePortImpl implement SampleSOAP11Port {*
*    public void ping(Holder<String> ping) {*
* *
* }*
*}*

Class: jaxws.sample.SampleSOAP11Port.java
*package jaxws.sample;*
*
*
*import javax.jws.WebMethod;*
*import javax.jws.WebParam;*
*import javax.jws.WebService;*
*import javax.xml.ws.Holder;*
*import javax.xml.ws.RequestWrapper;*
*import javax.xml.ws.ResponseWrapper;*
*
*
*@WebService(name = "SampleSOAP11Port", targetNamespace = "
http://SampleSOAP11.sample.jaxws")*
*public interface SampleSOAP11Port {*
*    *
*    @WebMethod(action = "http://SampleSOAP11.sample.jaxws/ping")*
*    @RequestWrapper(localName = "ping", targetNamespace = "
http://sample.jaxws", className = "jaxws.sample.Ping")*
*    @ResponseWrapper(localName = "pingResponse", targetNamespace = "
http://sample.jaxws", className = "jaxws.sample.PingResponse")*
*    public void ping(*
*        @WebParam(name = "ping", targetNamespace = "", mode =
WebParam.Mode.INOUT)*
*        Holder<String> ping);*
*
*
*}*


*2. The embedded wsdl file specifies the binding type to SOAP11 like these:*
<wsdl:binding name="SampleBinding" type="tns:MismatchedSOAP11Port">
    <soap11:binding style="document" transport="
http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="ping">
       <soap11:operation soapAction="
http://MismatchedSOAP11.sample.jaxws/ping" />
<wsdl:input>
<soap11:body use="literal"  />
</wsdl:input>
<wsdl:output>
<soap11:body use="literal"  />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

I tried this sample in CXF 2.6.2 and Tomcat 7.0.29, and found the
application functions without any problem. So something confuses me there,
if the SEI is explicitly annotated with SOAP12 binding type, which is not
consistent with wsdl definition, should CXF report any error when running
the application??

Any insight thoughts here? thanks in advance!

-- 
Thanks!

Regards, Forrest