I'm working on a Web Services part of an application in which I've been asked to provide a pure Java Web Services client for a WO Web Services server. The client is not using any of the WO frameworks, just the standard Java and Axis libraries. In this context, my problem is maintaining the WOSession between Web Services calls.
Although I've studied WO's Web Services Security example, it uses both a WO server and a WO based client. That example seems to have no trouble maintaining the Web Services session. In fact, the whole point of the example is to capture some information (UserID & password) on the first request, store it in the session and return that information from that same session in the response to the second request to demonstrate session availability and continuity.
The WO server app keeps session IDs in cookies. I've been able to repeat the session functionality, but to do so, I have to get the client to capture the SessionID from the response to the first request and pass it back explicitly as a parameter on each subsequent request to the server.
The documentation suggests getting the session from the Web Services MessageContext. I've logged the requests and responses to the server application and see that the Response's MessageContext has a WOContext as a property. However, the WOContext that's returned in the Response's MessageContext has the following attributes:
com.webobjects.appserver.WOContext contextID=null requestSenderID=null elementID=null sessionID=null request=<a bunch of stuff> ...
There are two MessageContext methods that seem to apply here: public void setMaintainSession(boolean yesNo) and public boolean getMaintainSession(). I can use the latter to confirm that the session is not being maintained, but using the former at the beginning of each of my published Web Services methods seems to have no effect.
Has anyone worked with the straight Java Axis (Web Services) client libraries in a WO server context sufficiently to know what I have to do in the Java client to maintain the WOSession information between the server's response and the client's next request.
Thanks in advance for any help you can offer.
Regards, Jerry
-- __ Jerry W. Walker, WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems
jerrywwalker@gee-em-aye-eye-ell.com 203 278-4085 office
|