Hi, Chris,
I tried to use the example you gave out and it didn't work. I always got
NullPointerException
from line "Long oId = getSessionId(oCqServiceLocator);" because there is no session id
ever set.
Do you know what possible caused the problem?
Thanks!
Gloria
-----------------------------------------------------------------------------------------
Here is the example you gave out:
void CallServices() {
// create the service locator object
CqServiceLocator oServiceLocator = new CqServiceLocator();
// this will globally set all client calls to maintain session state
// NOTE: SimpleSessionHandler must be present in the flows on both the
// client and server
oServiceLocator.setMaintainSession(true);
// CALL Service to Initialize Session ID !!!
oServiceLocator.getCq().callMethod();
// Grab the service session id
Long oId = getSessionId(oCqServiceLocator);
TpServiceLocator oTpServiceLocator = new TpServiceLocator();
// Link the ticketPurchase session to the concertQuery session !!
setSessionId(oTpServiceLocator,oId);
// call Tp methods
}
static public void setSessionId(Service oService, Long oId) {
AxisEngine engine = oService.getEngine();
engine.setOption(SimpleSessionHandler.SESSION_ID,oId);
}
static public Long getSessionId(Service oService) {
AxisEngine engine = oService.getEngine();
return (Long)engine.getOption(SimpleSessionHandler.SESSION_ID);
}
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree