Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unsupported Content-Type: text/html;charset=utf-8 Supported ones are: [text

843833Aug 1 2007 — edited Jul 10 2008
Hi I am in trouble with JAX-WS 2.1.2M1

I try to call my Webservice like this:
Service service = Service.create(serviceName);
        service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, "http://spblue.liberty:8084/SPBlue/GlobalLogoutService");

Dispatch<SOAPMessage> disp = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);

        SOAPMessage message = XmlUtil.getSOAPMessageFromString(request);
        
        
        SOAPMessage response = disp.invoke(message);
when my disp invokes I get following Exception which seems to as a little Problem, anyway I don�t know how to get rid of this Exception.

com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/html;charset=utf-8 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.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:74)
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:234)
at com.sun.xml.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:166)
at com.sun.xml.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:192)
at test.service.Logout.requestLogout(Logout.java:115)
at test.service.Logout.main(Logout.java:149)
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]

my ServiceClass is:
@ServiceMode(value=Service.Mode.MESSAGE)
@WebServiceProvider( targetNamespace="http://spblue.liberty:8084/wsdl/globalLogout")
public class GlobalLogoutServiceImpl implements Provider<SOAPMessage> {
    /**
     * Web service operation
     */

    public SOAPMessage invoke( SOAPMessage logoutRequest ){
     
        return logoutRequest;
    }  
}
So how can I set the Charachter set before invokikng the service.
Or how can I change the Service to accept UTF-8.
Well, I don�t know.

Any help is welcome.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2008
Added on Aug 1 2007
1 comment
6,124 views