users@jax-ws.java.net

Re: cookie tracking across multiple services?

From: Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
Date: Mon, 23 Oct 2006 16:48:37 -0700

Since JAX-WS uses standard HttpURLConnection, you can try using
CookieHandler.

http://java.sun.com/j2se/1.5.0/docs/guide/net/http-cookie.html

If you try it, let us know how it goes with this approach.

Jitu

Levi Purvis wrote:

> Thanks for the information! That was easy enough. Does anyone know
> if there are any plans on making this portable? Right now it appears
> to require Sun RI specific classes.
>
> On 10/23/06, *Dima Gutzeit* <dima_at_mailvision.com
> <mailto:dima_at_mailvision.com>> wrote:
>
> Hi,
>
> Every service biniding is a different http connection hence a
> different cookie. You can login to each service separately or you
> can copy one cookie between different services.
>
> You should extract the CookieJar object from one service and add
> it to another. If you need I will post code snippets tomorrow morning.
>
> Regards,
> Dima Gutzeit.
>
> ----- Original Message -----
> *From:* Levi Purvis <mailto:javanet_at_purvis.ws>
> *To:* users_at_jax-ws.dev.java.net
> <mailto:users_at_jax-ws.dev.java.net>
> *Sent:* Monday, October 23, 2006 9:07 PM
> *Subject:* cookie tracking across multiple services?
>
> I'm using the javax.xml.ws.Service API to generate dynamic
> clients based on shared Java interfaces and WSDL. Is there a
> way to track cookies across multiple service instances
> returned from the getPort() method? I tried setting
> javax.xml.ws.BindingProvider.SESSION_MAINTAIN_PROPERTY on the
> service instance (by casting to javax.xml.ws.BindingProvider),
> but that only tracks cookies separately on a per-service
> basis. I would like all services from any given client
> process to share the same cookies.
>
> The root of the problem is that I'm trying to secure multiple
> web services by requiring a "login" and then using state in
> the HttpSession to authenticate & authorize subsequent
> requests. Is there a recommended way to do this with the RI
> rather than the typical HttpSession cookie tracking used in
> web apps?
>
>