Ryan,

Are you using 2.0.1 or the latest trunk code?   (there are some fixes in 
this area in 2.0.2 and trunk, specifically fixing some lost header 
things, but I think that was on the In interceptor, not out.)

Basically, according to JAX-WS spec, if there is a @RequestWrapper 
annotation that points to the appropriate class, we are supposed to take 
the parameters, fill them into the wrapper class, and use the wrapper 
class to pass to JAXB.   That's what the WrapperClassXXXInterceptor 
things do.   The main reason is the wrapper class can provide additional 
metadata to JAXB.   For example, the mime types for DataHandlers or 
@XmlSeeAlso things and such.

In anycase, it looks like the code you are looking at is "older".   The 
current code on trunk doesn't have the clear().   It basically creates a 
new list and then copies the headers from the unwrapped index in the old 
list to the wrapped index in the new list.   I would suggest trying the 
trunk code.  (or maybe the 2.0.2 builds we're trying to get through a 
vote:
http://people.apache.org/~dkulp/stage_cxf/2.0.2-incubator-take1/
)


Dan


On Tuesday 11 September 2007, Ryan Moquin wrote:
> I've been debugging my "disappearing header" problem.  I've narrowed
> it down to the WrapperClassOutInterceptor class.  On line 66, it grabs
> a reference to the parameters that I passed into my method I'm calling
> for my web service.  It then takes these parameters and apparently
> tries to see if there is a WrapperHelper for them.  Or well, by the
> fact that it only checks for parts.get(0), means that it's checking my
> first parameter but not checking my second parameter (my header).
>
> Now, there is no WrapperHelper apparently for my first parameter
> object, so it creates one and wraps it.  At this point the Interceptor
> seems happy with the job that it did and calls the following code:
>
> Object o2 = helper.createWrapperObject(objs);
>                 objs.clear();
>                 objs.put(parts.get(0), o2);
>
> When it does this, it clears the MessageContentsList containing my
> parameter and my header.  It puts my first parameter back in and
> leaves the old slot held by my header as null.  This is why my header
> is disappearing.  Why does this class only reference parts(0) when
> there is more than 1 part?
>
> This Interceptor seems to assume that there is only 1 parameter.  The
> reason why my stripped down WSDL doesn't hit this apparent bug is
> because when I generate the java classes for that wsdl, my first
> parameter is generated as a wrapper object around a string and
> therefore doesn't need to create a wrapper class and doesn't delete
> the elements from the MessageContentList. This appears to be a bug.  I
> think I can now change my test working WSDL to exploit this problem. 
> I'll then post it for you to look at.



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to