Group: comp.lang.java.programmer
From: =?ISO-8859-1?Q?Arne_Vajh=F8j?=
Date: Sunday, February 24, 2008 8:15 PM
Subject: Re: JAX-WS - Turning on outgoing SOAP headers for client

Richard Maher wrote:
> Sorry if this question is a dog's-breakfast with incorrect terminology (all
> the test stuff is back in another office and I'm too lazy to re-look it all
> up :-) but the fundemental question is a very basic one. We're using JAX-WS
> to generate client code from a Application Service provider's WSDL that is
> intended to provide stateful sessions between client and server. We have
> turned on http message dumping to the console and can see that incoming
> replies contain a SOAP header (with a Session Id) but the outgoing calls
> only have a SOAP body. So, how do we (or the WSDL authors) tell Java to turn
> on SOAP headers so that we can reply with the SessionId we got back from the
> Authenticate?
>
> 1) I've turned on the
> (portormaybeservice)somethingBinding.SESSIONSOMETHINGPERSISTENT=true (but
> without a header we can't really tell the server what session id they gave
> us last time?)
> 2) I've seen the code examples about injecting seemingly arbitrary header
> tags, but I'm guessing if we can just make the header appear at all then the
> Session Id will automagically appear?
> 3) I've seen at the GlassFish site that @webParams has a (mode=out,
> head=true) option, but it didn't like "out" and the head(er)=true didn't
> seem to do anything (and this should be controlled by the WSDL right? Or the
> Import?)
>
> The SessionId and Stateful Sessions stuff is supposed to be transparent is
> it not?
>
> Anyway, just thought I'd run it up the flag-pole in case it's obvious to
> everyone except me.

Is the session supposed to be maintained at the HTTP level (via cookies)
or at the SOAP level (with an element within the SOAP envelope) ?

The first should be relative easy. See something like:

http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html

The second could be more difficult. And I would find it tempting to
use a heavier web service toolkit like Axis to do it.

Arne

News in English | Binaries Groups | 20lbs in 30 days