I am trying to build sample sts example from this tutorial: http://docs.oracle.com/cd/E19159-01/820-1072/ahiey/index.html
I created STS service using STS wizard, and used it to secure sample Calculator app. But it gives following errors:
Unsupported Content-Type: application/soap+xml Supported ones are: [text/xml]
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:130) at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:294) at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276)
... ... ....
SEC2002: Container-auth: wss: Error validating request java.lang.NullPointerException at com.sun.xml.ws.message.stream.StreamMessage.(StreamMessage.java:168) at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:228)
... ... ....
WSS1611: Error occurred while buffering incoming SOAP message. javax.xml.stream.XMLStreamException: XMLStreamReader not positioned at a document or element at com.sun.xml.stream.buffer.stax.StreamReaderBufferCreator.store(StreamReaderBufferCreator.java:145) at com.sun.xml.stream.buffer.stax.StreamReaderBufferCreator.create(StreamReaderBufferCreator.java:82)
... .... ....
I set the system property to dump messages in server and I can see the SOAP messages exchanged between service and client.
Now, I see the new errors:
====[com.sun.xml.ws.assembler.server:request]====
com.sun.xml.ws.protocol.soap.VersionMismatchException: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got http://www.w3.org/2003/05/soap-envelope
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:184)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:163)
at com.sun.xml.ws.message.stream.LazyStreamBasedMessage.cacheMessage(LazyStreamBasedMessage.java:89)
at com.sun.xml.ws.message.stream.LazyStreamBasedMessage.copy(LazyStreamBasedMessage.java:457)
at com.sun.xml.ws.util.pipe.DumpTube.dump(DumpTube.java:118)
at com.sun.xml.ws.util.pipe.DumpTube.processRequest(DumpTube.java:97)
.... ......
From this error, I set service to use SOAP 1.2 using this annotation:
@javax.xml.ws.BindingType(value="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/")
But still gives me same errors.
For some reasons, I use Netbeans 6.0, jdk 1.5, glassfish 2. I updated versions, but got same error.
Since I used sts created by sts wizard and calculator app, I didn't do coding.
Could anybody tell me what is wrong?