User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 391,906 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,577 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1101 | Replies: 3
Reply
Join Date: Nov 2006
Posts: 2
Reputation: romex21 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
romex21 romex21 is offline Offline
Newbie Poster

Help SOAP call constructor each time

  #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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,646
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 191
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: SOAP call constructor each time

  #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).
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
Reply With Quote  
Join Date: Nov 2006
Posts: 2
Reputation: romex21 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
romex21 romex21 is offline Offline
Newbie Poster

Re: SOAP call constructor each time

  #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  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,646
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 191
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: SOAP call constructor each time

  #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.
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Java Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 7:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC