I have a java app
that uses apache axis and makes soap calls to a soap server. My app is on the client side.
First of all I ran into the issue with stubs being not thread safe. I then
read up on axis mailing lists about this. Are stubs in latest version of
axis still not thread safe ?
According to
previous posts regarding stubs and serviceLocator and how heavyweight it is to
create the locators, I gathered we should have one instance of
serviceLocator and create a new stub for each call and then throw the stub
away. Following this advice in my app
I create only one serviceLocator and create a new stub within each method
that makes a call. Do stubs go away after they are out of scope or does
axis engine hold references to them ? Does serviceLocator which holds the engine
also hold a pool of connections ? What happens if a connection
in axis engine's connection pool is stale/dead b/c the back end server has been restarted
?
My concern is
when a client makes requests to the SOAP server and gets successfull
replies and then comes back next day and makes another request to the SOAP
server. Let's think of the scenario
where in the mean time the SOAP server was restarted. Now the axis engine will be holding references to stale connections
in its pool of connections and the stub which uses this stale connection to try
and connect to the server will fail even though
the server is up.
Therefore when
I bind to the soap server not only do I create a stub but I also need
to test if I get a successfull reply on a simple request. This will cover the case when the backend SOAP
server has been restarted and the connections referenced by current axis engine
are stale. If I get a failure
on the simple request then I will create a new
serviceLocator hence get a new axis engine
with no stale connections in it. I then try again with a new
stub obtained from this new serviceLocator. Note that it is expensive and
heavyweight to talk to the device, in my case almost as heavy as creating a
serviceLocator. So I am back to square one with expensive binds. Pls
let me know if my assumptions about axis engine internals described
here are correct.
Ler.na
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
