12

I'm getting the error "Transport level information does not match with SOAP Message namespace URI". Request you provide the details to fix the issue.

I have set the below in the client side.

HttpTransportProperties.ProxyProperties proxyProperties = new HttpTransportProperties.ProxyProperties();
proxyProperties.setProxyName(proxyAddress);
proxyProperties.setProxyPort(proxyPort);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED,Boolean.FALSE);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.PROXY, proxyProperties);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.HEADER_CONTENT_TYPE,"application/soap+xml");
stub._getServiceClient().getOptions().setProperty("type","application/soap+xml");
stub._getServiceClient().getOptions().setProperty(HTTPConstants.HEADER_SOAP_ACTION, Action_URL);
stub._getServiceClient().getOptions().setProperty ( HTTPConstants.HTTP_PROTOCOL_VERSION, HTTPConstants.HEADER_PROTOCOL_11 ) ;
stub._getServiceClient().getOptions().setProperty ( "Transfer-Encoding", "chunked" ) ;
stub._getServiceClient().getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, "true");

Can you please help to solve the issue?

Joe F
  • 4,174
  • 1
  • 14
  • 13
Srini
  • 121
  • 1
  • 1
  • 3

2 Answers2

20

That error occurs if there is a mismatch between the content type and the SOAP version (as determined by the namespace URI of the SOAP envelope) of the received message. E.g. if Axis2 receives a SOAP 1.2 message with content type text/xml, it will trigger that error.

Andreas Veithen
  • 8,868
  • 3
  • 25
  • 28
  • 2
    What should the Content-Type contain? Should that header be removed from the request entirely? Ah, here's the answer: https://stackoverflow.com/questions/26465349/what-content-type-should-be-in-http-header-of-soap-1-2-message – hourback Jan 19 '16 at 15:52
0

Joe - If you are getting this error, then I am assuming that you are trying to access a service that is really old and you might be using Axis that is version 2.0 . You will not be able to call the service by creating client using Axis or CXF. I have spent days trying to figure this out. Eventually I ended up using SAAJ API to create the request WSDL and post it to the service.

It is very easy and keeps you away from trying to figure out RPC/Literal/Document style etc.

See this post - Post

Dinesh Arora
  • 2,115
  • 3
  • 24
  • 30