SOAP call constructor each time

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2006
Posts: 2
Reputation: romex21 is an unknown quantity at this point 
Solved Threads: 0
romex21 romex21 is offline Offline
Newbie Poster

SOAP call constructor each time

 
0
  #1
Nov 30th, 2006
Hi,
I am running a webapp in Tomcat 5.0 with Axis 1.4
My web app loads on startup.
When I make a SOAP call to the webapp (which is a servlet) it takes a new instance of the servlet instead of the original servlet that is already running.

The wsdd file is deployed using the Axis AdminClient.

Is this a setup problem, or is that the way that Axis Soap works?

I am happy to post the relevant code but I'm ot sure which part of the code is the problem...

Thanks in advance.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: SOAP call constructor each time

 
0
  #2
Nov 30th, 2006
Are you sure it's calling the servlet constructor?
That would be really weird.

Remember that your SOAP service classes are NOT servlets (or at least not used as such by the SOAP processes) and are indeed most likely initialised one for each request.
Nothing weird about that (though a SOAP stack I guess might decide to cache them for performance reasons, at the cost of increased complexity and memory requirements).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 2
Reputation: romex21 is an unknown quantity at this point 
Solved Threads: 0
romex21 romex21 is offline Offline
Newbie Poster

Re: SOAP call constructor each time

 
0
  #3
Nov 30th, 2006
Hey jwenting,
Thanks for the reply.

So just to clarify.

I have a servlet webapp that initialises variables that are constantly updated. I want to update these variables directly through remote SOAP requests.

Is it possible to access an existing method of servlet that is already running without calling a new instance of the program?
hence updating the variable...

OR

Is the only way to update these variables to pass a soap request to the server which would instantiate a new class and then I could update the variables as session variables and access these from the servlet?


Any reply would be helpfull as I need to persue either one way or the other.

Thanks.


Originally Posted by jwenting View Post
Are you sure it's calling the servlet constructor?
That would be really weird.

Remember that your SOAP service classes are NOT servlets (or at least not used as such by the SOAP processes) and are indeed most likely initialised one for each request.
Nothing weird about that (though a SOAP stack I guess might decide to cache them for performance reasons, at the cost of increased complexity and memory requirements).
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: SOAP call constructor each time

 
0
  #4
Dec 1st, 2006
You should never have a servlet maintain state outside of a specific HTTP session!
It's highly dangerous, unreliable, and unpredictable.
And what you're trying to do is having sessions in one web application (the SOAP stack) directly influence another web application, which is barred (and rightly so) for security reasons by every well designed application server.

You'll have to find some other way for them to communicate. Most likely that will have to be a database of some sorts.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC