users@jax-ws.java.net

Re: Multiple web services and HTTP session

From: Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
Date: Fri, 25 Aug 2006 18:13:06 -0700

Dima Gutzeit wrote:

> Hi,
>
> I've got a question regarding HTTP sessions used across web services.
> If I use several webservices, while one used for login, and others for
> information retrieval.
>
> Will the same HTTP session object be available in all services, or
> each service creates its own object ?
>
> One thing more, how do I define binding for several services ?
>
> <bindings
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> wsdlLocation="http://localhost:8080/api/CommonsService?wsdl"
> xmlns="http://java.sun.com/xml/ns/jaxws">
> <bindings node="wsdl:definitions">
> <package name="com.company.ws.product.client"/>
> </bindings>
> </bindings>
>
> That binding uses one wsdlLocation, how can I use the same client with
> several endpoints (services) ?
>
> Does anyone has expierence working with several endpoints on the same
> project ?

Just create artifacts for each service separately by passing a separate
customization file.

Regarding HTTP session, the client is talking with multiple services.
JAXWS client uses JDK's HttpURLConnection. JDK 5 has good support for
cookie management.

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

Also JDK6 has CookieManager support. Using these, you should able to
establish the same HTTP session even if the client is invoking multiple
services.

Jitu

>
>
> Thanks in advance.
>
> Regards,
> Dima Gutzeit.