You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Franck LEFEBURE <fr...@orange-ftgroup.com> on 2007/08/14 18:04:47 UTC

RE: Http session / several services [SOLVED]

JsessionId Cookie injection for the second call:

 

service1.firstMethod(foo, bar);

Call firstCall = service1._getCall();

org.apache.axis.MessageContext msgContext = firstCall.getMessageContext();

String cookie = msgContext.getStrProp(HTTPConstants.HEADER_COOKIE);

service2._setProperty(HTTPConstants.HEADER_COOKIE, cookie);

service2.firstMethod(foo, bar);

 

BR

--
Franck 

________________________________

De : Franck LEFEBURE [mailto:franck.lefebure@orange-ftgroup.com] 
Envoyé : mardi 14 août 2007 11:40
À : axis-user@ws.apache.org
Objet : Http session / several services

 

Hello,

 

 

I have 2 wsdl2java generated stubs :

 

      String endpoint1 = "http://server:7779/commonapi/services/EndPoint1";

      String endpoint2 = "http://server:7779/commonapi/services/EndPoint2";

      FirstEndPointSoapBindingStub service1 = new FirstEndPointSoapBindingStub (new URL(endpoint1), new Service());

      service1.setMaintainSession(true);

      SecondEndPointSoapBindingStub service2 = new SecondEndPointSoapBindingStub (new URL(endpoint2), new Service());

      service2.setMaintainSession(true);

 

What I want is to maintain HTTP session during calling of the 2 services.

 

       service1.firstMethod(foo, bar);

       service2.firstMethod(foo, bar);

       service1.secondMethod(foo, bar);

 

With TcpMon, I can see the SessionId is transmitted during all the calls to service1, but not for the service2 call.

 

I've read the archive, the problem is common, but I can't find any solution.

 

 

Additionally, I would prefer to not modify the wsdl2java class generated.

 

May be it's possible to modify the client-config.wsdd file to define a custom handler, Do someone has solved this problem?

 

Thanks,

 

BR,

 

 

--
Franck