• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Maintenanace in Web Services

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have to write a web service with 3 methods. The requirement is data receieved in first method is required/processed in second method.

How can I store the data in first method so that it is avaialable in the call for second method from the same client.

How can I maintain in session in web service.

Please help.
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Although it doesn't like correct forum for this question.

You can save sessionIdentifier in Message header for subsequent calls or you can use of appropriate WS specificiations like WS-Context.
 
Smita S. Mutha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Amit.

That would help me identify message from same sender. But,
where and how can I store the data in first function call that will be avaialable in second function call.

Is there anything equivalent to session.setAttribute();
 
Amit G Piplani
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well you can use SOAP message headers to store session id.
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have exposed web services as Servlet then you can append the session id to the web service URL and get handle to HttpSession from MessageContext.
 
Smita S. Mutha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Vinod.

But, can exposing servlet as service allow me to have multiple methods in service.

As per my understanding, we need to write service logic in service method of servlet to implement as Web Service.

Is there any other way I can write mulitple methods in servlet and expose them as web service operations.

Please suggest.
 
Vinod K Singh
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you can write as many methods as you want in your web service servlet. I would recommend you to have a look at this post http://blog.vinodsingh.com/2008/09/building-jax-ws-web-service.html to have a better understanding.
 
reply
    Bookmark Topic Watch Topic
  • New Topic