Need authoritative answer on whether JAX-WS client objects are thread-safe
We need to know whether the service objects generated by wsimport (JAX-WS RI 2.0.1 and later versions), as well as the port objects returned by the getPort() methods of those service objects are thread-safe.
The spec appears to be ambiguous on this and forum posts for other JAX-WS implementations appear to indicate that these objects are not thread-safe for some implementations (e.g. Axis 2, CXF).
In our performance tests with JAX-WS RI 2.0.1 and 2.1.3, the overhead of the Service.getPort() method is very heavy with average response times of 400-1000 ms.
In order to achieve acceptable performance, we would need to cache and share port objects across threads. In order to do this, we need to know whether these objects are thread-safe. If we cannot do this, we may be forced to look at using an alternative web service stack.
The documentation for wsimport does not indicate whether these objects are thread-safe.
We were able to find two older forum posts where two posters indicate that service and port objects are thread-safe, however it is unclear whether these posters are actual developers on the JAX-WS RI codebase, whether they simply verified that a particular set of classes for a particular version were thread-safe, or whether this is being enforced from a project design perspective for past, present, and future versions of the JAX-WS RI implementation.
Relying on these few forum posts doesn't give us a good level of comfort in making the broad architectural decision to cache port objects for multi-threaded use and applying this to a mission-critical production application.
Can the JAX-WS RI documentation be updated to clearly indicate whether the user should expect wsimport-generated service and port objects to be thread-safe, and provide some basic guidelines on multi-threaded usage?
Without this, it is very difficult for developers to make informed architectural decisions that can impact the performance as well as the integrity of applications using JAX-WS RI.