How to access ServletContext from SOAP web service method?

R

RJGraham

Hello,

I have a method in a class exposed as a SOAP web service in a web
application running under TomCat 4.x and would like this method to get
access to the web app ServletContext.

Is this possible?

I've done a Google search and scoured the SOAP and Servlet javadocs but
can't see how to do this.

Thanks for any help.

-Randy
 
S

Sudsy

RJGraham said:
Hello,

I have a method in a class exposed as a SOAP web service in a web
application running under TomCat 4.x and would like this method to get
access to the web app ServletContext.

Is this possible?

I don't think you can since the class will have no idea that it's
running in a servlet container. Nor should it! That's the whole
point of the architecture you've chosen. If you want it to know
about the calling context then implement it some other way.
You can't have it both ways, you know.
 
R

RJGraham

Sudsy said:
I don't think you can since the class will have no idea that it's
running in a servlet container. Nor should it! That's the whole
point of the architecture you've chosen. If you want it to know
about the calling context then implement it some other way.
You can't have it both ways, you know.

I want my web service method to share an object with my servlets.
I can do this with a static but was wondering if ServletContext was
available.

-Randy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top