Question

We have a WebService running in glassfish and a client written in C#

When trying to add a service reference in visual studio, I get the errormessage

unsupported Content-Type: application/soap+xml; charset=utf-8 Supported Content-Types are: [text/xml]

This just worked until a few days ago, I do not know of any changes in client and server that could cause that.

I already get the message in the glassfish console window when I call "Add service reference", select the adress http://localhost:8888/Service/MyWebService?wsdl and press the Go button.

The service reference does not work, I do not get a connection to the WebService afterwards.

Can someone point me in the right direction?

What can I do about it?

How can I find out more about what is going wrong?

Here is the full error message. Please note that I translated some parts to make it more readable, (the supported and unsupported), please excuse if this is not the correct english errormessage.

[#|2013-06-25T12:04:28.316+0200|SEVERE|glassfish3.1.2|com.sun.xml.ws.transport.http.HttpAdapter|_ThreadID=139;_ThreadName=http-thread-pool-8888(5);|Unsupported Content-Type: application/soap+xml; charset=utf-8 Supported Content-Types are: [text/xml]
com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: application/soap+xml; charset=utf-8 Supported Content-Types are: [text/xml]
        at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:322)
        at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:156)
        at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:312)
        at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:344)
        at com.sun.xml.ws.transport.http.HttpAdapter.invokeAsync(HttpAdapter.java:509)
        at com.sun.xml.ws.transport.http.servlet.ServletAdapter.invokeAsync(ServletAdapter.java:206)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:159)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:194)
        at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:80)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Unknown Source)
|#]
Was it helpful?

Solution 2

Something inside the WebService has changed.

But I was able to generate the proxy by calling svcutil in the Visual Studio command line manually.

The warnings there gave me good hints to change the webservice so that I can add a service reference now again.

OTHER TIPS

What data are you sending to your service? Look at "unsupported Content-Type: application/soap+xml; charset=utf-8"

Could be that server receives what it does not expect to receive? E.g. suddenly changed encoding.

P.S. I can't comment, so answering

IMHO, you're client is making the call using Soap 1.2 protocol, whereas the server is (by default) configured to use the Soap 1.1 protocol.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top