Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Web Service configuration
Web Service configuration [message #180599] Thu, 05 October 2006 11:37 Go to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
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 #180610 is a reply to message #180599] Thu, 05 October 2006 13:14 Go to previous messageGo to next message
Eclipse UserFriend
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 #180626 is a reply to message #180610] Thu, 05 October 2006 14:07 Go to previous messageGo to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
I assumed that since the web service is a (fancy) servlet there must be a
standard way to configure it, at least like any other servlet...

"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 #181057 is a reply to message #180599] Fri, 06 October 2006 17:00 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #181248 is a reply to message #181057] Tue, 10 October 2006 06:52 Go to previous messageGo to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
Which thread is it...?

"Alex Smith" <asmith@foo.org> wrote in message
news:eg623l$qq3$1@utils.eclipse.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 #181264 is a reply to message #181193] Tue, 10 October 2006 11:29 Go to previous messageGo to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
I've put it in he static initializer - is that OK?

"Wolfgang Knauf" <wknauf_NO_@_INSIDE_hg-online.de> wrote in message
news:egdqbr$mhc$1@utils.eclipse.org...
>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 Go to previous message
Eclipse UserFriend
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?
>
Previous Topic:WTP 1.5.x and Omondo UML working together
Next Topic:Generic Bea weblogic Server 9.2 problem.
Goto Forum:
  


Current Time: Fri Apr 19 23:21:20 GMT 2024

Powered by FUDForum. Page generated in 0.04127 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top