File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

newbie: passing configuration param to WS

 
Mark Donaghue
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 217
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Karthik Rajendiran
Ranch Hand
Posts: 217
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic