Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6780453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:30:28+00:00 2026-05-26T16:30:28+00:00

In case if user works with web application via web browser, the user’s session

  • 0

In case if user works with web application via web browser, the user’s session is managed by application server. It takes care of sessions creation, validation, timeouts, disposings, etc.

And as far as I know there is no such mechanisms in the other case, if user works with app via remote client and uses SOAP web services.

So the question is, how can we manage users’ sessions in case of web services and implement the same mechanisms of session management such as invalidation, prolongation, disposing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:30:28+00:00Added an answer on May 26, 2026 at 4:30 pm

    Assuming you use JAX-WS and SOAP/HTTP it is possible to work with container managed security (and e.g. session cookies) as well. You just have to inject WebServiceContext in your service. It allows access to all HTTP environment variables:

    @Resource
    WebServiceContext wsContext;
    

    A detailed example is available here. Of course, your clients must support this as well (if they are JAX-WS based it works). Nevertheless, a rule of thumb is that web services should not maintain any state at all, they should behave stateless. See this on SO.

    Edit: You can access the ServletRequest by:

    @WebMethod
    public void foo() {
        final MessageContext mc = this.wsContext.getMessageContext();
        final ServletRequest sr = mc.get(MessageContext.SERVLET_REQUEST);
    
        /* works if this is a HTTP(s) request */
        if (sr != null && sr instanceof HttpServletRequest) {
            final HttpServletRequest hsr = (HttpServletRequest) sr;
            hsr.getSession(true);
    
            /* ... */
    
        } else {
            /* do some exceptional stuff */
        }
    
    }
    

    The session created above should behave in exactly the same way as a ‘standard’ web session. You must make sure that your clients understand that as well. They have to submit the session identifier (cookie) on each subsequent call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to expire the my browser session in case of user inactivity for
I use JMeter to test my web application. and my test case is to
I have a web application which provides Excel files via IE 7. It requests
I've got a web application, deployed on GlassFish 3.0.1, which is using container managed
I am implementing the Express Checkout API for a web application, and everything works
We have a .NET web application installed on our server at the location: C:\Inetpub\fmtool\
Use case: user clicks the link on a webpage - boom! load of files
The main user-case is: Create the 2D floor plan See the 3D view of
Here's the use case: A user clicks on a link that opens a window
Use Case When a user goes to my website, they will be confronted with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.