This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes How can i provide run time parameters? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How can i provide run time parameters?" Watch "How can i provide run time parameters?" New topic
Author

How can i provide run time parameters?

Rashmi Tambe
Ranch Hand

Joined: Aug 07, 2001
Posts: 418
Hi all,
I am using weblogic workshop 8.1 for developing a web service. I want to provide some run time environment specific parameters to the web service to avoid the hard coding. How can i pass them to web service?
or shd i read it from a properties file?

is there any standard way?
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Rashmi Tambe:
Hi all,
I want to provide some run time environment specific parameters to the web service to avoid the hard coding. How can i pass them to web service?
or shd i read it from a properties file?

The question is bit confusing for me.
Do you want to pass parameters to your webservices method ? or for the webservice implementations on the server ??
I'm sure you know that any webservices method can take input parameters, if you want to pass it dynamically then its depends on what you want to pass and how!..

Rashmi Tambe
Ranch Hand

Joined: Aug 07, 2001
Posts: 418
ok, let me explain...
I have a web service (jws file) that talks a EJB. the ejb is deployed on certain host. I do not want to hard-code this lookup url in the jws file. I want to keep it in some descriptor as a env entry. At run-time i shd be able to look up thi env entry from jws file and use the url for looking up the home interface.

Now my problem is : using weblogic workshop, the webservice (jws file) gets wrapped into a war. I tried providing env entries in the web.xml of the war. that did not helped. So what i wnat to know where do i specify this env entry so that the jws files can look up?
[ July 16, 2004: Message edited by: Rashmi Tambe ]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
You could place the variable into a properties file somewhere in the classpath (under "WEB-INF/classes" inside the .war file, for example) and use Class#getResourceAsStream() to access it.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can i provide run time parameters?
 
Similar Threads
Determing parameters of a service
xsd question
Conversion of message to SOAP in web service
How to get MetaData from web service
Web Service Access