Results 1 to 9 of 9
  1. #1
    viks is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default 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??

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,953
    Rep Power
    19

    Default

    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?

  3. #3
    viks is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    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.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,953
    Rep Power
    19

    Default

    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.

  5. #5
    viks is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    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

  6. #6
    viks is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    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

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,953
    Rep Power
    19

    Default

    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.

  8. #8
    viks is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    it would be great if you can provide me an handler example for handiing the response....

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,953
    Rep Power
    19

    Default

    I have no idea what framework you're using, so you'll have to dig out the docs for it your self.

Similar Threads

  1. Javamail Message Content as Text
    By hardcorebadger in forum New To Java
    Replies: 2
    Last Post: 01-10-2011, 10:08 PM
  2. Replies: 0
    Last Post: 12-09-2010, 05:56 PM
  3. Content Changing to many Text files
    By everythingteen in forum New To Java
    Replies: 3
    Last Post: 04-28-2010, 04:16 PM
  4. Read text content from pdf using pdfbox
    By cssatheesh in forum Advanced Java
    Replies: 0
    Last Post: 09-22-2009, 08:54 PM
  5. Replies: 0
    Last Post: 05-26-2008, 04:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •