3 Replies Latest reply on Jun 7, 2011 9:20 AM by Freeman(Yue) Fang

    servicemix-cxf-bc soap 1.1 vs 1.2

    Fernando Salceda Novice

      Hi, Im using a servicemix-cxf-bc consumer on Fuse-ESB (4.3.0-fuse-03-00) with a wsdl that looks like:

       

      -


      <?xml version="1.0" encoding="UTF-8"?>

      <wsdl:definitions name="PielThirdPartyService" targetNamespace="http://thirdparty.piel.andago.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://thirdparty.piel.andago.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/">

        <wsdl:types>

      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://thirdparty.piel.andago.com/" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://thirdparty.piel.andago.com/">

        <xs:complexType abstract="true" name="pielDomainInput">

          <xs:sequence>

            <xs:element minOccurs="0" name="pielInputInfo" type="tns:pielInputInfo"/>

          </xs:sequence>

        </xs:complexType>

        <xs:complexType name="pielInputInfo">

      ...

      ...

      ...

      ...   

      <wsdl:operation name="find">

            <soap:operation soapAction="" style="document"/>

            <wsdl:input name="find">

              <soap:body use="literal"/>

            </wsdl:input>

            <wsdl:output name="findResponse">

              <soap:body use="literal"/>

            </wsdl:output>

          </wsdl:operation>

        </wsdl:binding>

        <wsdl:service name="PielThirdPartyService">

          <wsdl:port name="PielThirdPartyServicePort" binding="tns:PielThirdPartyServiceSoapBinding">

            <soap:address location="http://0.0.0.0:9090/PielThirdPartyServicePort"/>

          </wsdl:port>

        </wsdl:service>

       

      -


       

      I invoke the service sending the following soap message:

       

      -


      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:find xmlns:ns2="http://thirdparty.piel.andago.com/">

      ...

      ...

      ...

      </ns2:find></soap:Body></soap:Envelope>

      -


       

      And the consumer response is:

       

      -


       

       

       

      -


       

      Then the client throws an exception:

       

      -


      Interceptor for PielThirdPartyService#find has thrown exception, unwinding now

      org.apache.cxf.binding.soap.SoapFault: A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint.

           at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:136)

           at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)

           at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)

           at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:700)

           at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2261)

           at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2134)

           at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1988)

           at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)

           at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)

           at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)

           at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)

           at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487)

           at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)

           at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)

           at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)

           at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)

           at $Proxy297.find(Unknown Source)

           at com.andago.piel.thirdparty.client.PielThirdPartyClient.find(PielThirdPartyClient.java:59)

           at com.andago.piel.monitor.PielThirdPartyTest.attempt(PielThirdPartyTest.java:99)

           at com.andago.piel.monitor.PielThirdPartyTest.runTest(PielThirdPartyTest.java:62)

           at com.andago.piel.monitor.TestRunner.doGet(TestRunner.java:116)

           at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

           at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

           at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)

           at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)

           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

           at java.lang.Thread.run(Thread.java:619)

      -


       

       

      I think that the consumer should have responded with a soap 1.1 message because I sent a soap 1.1 message. And when I send a soap 1.2 request with a 1.2 response. Otherwise I got an exception!!

       

      Is there any thing I could do to fix it?

       

      Thx.

       

      Fernando.