Hello Fusion Geeks,
I am trying to call a web service. I am using "create web service proxy" in jdev, generated by JAX-WS. When I am calling the web service using Client java code generated by jdeveloper I am getting exception "Exception in thread "main" com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: application/octet-stream Supported ones are: [application/soap+xml]" . I did not get any response back from web service.
However I have some observations :
1) I switched on HTTP analyzer on my jdeveloper to check what SOAP request is getting passed from my program. I found that the perfect SOAP message has been formed and hitting the correct endpoint. And I found that correct response back in HTTP analyzer.
2) The error message I got is : "Exception in thread "main" com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: application/octet-stream Supported ones are: [application/soap+xml]" I looked into oracle support for this error message I found that this error message is listed there. I tried the solution mentioned under document titled "JAX-WS web service that uses SOAP 1.2 binding throws error "Unsupported Content-Type" [ID 844691.1]" . But that did not solve my problem.
And I found that correct response back in HTTP analyzer.
Can you see the HTTP headers? A correct response should have Content-type: application/soap+xml in the header... And it seems you getting Content-Type: application/octet-stream...
Hope this helps...
Thanks for your response. In response I see Content-Type: application/xop+xml; which is different from what you are saying (application/soap+xml). Surprisingly SOAP UI shows response correctly but it fails from java jax-ws proxy.
Content-Type: application/xop+xml; charset=utf-8; type="text/xml; charset=utf-8"
You need to enable MTOM in order to receive Content-Type: application/xop+xml...
Have a look at this...
Hope this helps...