Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Accessing Services in a Servlet
Accessing Services in a Servlet [message #1647149] Tue, 03 March 2015 09:23 Go to next message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 213
Registered: November 2014
Senior Member

Hello there,

I'm just trying to authenticate within a servlet and therefore I'd like to call a webservice. For testing purposes i just added the webservice from the tutorial.

I registered my own servlet and security filter (as shown in the BahBah Chat demo code). Everything works fine till there. Within my servlet I want to invoke the webservice in order to check credientials....

  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    res.setHeader("Cache-Control", "no-cache"); //HTTP 1.1
    res.setHeader("Pragma", "no-cache"); //HTTP 1.0
    res.setDateHeader("Expires", 0); //prevents caching at the proxy server
    String webserviceParam = req.getHeader("webserviceRequest");
    ...
      StockQuoteServiceSoapWebServiceClient service = SERVICES.getService(StockQuoteServiceSoapWebServiceClient.class);
    ....
  }


Unfortunately the SERVICES.getService() call always return null. Even when I want to lookup DB services (which I know they work when the application is started) are returning null.

Is this place - within a servlet - for a service lookup too early? And how could I possibly invoke a webservice at this point of time?

Thanks

Peter
Re: Accessing Services in a Servlet [message #1647443 is a reply to message #1647149] Tue, 03 March 2015 12:33 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Have you read this: Custom Servlet => use SERVICES.getService(..) ?
Re: Accessing Services in a Servlet [message #1649009 is a reply to message #1647443] Wed, 04 March 2015 05:43 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 213
Registered: November 2014
Senior Member

Thanks. Found it and did more or less a copy & paste and it works Smile

Thanks
Previous Topic:Delete Row
Next Topic:Different ways to authenticate within the application
Goto Forum:
  


Current Time: Wed Sep 25 05:46:53 GMT 2024

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

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

Back to the top