Results 1 to 9 of 9
- 06-30-2011, 08:08 AM #1
Member
- Join Date
- Jun 2011
- Posts
- 5
- Rep Power
- 0
Unsupported Content-Type: text/html Supported ones are: [text/xml]
Hi,
We have a client application in Java and need to connect to their webservice.we are sending byte[] as request , but when i call thier webservice i get the following exception:
com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/html Supported ones are: [text/xml]
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(Str eamSOAPCodec.java:291)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(Str eamSOAPCodec.java:128)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SO APBindingCodec.java:287)
at com.sun.xml.ws.transport.http.client.HttpTransport Pipe.process(HttpTransportPipe.java:171)
at com.sun.xml.xwss.XWSSClientPipe.process(XWSSClient Pipe.java:118)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.process Request(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:5 95)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:55 4)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539 )
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:4 36)
at com.sun.xml.ws.client.Stub.process(Stub.java:248)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStu b.java:135)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke (SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke (SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.j ava:118)
at $Proxy48.storeDocument(Unknown Source)
at nl.aegon.schade.aov.service.ui.controller.Correspo ndenceController.callQISService(Unknown Source)
at nl.aegon.schade.aov.service.ui.controller.Correspo ndenceController.handle(Unknown Source)
at org.springframework.web.servlet.mvc.AbstractComman dController.handleRequestInternal(AbstractCommandC ontroller.java:87)
at org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:48)
at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:788)
at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:717)
at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.proces s(Http11AprProcessor.java:861)
at org.apache.coyote.http11.Http11AprProtocol$Http11C onnectionHandler.process(Http11AprProtocol.java:57 9)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run( AprEndpoint.java:1584)
at java.lang.Thread.run(Thread.java:619)
same is working fine when i use soap ui tool.
Please help??
- 06-30-2011, 09:30 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
That web service is passing back html.
SOAP expects xml.
Hence the error.
As to why it's sending back html I can only guess, but it's likely to be throwing some sort of error, which is being returned as html. Possibly a missing header?
- 06-30-2011, 11:27 AM #3
Member
- Join Date
- Jun 2011
- Posts
- 5
- Rep Power
- 0
we dnt need to send header information so header is missing and only body we are sending...but it is working fine in soap ui tool and giving the expected result but not when we test through java code.
- 06-30-2011, 12:27 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Then grab that html that's returned.
You should be able to intercept the raw response.
I would guarantee it's an error from the web service.
- 06-30-2011, 01:03 PM #5
Member
- Join Date
- Jun 2011
- Posts
- 5
- Rep Power
- 0
thanks tolls for your reply.
can you please let me know how to grab raw response and in that response am i able to get the data wat i need....
or should i send this error to that system guys where the webservice is running...
thnks
- 06-30-2011, 01:04 PM #6
Member
- Join Date
- Jun 2011
- Posts
- 5
- Rep Power
- 0
thanks tolls for your reply.
so the error is at thier end while sending the response.
can you please let me know how to grab raw response and in that response am i able to get the data wat i need....
or should i send this error to that system guys where the webservice is running...
thnks
- 06-30-2011, 01:42 PM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Depends on your web service client, but you can usually stick an interceptor, or handler, or some term like that into the call to handle the response.
I suspect the owners of the web service won't know what the problem is until you actually have the error.
- 06-30-2011, 01:54 PM #8
Member
- Join Date
- Jun 2011
- Posts
- 5
- Rep Power
- 0
it would be great if you can provide me an handler example for handiing the response....
- 06-30-2011, 02:08 PM #9
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
Javamail Message Content as Text
By hardcorebadger in forum New To JavaReplies: 2Last Post: 01-10-2011, 10:08 PM -
Applet program to open a text file and display the content in text area
By bitse in forum Java AppletsReplies: 0Last Post: 12-09-2010, 05:56 PM -
Content Changing to many Text files
By everythingteen in forum New To JavaReplies: 3Last Post: 04-28-2010, 04:16 PM -
Read text content from pdf using pdfbox
By cssatheesh in forum Advanced JavaReplies: 0Last Post: 09-22-2009, 08:54 PM -
Unsupported Content-Type: text/html Supported ones are: [text/xml]
By luislopezco in forum Advanced JavaReplies: 0Last Post: 05-26-2008, 04:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks