Hi,

I am trying to write a client using cxf-2.2 for a SOAP 1.2 service. The wsdl 
has soap 1.2 binding configuration like this

<wsdl:binding name="WSHttpBinding_IProxyService" type="tns:IProxyService">
    <wsp:PolicyReference URI="#WSHttpBinding_IProxyService_policy" />
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"; />
    <wsdl:operation name="GetOneMessage">
      <soap12:operation 
soapAction="Services.Messaging/ISubscribe/GetOneMessage" style="document" />
      <wsdl:input name="GetOneMessageRequest">
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output name="GetOneMessageResponse">
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
</wsdl:binding>

I am using wsdl2java to generate the client interface and client beans, then I 
use JaxWsProxyFactoryBean to construct the actual client.

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(IProxyService.class);
factory.setAddress("http://localhost:8080/myservice";);
IProxyService client = (IProxyService) factory.create();

The soap messages generated are SOAP 1.1 messages, not SOAP 1.2. In order to 
get SOAP 1.2 messages, I have to add the following line:

factory.setBindingId("http://schemas.xmlsoap.org/wsdl/soap12/";);

Why does my client not know that it needs to use SOAP 1.2 unless I specify that 
binding id?

Thanks,
John

Reply via email to