A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint

Sajith picture Sajith · Mar 18, 2013 · Viewed 17.8k times · Source

I am getting a error, when calling a spring-cxf-webservice from spring batch application.This error is happening only when its calling from batch.When calling from the normal soap UI its working fine.And once its calling from batch some of the records getting processed.Error is happening for a few records.Checked the SOAP version of batch and webservice and its same.

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:144)
                at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
                at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:799)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1627)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1494)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1402)
                at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
                at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:649)
                at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
                at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:533)
                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
                at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
                at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)

Batch Configuration

<jaxws:client id="mainClient"
              serviceClass="com.batch.service.MainSoap"
              address="${url}" />

Any help or way to identify the root cause would be appreciated

Answer

Peter picture Peter · Oct 22, 2013

Just add the Soap-Binding.

<jaxws:endpoint id="mainClient" serviceClass="com.batch.service.MainSoap"
  address="${url}">

  <jaxws:binding>
    <soap:soapBinding version="1.2" mtomEnabled="true" />
  </jaxws:binding>
</jaxws:endpoint>