Explicit close of HTTP session

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?


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.

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.

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.


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.

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.


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() );


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

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.

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…


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!