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 Nayana Hegde <na...@gmail.com> on 2006/03/21 06:12:32 UTC

Stateful Web Service

Hi,

  Is it possible to implement a stateful web service using Axis? If yes
please do let me know the details.

Thanks and Regards,
Nayana

Re: Stateful Web Service

Posted by Nayana Hegde <na...@gmail.com>.
Hi,

  I actually got it. I had not added the servlet jar file into the project
in eclipse and therefore was not getting the getHttpSession Method. Anyways
thanks for the reply.


Thanks and Regards,
Nayana


On 3/21/06, Dies Koper <di...@jp.fujitsu.com> wrote:
>
> Use its getHTTPSession() method.
> You might want to learn to use APIs' javadocs. Just google for
> ServletEndpointContext, the Javadoc is its first find.
>
>
> Nayana Hegde wrote:
> > Hi Prashanth,
> >
> >   Can you let me know as to how to retreive the HTTPSession from
> > ServletEndpointContext ?
> >
> > Thanks and Regards,
> > Nayana
> >
> >
> > On 3/21/06, prashanth shivakumar <pr...@gmail.com> wrote:
> >>
> >> This is how i have done it..
> >> Some of the people over in this forum suggested the same..
> >>
> >> Make your servlet webservice  endpoint interface implement
> >> javax.xml.rpc.server.ServiceLifecycle interface
> >> Than you need to define init() and destroy() methods.
> >> Using ServletEndpointContext you can retrieve HTTPSession and thats
> what
> >> you need to maintain state.
> >> Implement your backend logic in stateless EJBs
> >>
> >> given below is a small snippet from my servlet endpoint
> >>
> >> Cheers
> >>
> >> ========================
> >>
> >> javax.xml.rpc.server.ServletEndpointContext servletContext;
> >>
> >>  /**
> >>   *
> >>   */
> >>
> >>  public void init(Object context) {
> >>    servletContext = (javax.xml.rpc.server.ServletEndpointContext)
> context;
> >>
> >>  }
> >>
> >>  /**
> >>   *
> >>   */
> >>  public void destroy() {
> >>   servletContext = null;
> >>  }
> >>
> >> ====================================
> >>
> >>
> >> On 3/21/06, Jyotishman Pathak <jy...@gmail.com> wrote:
> >>> The WSRF specs provide a standard way of implementing/interacting with
> >>> stateful Web services. I recommend having a look at:
> >>> http://ws.apache.org/wsrf/
> >>>
> >>> - Jyoti
> >>>
> >>>
> >>>
> >>>
> >>> On 3/20/06, Nayana Hegde <nayana.hegde@gmail.com > wrote:
> >>>>  Hi,
> >>>>
> >>>>   Is it possible to implement a stateful web service using Axis? If
> >>>> yes please do let me know the details.
>
>
>

Re: Stateful Web Service

Posted by Dies Koper <di...@jp.fujitsu.com>.
Use its getHTTPSession() method.
You might want to learn to use APIs' javadocs. Just google for 
ServletEndpointContext, the Javadoc is its first find.


Nayana Hegde wrote:
> Hi Prashanth,
> 
>   Can you let me know as to how to retreive the HTTPSession from
> ServletEndpointContext ?
> 
> Thanks and Regards,
> Nayana
> 
> 
> On 3/21/06, prashanth shivakumar <pr...@gmail.com> wrote:
>>
>> This is how i have done it..
>> Some of the people over in this forum suggested the same..
>>
>> Make your servlet webservice  endpoint interface implement
>> javax.xml.rpc.server.ServiceLifecycle interface
>> Than you need to define init() and destroy() methods.
>> Using ServletEndpointContext you can retrieve HTTPSession and thats what
>> you need to maintain state.
>> Implement your backend logic in stateless EJBs
>>
>> given below is a small snippet from my servlet endpoint
>>
>> Cheers
>>
>> ========================
>>
>> javax.xml.rpc.server.ServletEndpointContext servletContext;
>>
>>  /**
>>   *
>>   */
>>
>>  public void init(Object context) {
>>    servletContext = (javax.xml.rpc.server.ServletEndpointContext) context;
>>
>>  }
>>
>>  /**
>>   *
>>   */
>>  public void destroy() {
>>   servletContext = null;
>>  }
>>
>> ====================================
>>
>>
>> On 3/21/06, Jyotishman Pathak <jy...@gmail.com> wrote:
>>> The WSRF specs provide a standard way of implementing/interacting with
>>> stateful Web services. I recommend having a look at:
>>> http://ws.apache.org/wsrf/
>>>
>>> - Jyoti
>>>
>>>
>>>
>>>
>>> On 3/20/06, Nayana Hegde <nayana.hegde@gmail.com > wrote:
>>>>  Hi,
>>>>
>>>>   Is it possible to implement a stateful web service using Axis? If
>>>> yes please do let me know the details.



Re: Stateful Web Service

Posted by Nayana Hegde <na...@gmail.com>.
Hi Prashanth,

  Can you let me know as to how to retreive the HTTPSession from
ServletEndpointContext ?

Thanks and Regards,
Nayana


On 3/21/06, prashanth shivakumar <pr...@gmail.com> wrote:
>
>
> This is how i have done it..
> Some of the people over in this forum suggested the same..
>
> Make your servlet webservice  endpoint interface implement
> javax.xml.rpc.server.ServiceLifecycle interface
> Than you need to define init() and destroy() methods.
> Using ServletEndpointContext you can retrieve HTTPSession and thats what
> you need to maintain state.
> Implement your backend logic in stateless EJBs
>
> given below is a small snippet from my servlet endpoint
>
> Cheers
>
> ========================
>
> javax.xml.rpc.server.ServletEndpointContext servletContext;
>
>  /**
>   *
>   */
>
>  public void init(Object context) {
>    servletContext = (javax.xml.rpc.server.ServletEndpointContext) context;
>
>  }
>
>  /**
>   *
>   */
>  public void destroy() {
>   servletContext = null;
>  }
>
> ====================================
>
>
> On 3/21/06, Jyotishman Pathak <jy...@gmail.com> wrote:
> >
> > The WSRF specs provide a standard way of implementing/interacting with
> > stateful Web services. I recommend having a look at:
> > http://ws.apache.org/wsrf/
> >
> > - Jyoti
> >
> >
> >
> >
> > On 3/20/06, Nayana Hegde <nayana.hegde@gmail.com > wrote:
> > >
> > >  Hi,
> > >
> > >   Is it possible to implement a stateful web service using Axis? If
> > > yes please do let me know the details.
> > >
> > > Thanks and Regards,
> > >  Nayana
> > >
> >
> >
> >
> > --
> > Jyotishman Pathak
> > WWW: http://www.cs.iastate.edu/~jpathak
> >
>
>

Re: Stateful Web Service

Posted by prashanth shivakumar <pr...@gmail.com>.
This is how i have done it..
Some of the people over in this forum suggested the same..

Make your servlet webservice  endpoint interface implement
javax.xml.rpc.server.ServiceLifecycle interface
Than you need to define init() and destroy() methods.
Using ServletEndpointContext you can retrieve HTTPSession and thats what you
need to maintain state.
Implement your backend logic in stateless EJBs

given below is a small snippet from my servlet endpoint

Cheers

========================

javax.xml.rpc.server.ServletEndpointContext servletContext;

 /**
  *
  */

 public void init(Object context) {
   servletContext = (javax.xml.rpc.server.ServletEndpointContext) context;

 }

 /**
  *
  */
 public void destroy() {
  servletContext = null;
 }

====================================


On 3/21/06, Jyotishman Pathak <jy...@gmail.com> wrote:
>
> The WSRF specs provide a standard way of implementing/interacting with
> stateful Web services. I recommend having a look at:
> http://ws.apache.org/wsrf/
>
> - Jyoti
>
>
>
>
> On 3/20/06, Nayana Hegde <na...@gmail.com> wrote:
> >
> >  Hi,
> >
> >   Is it possible to implement a stateful web service using Axis? If yes
> > please do let me know the details.
> >
> > Thanks and Regards,
> >  Nayana
> >
>
>
>
> --
> Jyotishman Pathak
> WWW: http://www.cs.iastate.edu/~jpathak
>

Re: Stateful Web Service

Posted by Jyotishman Pathak <jy...@gmail.com>.
The WSRF specs provide a standard way of implementing/interacting with
stateful Web services. I recommend having a look at:
http://ws.apache.org/wsrf/

- Jyoti



On 3/20/06, Nayana Hegde <na...@gmail.com> wrote:
>
> Hi,
>
>   Is it possible to implement a stateful web service using Axis? If yes
> please do let me know the details.
>
> Thanks and Regards,
> Nayana
>



--
Jyotishman Pathak
WWW: http://www.cs.iastate.edu/~jpathak