axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cyrille Le Clerc <cyrille.lecl...@pobox.com>
Subject Re: Extracting cookies from MessageContext
Date Tue, 14 Feb 2006 16:37:24 GMT
   Hi Prashanth ,

   It is strange to use stateless ejb for a stateful web service?

   Can you go stateful ? Do you really need ejbs ? Otherwise, simple
stupid java beans will gracefully do the job. Syntax will look like a
simple "MessageContext.getProperty()" or something like this that will
rely on the HttpSession ; I couldn't find Websphere SOAP library
documentation to check.

   Cyrille

--
Cyrille Le Clerc
cyrille.leclerc@pobox.com
cyrille.leclerc@fr.ibm.com

On 2/14/06, prashanth shivakumar <prashanth.shivakumar@gmail.com> wrote:
>
> Hi Cyrille,
> Thanks for your response.
> SInce iam using ejb endpoint[stateless session EJB] for webservice implementation using
ibm websphere,how can i get hold of MessageContext on the server end inside stateless session
bean??
>
> Many Thanks
>
>
>
>
> On 2/13/06, Cyrille Le Clerc <cyrille.leclerc@pobox.com> wrote:
> >   Hello Prashanth,
> >
> >   After your invocation, you have to play with
> > "binding._getCall().getMessageContext()" and then get properties
> > "HTTPConstants.HEADER_COOKIE" and "HTTPConstants.HEADER_COOKIE2".
> >
> >   Here is a sample :
> > TestSessionBindingStub binding = (TestSessionBindingStub) new
> > testSessionServiceLocator().gettestSessionBinding();
> > binding.setMaintainSession(true);
> >
> > // invoke remote operation
> > String result = binding.aMethod();
> >
> > MessageContext messageContext = binding._getCall().getMessageContext();
> > String cookie1 = (String)
> >  messageContext.getProperty(HTTPConstants.HEADER_COOKIE);
> > String cookie2 = (String)
> > messageContext.getProperty(HTTPConstants.HEADER_COOKIE2);
> > System.out.println("cookie1=" + cookie1);
> > System.out.println ("cookie2=" + cookie2);
> >
> >   Hope this helps,
> >
> >   Cyrille
> >
> > --
> > Cyrille Le Clerc
> > cyrille.leclerc@pobox.com
> >  cyrille.leclerc@fr.ibm.com
> >
> > On 2/7/06, prashanth shivakumar <prashanth.shivakumar@gmail.com> wrote:
> > >
> > > Hello All,
> > > Is there any way wherein i can extract cookies from MessageContext inside custom
MessageHandler.
> > > I tried using msgContext.getProperty("Cookie"); but it returns NULL
> > > Yes..I did set up sessions on both client/server and can see cookie passing
between client/server and viceversa
> > >
> > > Many Thanks

Mime
View raw message