users@jax-rpc.java.net

Re: Explicit Context

From: Simon Horrell <simonh_at_develop.com>
Date: Thu, 21 Feb 2002 19:34:32 +0000

The JAX-RPC specification says that SOAP header blocks are mapped to extra
method params in the Java service definition interface.
The spec is unclear about how/whether they will be mapped in the case of
document/literal style but one assumes it should be the same.

Are you using the JAX-RPC reference implementation? If so, it only
implements a subset of JAX-RPC 0.5 functionality.
You are not going to get too much joy with using SOAP header blocks.

First, assuming rpc/encoded style.
As far as I can tell, when you start the development process with a WSDL
description, xrpcc will generate a service description interface that
correctly maps SOAP header blocks as extra method params.
However, when you use the generated stub and inspect the SOAP message it
transmits, all parameters are passed in the SOAP Body.
I assume this is an oversight.
If you start with the Java service description interface and generate the
WSDL from that, there is no way to annotate parameters in the service
description interface as pertaining to SOAP header blocks.

[Open question - how would this *ever* work.
When starting from the Java service description interface shouldn't there be
some standard way of specifying which paramaters corresponded to headers??
Unless I have misread the JAX-RPC 0.7 spec, the example in section 11.2.2
shows an example that seems to imply that a parameter of type StringHolder
in the Java service definition interface, somehow maps to an [in/out] SOAP
header block.
How would one distinguish this from an [in/out] SOAP body block?]

Predictably, xrpcc tells us "Error: Invalid type for JAX-RPC structure:
javax.xml.rpc.holders.StringHolder".

Second, assuming document/literal style.
As far as I can tell, when you start the development process with a WSDL
description, xrpcc will ignore all SOAP header blocks.
I assume this is an oversight.

JAX-RPC 0.6 onwards defines a header processing architecture that is quite
flexible and comprehensive.
To repeat, the reference implementation is only compliant with a subset of
0.5.

Simon.

----- Original Message -----
From: "Lars Oppermann" <lars.oppermann_at_SUN.COM>
To: <JAXRPC-INTEREST_at_JAVA.SUN.COM>
Sent: Thursday, February 21, 2002 5:10 PM
Subject: Explicit Context


> Hi everyone,
>
> I am currently getting into JAX-RPC for moving our WebService from
> Apache SOAP to JWSDP. Foe our services, we need to handle some
> state/context information, which we are currently doing by transmitting
> soap-headers that include a token to identify the session which the
> service endpoints can use from some infrastructure layer in the
> underlying application.
>
> The specification has an example about explicit context usage that uses
> an additional argument of type javax.xml.rpc.holders.StringHolder and
> states that this would be passed as a soap-header by the generated stub
> code - at least, that is what I understand by reading section 11.2.2 of
> the 0.6 specification.
>
> I tried to build an example that is modelled after that example by
> exposing a method that takes one String and one StringHolder parameter.
> I defined the interface, build a dummy-implementation and then used
> xrpcc to generate wsdl, stubs and ties. Unfortunatly xrpcc cannot handle
> StringHolder - what am I missing?
>
> Thanks in advance,
> Lars
>
> --
> Lars Oppermann <lars.oppermann_at_sun.com> Sun Microsystems
> Software Engineer - Sun ONE Webtop Sachsenfeld 4
> Phone: +49 40 23646 959 D-20097 Hamburg
> Fax: +49 40 23646 550 http://www.sun.com/webtop