• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

newbie: passing configuration param to WS

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic