Is JAX-WS client proxy thread safe?
Because creating web service client proxy object can be expensive, in my applications I want to reuse proxy objects. I was wondering if I can safely reuse in multiple threads. After asking uncle Google it seems, that it is not specification requirement that use of proxy objects is thread safe, but in JAX-WS RI, once proxy is created, it can be used across threads(as long as you don't change RequestContext in each thread) (by jitu).
http://forums.java.net/jive/thread.jspa?messageID=328378񐊺
http://forums.java.net/jive/thread.jspa?threadID=18756
http://markmail.org/message/gab5mztq33omeynf
I've checked this with simple application and it's true - using classes from JDK 1.6 I get an exception:
javax.xml.ws.soap.SOAPFaultException: Couldn't create SOAP message due to exception: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,2]
Message: The markup in the document preceding the root element must be well-formed.
If I run same code with JAX-WS RI classes it works fine.


0 Comments:
Post a Comment
<< Home