|
Re: Web Service configuration [message #180610 is a reply to message #180599] |
Thu, 05 October 2006 13:14 |
Eclipse User |
|
|
|
Originally posted by: wknauf_NO_._INSIDE_hg-online.de
Hi Zohar,
I have done this using a separate properties file.
My code in the "....ServiceSOAPImpl" is this:
MessageContext axisContext = MessageContext.getCurrentContext();
ServletContext sc = ((javax.servlet.http.HttpServlet)
axisContext.getProperty(org.apache.axis.transport.http.HTTPC onstants.MC_HTTP_SERVLET)).getServletContext();
String path = sc.getRealPath("/WEB-INF/myconfig.ini");
Properties config = new Properties();
config.load(new java.io.FileInputStream(path));
But I think there are more elegant ways to config a web service.
Best regards
Wolfgang
Zohar schrieb:
> Hi,
> I've created a top-down web service from a WDSL file.
> I need some configuration params in that service (implementing the
> ServiceSoapImpl, which I hope is the right place). How can I read config
> params there?
>
> Thanks,
> Zohar.
>
>
|
|
|
|
Re: Web Service configuration [message #181057 is a reply to message #180599] |
Fri, 06 October 2006 17:00 |
Eclipse User |
|
|
|
Originally posted by: asmith.foo.org
Zohar wrote:
> Hi,
> I've created a top-down web service from a WDSL file.
> I need some configuration params in that service (implementing the
> ServiceSoapImpl, which I hope is the right place). How can I read config
> params there?
>
> Thanks,
> Zohar.
Axis-specific mechanism: http://wiki.apache.org/ws/FrontPage/Axis/WSDLJavaHeaderWSDL
That's half the answer. The other half is how to stuff that into WTP since the
WSDD treatment changes from build to build but you should be able to take
it from here. For a more generic solution, the servlet config approach given in
another thread is a good one.
|
|
|
Re: Web Service configuration [message #181109 is a reply to message #180610] |
Sat, 07 October 2006 23:40 |
Eclipse User |
|
|
|
Originally posted by: drbzij964l7td14.jetable.net
Where in the code did you do that? Is there some kind of an init() method I
can iverride?
"Wolfgang Knauf" <wknauf_NO_@_INSIDE_hg-online.de> wrote in message
news:eg30fh$pb7$1@utils.eclipse.org...
> Hi Zohar,
>
> I have done this using a separate properties file.
> My code in the "....ServiceSOAPImpl" is this:
>
> MessageContext axisContext = MessageContext.getCurrentContext();
> ServletContext sc = ((javax.servlet.http.HttpServlet)
> axisContext.getProperty(org.apache.axis.transport.http.HTTPC onstants.MC_HTTP_SERVLET)).getServletContext();
>
> String path = sc.getRealPath("/WEB-INF/myconfig.ini");
> Properties config = new Properties();
> config.load(new java.io.FileInputStream(path));
>
>
> But I think there are more elegant ways to config a web service.
>
> Best regards
>
> Wolfgang
>
> Zohar schrieb:
>> Hi,
>> I've created a top-down web service from a WDSL file.
>> I need some configuration params in that service (implementing the
>> ServiceSoapImpl, which I hope is the right place). How can I read config
>> params there?
>>
>> Thanks,
>> Zohar.
|
|
|
Re: Web Service configuration [message #181193 is a reply to message #181109] |
Mon, 09 October 2006 15:38 |
Eclipse User |
|
|
|
Originally posted by: wknauf_NO_._INSIDE_hg-online.de
I did it in the constructor of my ...SOAPImpl class:
It's probably not the best approach (I don't know how often the constructor is
called), but in my case this was sufficient.
Best regards
Wolfgang
Adar Wang schrieb:
> Where in the code did you do that? Is there some kind of an init() method I
> can iverride?
>
|
|
|
|
|
Re: Web Service configuration [message #181311 is a reply to message #181264] |
Tue, 10 October 2006 14:50 |
Eclipse User |
|
|
|
Originally posted by: wknauf_NO_._INSIDE_hg-online.de
Yes, this sounds better than my approach ;-).
Wolfgang
Zohar schrieb:
> I've put it in he static initializer - is that OK?
>
|
|
|
Powered by
FUDForum. Page generated in 0.04127 seconds