Skip to main content

Unsupported Content Type

3 replies [Last post]
rohead
Offline
Joined: 2008-12-17

I am using Endpoint.publish() to start up a web service. When I invoke the method using the client stub, I get the exception below. Do I need to change some configuration settings on either the client or the server to fix this?

com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: application/soap+xml Supported ones are: [text/xml]
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:291)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:128)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:287)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276)
at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:432)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:106)
at com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:91)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:552)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:524)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Robert Wierschke

Hi,

I'm getting the same exception when deploying my web service in glassfish v2
(from NetBeans). Also the service works fine.

regards
robert

2008/12/18

> I am using Endpoint.publish() to start up a web service. When I invoke the
> method using the client stub, I get the exception below. Do I need to
> change some configuration settings on either the client or the server to fix
> this?
>
> com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type:
> application/soap+xml Supported ones are: [text/xml]
> at
> com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:291)
> at
> com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:128)
> at
> com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:287)
> at
> com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276)
> at
> com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
> at
> com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:432)
> at
> com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
> at
> com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:106)
> at
> com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:91)
> at
> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at
> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> at
> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> at
> sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:552)
> at
> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at
> sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:524)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> [Message sent by forum member 'rohead' (rohead)]
>
> http://forums.java.net/jive/thread.jspa?messageID=322254
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>
[att1.html]

Daniel Manzke

Hi,

I know this problem. I've developed a web service deployed it on tomcat 5
and 6, all was fine until there. Then I created a .NET-Application which
causes this stacktrace. Then I import the wsdl with the visual studio, this
stacktrace is generated.

Daniel

2008/12/18 Robert Wierschke

> Hi,
>
> I'm getting the same exception when deploying my web service in glassfish
> v2 (from NetBeans). Also the service works fine.
>
> regards
> robert
>
> 2008/12/18
>
> I am using Endpoint.publish() to start up a web service. When I invoke the
>> method using the client stub, I get the exception below. Do I need to
>> change some configuration settings on either the client or the server to fix
>> this?
>>
>> com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type:
>> application/soap+xml Supported ones are: [text/xml]
>> at
>> com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:291)
>> at
>> com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:128)
>> at
>> com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:287)
>> at
>> com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276)
>> at
>> com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
>> at
>> com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:432)
>> at
>> com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
>> at
>> com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:106)
>> at
>> com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:91)
>> at
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>> at
>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>> at
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>> at
>> sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:552)
>> at
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>> at
>> sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:524)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>> at java.lang.Thread.run(Thread.java:619)
>> [Message sent by forum member 'rohead' (rohead)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=322254
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
>> For additional commands, e-mail: users-help@metro.dev.java.net
>>
>>
>

--
Mit freundlichen Grüßen

Daniel Manzke
[att1.html]

wierob
Offline
Joined: 2007-03-26

Hi,

I've resolved the problem.

'application/soap+xml' is the content type used for SOAP 1.2 messages whereas text/xml is used for SOAP 1.1. Hence the client send SOAP 1.2 requests and service expects only SOAP 1.1.

Metro uses SOAP 1.1 by default. How to enable SOAP 1.2 binding is explained here:
- http://forums.java.net/jive/thread.jspa?messageID=322894
- https://metro.dev.java.net/1.4/docs/soap12.html

regards
robert