What happens if you call factory.setWsdlLocation(....) with the location of the wsdl? Does that then make it send soap 1.2 properly? (Also, try with 2.2.4)
Doing that may actually be important. I notice your binding has a policy reference in it. Without the wsdl location set, the policy would not be applied. Without seeing the policy, I'm not sure how important that is. Dan On Fri November 13 2009 1:34:00 pm John Hite wrote: > 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 > -- Daniel Kulp [email protected] http://www.dankulp.com/blog
