File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Thread safety of Axis client classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Thread safety of Axis client classes" Watch "Thread safety of Axis client classes" New topic
Author

Thread safety of Axis client classes

M Streit
Greenhorn

Joined: Jan 16, 2004
Posts: 27
I have a web service deployed in WAS on one machine and I have used the WSDL file to generate Axis 1.1 client classes using the Axis WSDL2Java tool. I want to run a client app from another machine where the client will be a servlet running in Tomcat or possibly JRun. The generated code includes the usual *ServiceLocator and *ServiceBindingStub classes. If I wanted to instantiate these classes, say from inside a servlet (the client using the service) can these generated client classes be instantiated once in the init() of the servlet and used in a thread-safe manner?


Thanks in advance for any input.
[ August 20, 2005: Message edited by: M Streit ]
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

It depends on whether your Webservice classes are thread safe or not. For example in Axis it is possible to specify the scope of service object - Application , Session and Request.
http://ws.apache.org/axis/java/user-guide.html

For WAS , please read the docs.


Groovy
M Streit
Greenhorn

Joined: Jan 16, 2004
Posts: 27
WAS server is not the issue. The question is again, running Axis client stub classes from within a simple servlet that is part of the client application talking to a web service running somewhere else, possibly WAS. The server end is not in question. It is the CLIENT side of the equation that may be at issue.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread safety of Axis client classes