Tuesday 20 December 2016

Error fetching web service - Not a valid SOAP Content-Type: text/html or application/xml

I have a web service (actually more than one) that is being called by java codes and by PL-SQL packages, in the production environment of the company everything is running perfectly. 
But we are creating another server to migrate. It was passed all to the other server but when calling services by java gives the following error:

Nested exception: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: oracle.j2ee.ws.saaj.ContentTypeException: Not a valid SOAP Content-Type: text / html
The service is working, if I enter directly through the url in the browser, it merges, when it is called by the PL-SQL packages it be works.
No code has been changed from environment to environment. I think it might be some configuration on the server that is causing the exception. 
And the error is happening in the call of any of the web services.


Solution:- 

Probably some detail of configuration. 
A tip that can help you. 
1) If soap 1.1 is the Content-Type, it must be text / xml. 
2) If soap 1.2 the Context-Type must be application / soap + xml

Probably your case should be 1.1 soap, but the client is 
sending a message with content-type wrong text / html, and 
the correct would be text / xml.


If you are invoking third party services and getting above error in SOA:

Create on variable in BPEL:  Content-Type and assign below value as respective

for soap 1.1 :-  'text/xml'
      soap1.2 :- 'application/soap+xml'
and then attched Content-Type variable into invoke Header Properties.

No comments:

Post a Comment