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 newbie: passing configuration param to WS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "newbie: passing configuration param to WS" Watch "newbie: passing configuration param to WS" New topic
Author

newbie: passing configuration param to WS

Mark Donaghue
Greenhorn

Joined: Mar 27, 2007
Posts: 1
Hi,

I'm trying to figure out the simplest way to communicate a configuration parameter to a web service. In this case, it's a directory location. I've done a lot of searching, but I'm not clear on how to achieve this. I'm using Tomcat 5.028, Axis 1.4.

I'm thinking about adding something to web.xml, either this:

<web-app>
<context-param>
<param-name>
dir_name
</param-name>
<param-value>
/usr/local/abcd
</param-value>
</context-param>

or perhaps this:

<init-param>
<param-name>dir_name</param-name>
<param-value>f/usr/local/abcd</param-value
</init-param>

But, I'm not clear on the difference between the two, nor how to access them from a wsdl-generated web service (...SoapBindingImpl).

Any ideas appreciated!
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 210
Access to the context param is possible through servletcontext.
In JAX RPC service endpoint, (i.e which implements the servicelifecycle),
init method has the context object,which can be typcasted to servletcontext.

The parameter can be obtained from that

One More question
1. You have web.xml entries, you have code for accessing webservices
2. Does your webservice run in the same app server as client?


SCJP 1.4 SCWCD 1.4 SCDJWS 1.4
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 210
http://java.sun.com/developer/technicalArticles/WebServices/getstartjaxrpc/

just got this. if you see the implementation,class, a similar to one should be written
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: newbie: passing configuration param to WS
 
Similar Threads
Scriptless JSP and config param
service interface in both web.xml and webservices.xml?
Spring-Hibernate: LazyInitializationException
SelectManyListBox is acting really weird
Spring-Hibernate: proxy Session closed