dev@jax-ws.java.net

Obtaining JAXB beans from Header

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 09 Feb 2006 11:18:05 +0100

Hi,

When the JAXBHeader implementation implements the following methods to
get access to the JAXB object:

     public <T> T readAsJAXB(Unmarshaller unmarshaller) throws
JAXBException {
         JAXBResult r = new JAXBResult(unmarshaller);
         bridge.marshal(context,jaxbObject,r);
         return (T)r.getResult();
     }

     public <T> T readAsJAXB(Bridge<T> bridge, BridgeContext context)
throws JAXBException {
         return bridge.unmarshal(context,new
JAXBBridgeSource(this.bridge,this.context,jaxbObject));
     }

why is the JAXB object that was passed into the constructor not returned
directly? e.g. for the case where pipe adds a header using a JAXB object
and a pipe further down the line wants to access this header using JAXB.

In general if a pipe wants access to a header as a JAXB bean is it more
efficient to use BridgeContext or Unmarshaller?

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109