Search code examples
web-servicesjax-ws

Getting and setting Cookies and Session in Webservice


I had googled for this but havent got any conclusive answers

Is it possible to retrieve and set a cookie in the reponse for JAX-WS webservice ?

How can we maintain sessions in web service ?

Regards


Solution

  • Getting and setting Cookies and Session in Webservice is Supported in JAX-WS. Follow the below link which will help you to enable this on server and Client side.

    Programming Stateful JAX-WS Web Services Using HTTP Session

    You may also have look at this answer JAX-WS client: maintain session/cookies across multiple services