facebook

Jax-ws tutorial done, but …

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #299280 Reply

    korayuygun
    Member

    Hello,
    the functionnalities offered by MyEclipse to create web services are really fast to implement. My problem is that after I have installed webservices on my Weblogic server I wanted to followe this tutorial http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html to implement user session management but I dont know how to do.

      @Resource
      private WebServiceContext wsContext;
      public String doLogin(String login, String password) {
        LOGGER.debug("doLogin() - start");
            
        String result = "sdfgh";
        int state;
    
        try {
            MessageContext mc = wsContext.getMessageContext();
            HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
    
        } catch (Exception e) {
            LOGGER.error(e.getMessage(), e);
            result = e.getMessage();
        }
          
        LOGGER.debug("doLogin() - end");
        return result;
      }

    but wsContext is null.
    Please help.

    Thanks in advance,
    Koray.

    #299378 Reply

    korayuygun
    Member

    Ok, I have found a workaround. I Copy the content of my main class and create the webservice as told in the tutorial except the fact that I select the delegate being the same as the original class. I create the webservice, then as the functionnality changes the content of the class, I paste again what I have copied earlier. It works!

    #299893 Reply

    Loyal Water
    Member

    Thanks for posting the workaround.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Jax-ws tutorial done, but …

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in