users@glassfish.java.net

Re: JAX-WS "Unsupported Content-Type: text/plain"

From: Ryan de Laplante <ryan_at_ijws.com>
Date: Wed, 06 Jun 2007 12:15:04 -0400

I've stripped all security settings out of the one service that is
having problems. One by one I added bits back and found that the problem
is related to enabling SSL. Even though service client #1 can use SSL
to communicate with service #1, service client #2 gets the exception
when communicating with service #2. There is no HTTP BASIC
authentication. Here is the web.xml of the service:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>
            index.jsp
        </welcome-file>
    </welcome-file-list>
   
    <security-constraint>
        <display-name>SSL Constraint</display-name>
        <web-resource-collection>
            <web-resource-name>MyService</web-resource-name>
            <description/>
            <url-pattern>/*</url-pattern>
            <http-method>GET</http-method>
            <http-method>PUT</http-method>
            <http-method>HEAD</http-method>
            <http-method>POST</http-method>
            <http-method>OPTIONS</http-method>
            <http-method>TRACE</http-method>
            <http-method>DELETE</http-method>
        </web-resource-collection>
        <user-data-constraint>
            <description/>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
</web-app>




Ryan de Laplante wrote:
> Hi,
>
> I have two web services that are secured with transport layer SSL, and
> HTTP BASIC authentication. One is a servlet endpoint, and the other
> is an EJB endpoint. When deployed to my local Sun App Server 9.1
> Beta, my service client (deployed to same app server) works great. I
> can chance the password being used by the service client and I get
> exceptions. Perfect.
>
> When I deploy the services to a Sun App Server 9.0, and run the client
> from my Sun App Server 9.1, the service client that talks to the
> servlet endpoint service throws the following exception:
>
> com.sun.xml.ws.server.UnsupportedMediaException: Unsupported
> Content-Type: text/plain; charset=iso-8859-1 Supported ones are:
> [text/xml]
> at
> com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:116)
> at
> com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:280)
>
> at
> com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:158)
>
> at
> com.sun.enterprise.webservice.ClientSecurityPipe.processSecureRequest(ClientSecurityPipe.java:159)
>
> at
> com.sun.enterprise.webservice.ClientSecurityPipe.process(ClientSecurityPipe.java:147)
>
> at
> com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:79)
>
> at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:559)
> at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:518)
> at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:503)
> at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:400)
> at com.sun.xml.ws.client.Stub.process(Stub.java:235)
> at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:120)
> at
> com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:230)
>
> at
> com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210)
>
> at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
> .........
>
> The client for the EJB endpoint service works fine! I can't find
> anything on google and have spend some time tweaking settings, trying
> various things, etc... and can't figure this one out. Any ideas?
>
>
> Thanks,
> Ryan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>