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

Using the killsession service in webmethod

  • 1.  Using the killsession service in webmethod

    Posted Tue July 06, 2004 08:38 PM

    More recently apps running on webmethod servers have lot of unclosed sessions, which at a certain threshold causes the services to hangup. A server reboot is required to clear this sessions. I have been looking at the wmRoot package of webmethod and there is getSessionList and killSession services. I dont see any input and output parameters when i call the service in the flow, have anyone used these services and if yes please let me know. Any help will be very useful as i am stuck.
    Thanks!
    Harsh Uchariya


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


  • 2.  RE: Using the killsession service in webmethod

    Posted Tue July 06, 2004 09:12 PM

    Harsh,

    You are on the right track. I built a small service that calls getSessionList. I loop over the session data and I evaluate if the session expiration is a negative number, if so, I pass the session ID into the killSession service.

    One word of caution. Creating services in WmRoot is an unsupported activity so approach this carefully. That being said, I have had no issues with my service.

    Also, you can set your services to run stateless. This is more optimal and will cut down drastically on the number of sessions. The only sessions I keep stated are web services.

    Others may differ in their opinion or approach, but this is what works for me.

    HTH,

    Ray


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


  • 3.  RE: Using the killsession service in webmethod

    Posted Tue July 06, 2004 10:45 PM

    Ray,
    Thanks for the info! Can you also give me some example on how you were able to use getSessionList in your flow, i dont see any parameters (in the input/ouput window) when i call the service. Although when i run getSessionList alone it gets all the current sessions in a array. Do i need to create variables in getSessionList and killSession service to pass into the pipeline?.
    Thanks again!

    Harsh Uchariya


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


  • 4.  RE: Using the killsession service in webmethod

    Posted Tue July 06, 2004 11:38 PM

    Harsh,

    I have included some sample code. I highly recommend that you test this code prior to putting it into any production facility. It works as I described in my prior post.

    HTH

    Ray

    RMUtils.zip Package
    RMUtils.zip (4.0 k)


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


  • 5.  RE: Using the killsession service in webmethod

    Posted Tue July 06, 2004 11:41 PM

    Oh,

    I forgot: You will want to create a reoccurring scheduler to run every five minutes or at a set interval to wipe out these sessions.

    Ray


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


  • 6.  RE: Using the killsession service in webmethod

    Posted Wed July 07, 2004 01:30 AM

    Hiya Ray - long time!

    You had written “The only sessions I keep stated are web services.”

    Why do web services need to run stateless?


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


  • 7.  RE: Using the killsession service in webmethod

    Posted Wed July 07, 2004 04:05 AM

    Sonam,

    You confuse me? Web Services CAN run stateless if all they do is return a value like the get() method of a bean. Then there is no need to persist the session data. I have worked on a couple of .NET projects where the integration point into our system was a web service and we had to run those interfaces stated to mainstain session.

    I do not like to run anything stated due to the overhead.

    I have not had very many opportunities to run web services because most of my customers have security issues with the “open” architecture of a web service. This includes “secure” internal networks where financial or confidential data could be put at risk of disclosure, inadvertent or otherwise.

    Strange world we live in. Then you have Mavericks like Mark Carlson… he is the McGiver of webMethods… he can make a web service from a popsickle stick!

    How is the land down under? I kinda miss it, but at least I have my wife to remind me of there… Take care Sonam my friend.

    Ray


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


  • 8.  RE: Using the killsession service in webmethod

    Posted Wed July 07, 2004 10:08 AM

    Sorry for the confusion Ray. I really meant to ask:
    “why do web services need to run STATEFUL” (not “stateless”)

    You’re right about the overhead of stated services. I guess you run the web services stateful to avoid the expense of reauthentication on each request (possible by the client re-using the IS-issued cookie), right?

    Australia is doing well my friend - it’s a nice place. I just got back here from a vacation in India. Even though I lived most of my life in India, I felt a wierd “disconnection” going back - as if I was a stranger. Just as I was getting comfortable, I got back and felt the same disconnection here. I guess that’s how it really is - we’re really just passing through.

    Take care Ray!


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


  • 9.  RE: Using the killsession service in webmethod

    Posted Wed July 07, 2004 02:10 PM

    Ray,

    If you are expose popsicle sticks as document literal web services, you will need duct tape. SoapRPC web services do not require the duct tape soap interface.

    Those not steeped in late-80s TV pop culture you can learn about MacGyver here

    Mark


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


  • 10.  RE: Using the killsession service in webmethod

    Posted Wed July 07, 2004 07:54 PM

    Hi Ray,

    I am having a problem with your description of killSession. I am unable to branch on %sessions/expires%<1 because the value is returned as an object (java.lang.long).

    It always evaluates this value as null.

    Please help.

    • Piara

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


  • 11.  RE: Using the killsession service in webmethod

    Posted Wed July 07, 2004 10:47 PM

    there is a service in the WmTransformationServices package (available on advantage in Utilities and Samples) called LongToString


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


  • 12.  RE: Using the killsession service in webmethod

    Posted Thu July 08, 2004 12:23 AM

    Thanks Roger. That worked!! Cool package.

    Thank you.

    • Piara

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


  • 13.  RE: Using the killsession service in webmethod

    Posted Tue July 27, 2004 08:33 PM

    Roger:
    Can you let me know where i can find WmTransformationServices?.
    Thanks
    Harsh


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


  • 14.  RE: Using the killsession service in webmethod

    Posted Tue July 27, 2004 08:51 PM

    go to webMethods advantage site, go to Best Practices, then Utilities and Samples, then WmTransformation Services Package

    or click here: WmTransformation Services Package


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


  • 15.  RE: Using the killsession service in webmethod

    Posted Wed July 28, 2004 07:05 PM

    How can I map the object to the input of LongToString service. I can’t able to see input and output from wm.server.query:getSessionList service but only in the results.


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


  • 16.  RE: Using the killsession service in webmethod

    Posted Wed July 28, 2004 08:55 PM

    Close to the top of this thread is the recommendation that WmRoot services be wrapped in your own service. You just ran into another reason to do this.

    1. Since WmRoot services can change you want to isolate your exposure.
    2. You can follow your own input and output signature naming conventions and map them within your wrapper service.

    The way I create a wrapper for a service that doesn’t have a signature (or correct signature) defined, is to:

    1. create the wrapper service.
    2. put in the single invoke to the WmRoot service.
    3. run the wrapper service.
    4. copy the output pipeline from the Developer Results window into the output signature window of the wrapper service. This paste will put in the ‘schema’ definition of the pipeline data, not the actual data values.

    HTH,
    Fred


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