Hi Dong,
I think this bug was fixed after JAXWS 2.1 EA3. Can you try the nightly
of JAXWS 2.1?
thanks,
-vivek.
Dong Liu wrote:
> Hi,
>
> I got the following on the client side when running the stateful client
> run:
> [java] ---[HTTP request]---
> [java] SOAPAction:
> [java] Content-Type: text/xml; charset="utf-8"
> [java] Accept: text/xml, multipart/related, text/html, image/gif,
> image/jpeg, *; q=.2, */*; q=.
> 2
> [java] <?xml version="1.0" ?><S:Envelope xmlns:S="
> http://schemas.xmlsoap.org/soap/envelope/"><S
> :Body><ns3:getProduct xmlns:ns2="http://www.w3.org/2005/08/addressing"
> xmlns:ns3=" http://server.stat
> eful/"><arg0>abc001</arg0></ns3:getProduct></S:Body></S:Envelope>--------------------
> [java] ---[HTTP response 200]---
> [java] null: HTTP/1.1 200 OK
> [java] Content-type: text/xml; charset=UTF-8
> [java] Connection: keep-alive
> [java] Transfer-encoding: chunked
> [java] Server: Jetty(6.0.2)
> [java] <?xml version="1.0" ?><S:Envelope xmlns:S="
> http://schemas.xmlsoap.org/soap/envelope/"><S
> :Body><ns2:getProductResponse xmlns:ns2="http://server.stateful/
> <http://server.stateful/>" xmlns:ns3="http://www.w3.org/2005/
> 08/addressing"><return><ns3:Address>http://localhost:8080/jaxws-stateful/book
> <http://localhost:8080/jaxws-stateful/book></ns3:Address><ns3:Refe
> renceParameters><jaxws:objectId
> xmlns:jaxws="http://jax-ws.dev.java.net/xml/ns/" xmlns:wsa=" http://w
> ww.w3.org/2005/08/addressing
> <http://ww.w3.org/2005/08/addressing>">114a5378-c8ff-4f67-8784-184389a7eb65</jaxws:objectId></ns3:ReferencePa
> rameters></return></ns2:getProductResponse></S:Body></S:Envelope>--------------------
>
> [java] ---[HTTP request]---
> [java] SOAPAction:
> [java] Content-Type: text/xml; charset="utf-8"
> [java] Accept: text/xml, multipart/related, text/html, image/gif,
> image/jpeg, *; q=.2, */*; q=.
> 2
> [java] <?xml version="1.0" ?><S:Envelope
> xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S
> :Body><ns3:getProduct xmlns:ns2="
> http://www.w3.org/2005/08/addressing" xmlns:ns3="http://server.stat
> eful/"><arg0>def999</arg0></ns3:getProduct></S:Body></S:Envelope>--------------------
>
> [java] ---[HTTP response 200]---
> [java] null: HTTP/1.1 200 OK
> [java] Content-type: text/xml; charset=UTF-8
> [java] Connection: keep-alive
> [java] Transfer-encoding: chunked
> [java] Server: Jetty( 6.0.2)
> [java] <?xml version="1.0" ?><S:Envelope
> xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S
> :Body><ns2:getProductResponse xmlns:ns2=" http://server.stateful/"
> xmlns:ns3="http://www.w3.org/2005/
> 08/addressing"><return><ns3:Address>
> http://localhost:8080/jaxws-stateful/book</ns3:Address><ns3:Refe
> renceParameters><jaxws:objectId
> xmlns:jaxws="http://jax-ws.dev.java.net/xml/ns/" xmlns:wsa=" http://w
> ww.w3.org/2005/08/addressing
> <http://ww.w3.org/2005/08/addressing>">af0a219c-2527-4c75-88ec-fc64a60d8d58</jaxws:objectId></ns3:ReferencePa
> rameters></return></ns2:getProductResponse></S:Body></S:Envelope>--------------------
>
> [java] --- testing ID ---
> [java] ---[HTTP request]---
> [java] SOAPAction: http://server.stateful/Book/getIdRequest
> [java] Content-Type: text/xml; charset="utf-8"
> [java] Accept: text/xml, multipart/related, text/html, image/gif,
> image/jpeg, *; q=.2, */*; q=.
> 2
> [java] <?xml version="1.0" ?><S:Envelope xmlns:S="
> http://schemas.xmlsoap.org/soap/envelope/"><S
> :Header><jaxws:objectId
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> <http://www.w3.org/2005/08/addressing>" wsa:IsReferenceParameter="1
> " xmlns:jaxws="http://jax-ws.dev.java.net/xml/ns/"
> xmlns:ns2="http://server.stateful/ <http://server.stateful/>"
> xmlns:ns3="ht
> tp://www.w3.org/2005/08/addressing"
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> <http://www.w3.org/2005/08/addressing>">114a5378-c8ff-4
> f67-8784-184389a7eb65</jaxws:objectId><To
> xmlns="http://www.w3.org/2005/08/addressing"> http://localh
> ost:8080/jaxws-stateful/book</To><Action
> xmlns="http://www.w3.org/2005/08/addressing">http://server .
> stateful/Book/getIdRequest</Action><ReplyTo
> xmlns="http://www.w3.org/2005/08/addressing">
> [java] <Address>
> http://www.w3.org/2005/08/addressing/anonymous</Address>
> [java] </ReplyTo><MessageID
> xmlns="http://www.w3.org/2005/08/addressing">uuid:3f2fd84c-946c-4de
> 9-b6d2-1aef7b8f11bd</MessageID></S:Header><S:Body><ns3:getId
> xmlns:ns2="http://www.w3.org/2005/08/ad
> dressing" xmlns:ns3="
> http://server.stateful/"/></S:Body></S:Envelope>--------------------
> [java] Exception in thread "main"
> javax.xml.ws.WebServiceException: No Content-Type in the head
> er!
> [java] at
> com.sun.xml.ws.transport.http.client.HttpTransportPipe.getContentType(HttpTranspo
> rtPipe.java:167)
> [java] at
> com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.
> java:132)
> [java] at
> com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTranspo
> rtPipe.java:69)
> [java] at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:541)
> [java] at com.sun.xml.ws.api.pipe.Fiber.doRun (Fiber.java:497)
> [java] at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:392)
> [java] at com.sun.xml.ws.client.Stub.process(Stub.java:213)
> [java] at com.sun.xml.ws.client.sei.SEIStub.doProcess
> (SEIStub.java:120)
> [java] at
> com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:238)
> [java] at
> com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:212)
> [java] at
> com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
> [java] at $Proxy31.getId(Unknown Source)
> [java] at stateful.client.Main.main(Unknown Source)
> [java] Java Result: 1
>
> BUILD SUCCESSFUL
> Total time: 5 seconds
>
> And the server side:
>
> Jan 1, 2007 10:05:13 PM
> com.sun.xml.ws.transport.http.servlet.WSServletDelegate doPost
> SEVERE: XML reader error: javax.xml.stream.XMLStreamException :
> ParseError at [row,col]:[1,373]
> Message: Attribute "xmlns:wsa" was already specified for element
> "jaxws:objectId".
> XML reader error: javax.xml.stream.XMLStreamException: ParseError at
> [row,col]:[1,373]
> Message: Attribute "xmlns:wsa" was already specified for element
> "jaxws:objectId".
> at
> com.sun.xml.ws.streaming.XMLStreamReaderUtil.wrapException(XMLStreamReaderUtil.java:246)
> at
> com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:70)
> at
> com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextContent(XMLStreamReaderUtil.java:85)
> at
> com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextElementContent
> (XMLStreamReaderUtil.java:
> 75)
> at
> com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:167)
> at
> com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:120)
> at
> com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:109)
> at
> com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:250)
> at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket
> (HttpAdapter.java:200)
> at
> com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:72)
> at
> com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:342)
> at
> com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:171)
> at
> com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:134)
> at
> com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost
> (WSServletDelegate.java:161
> )
> at
> com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:49)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> at javax.servlet.http.HttpServlet.service (HttpServlet.java:802)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
>
> It seems that the header writer did something wrong. The war is
> deployed on Jetty 6.
>
> Cheers,
>
> Dong
>
>
> --
> Dong Liu
> http://blogs.usask.ca/dong_notes/