IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Explicit close of HTTP session

  • 1.  Explicit close of HTTP session

    Posted Thu May 15, 2003 09:58 PM

    Is there a simple way to force an HTTP session on an IS server (6.0) to close? We’ve got a situation where a large number of requests (thousands) are coming to an IS flow service via an HTTP request. The server is properly processing things, but the Statistics page is showing an active session for each of the requests. Those don’t go away until after the 10 minute session timeout period has expired.

    I know it’s possible to explicitly close an HTTP session since it is done when you log out of Developer or the Administrator page. I can’t find any way to do it in my code, though. I tried having the client code (which is Java) call the HttpURLConnection.disconnect() method, but that failed to make a difference. Is there something I can add to my flow service that will close the HTTP session?

    Thanks,
    Skip


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: Explicit close of HTTP session

    Posted Thu May 15, 2003 10:08 PM

    In the server admin reduce your HTTP session outbound and session inbound limit to a reasonable ammount best suitable to you. Preferably a minute or two. In addition to that you can make your service as stateless which are being invoked. See if this helps.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 3.  RE: Explicit close of HTTP session

    Posted Thu May 15, 2003 10:15 PM

    If the service (and all the services called by that service) are stateless the session will be cleaned up as soon as there is a successful return. There seems to be a bug if the service throws an exception the session is not getting closed immediately even for stateless services.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Explicit close of HTTP session

    Posted Thu May 15, 2003 10:19 PM

    Good advice Sushil,

    If you don’t need a session to be created (ie. your code doesn’t use any parameters that are stored in the session) you could change the external service you’ve exposed to stateless - located on the ‘Settings’ tab for your flow service.

    Will


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Explicit close of HTTP session

    Posted Thu May 15, 2003 10:23 PM

    That’s a good suggestion, Sushil, and I believe that it solves my immediate problem. Thank you for that.

    I’m still curious, though, if there’s a way to kill a session. I found a service called wm.server.admin:killSession, but it requires some sort of session key input that I don’t understand.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 6.  RE: Explicit close of HTTP session

    Posted Thu May 15, 2003 10:33 PM

    Skip,if you want to use killSesion you may need to give the session ID that you want to kill or you can kill all the active session, which may not be so benifitial for you.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 7.  RE: Explicit close of HTTP session

    Posted Fri May 16, 2003 12:07 AM

    Skip,

    You can get the session ID by using the webMethods API. Create a Java service with the code below. Make sure you import com.wm.app.b2b.server.Service on your Shared tab. This should return your session ID.

    IDataUtil.put( pipelineCursor, “sessionID”, Service.getSession().getSessionID() );

    -Michelle


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 8.  RE: Explicit close of HTTP session

    Posted Fri May 16, 2003 12:21 PM

    Cant we use the service wm.server.query:getSessionList to get the session list?
    Thanks


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 9.  RE: Explicit close of HTTP session

    Posted Fri May 16, 2003 01:02 PM

    Thanks for the tip, Michelle. That looks like exactly what I’m looking for.

    Vinod, I may give the getSessionList service a try as well. Sounds like that service will get all sessions, though, so I’m not sure how I’d tell which one I want to kill.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: Explicit close of HTTP session

    Posted Mon May 19, 2003 03:40 PM

    A good way to do this is have the client call the “wm.server:disconnect” service as the last thing they do…or you could even add this as the last step of the flow that they call…

    I haven’t tested this in awhile but it previously caused the IS to cleanup the session related to that connection.

    Hope this helps…

    Tony


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 11.  RE: Explicit close of HTTP session

    Posted Fri July 02, 2004 09:59 PM

    I am trying to create a service using the wm.server.admin:killSession service, but i don’t see any service in/out parameters? Please advise if someone has had this problem, or is there some configuration required to solve this.
    Thanks so much!

    Harsh


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services