cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: Stuck: What interceptor unmarshals qnames back into java objects?
Date Mon, 28 Sep 2009 17:26:30 GMT

It would be one of the subclasses of AbstractInDatabindingInterceptor.   
USUALLY that would be DocLiteralInInterceptor, but it could also be the 
RPCInInterceptor or others.

In anycase, to get the List of params, you would normally do:
MessageContentsList lst = MessageContentsList.getContentsList(message);
(which really just does msg.getContent(List.class) and double checks the class 
and such)

However, what's in there could also depend on where in the chain your 
interceptor lives and whether you use jaxws or not.      If you put it 
immediately after the DocLiteralInInterceptor  (unmarshal phase), it would 
probably have a single object in it being the wrapper object.   If you move 
your interceptor to POST_LOGICAL and after the WrapperClassInInterceptor, the 
list would have the individual parts.


On Mon September 28 2009 12:08:18 pm cj91 wrote:
> I'm attempting to write my first interceptor, but having trouble getting of
> the ground. It's basically a custom logger that takes attributes from the
> request/response and writes them to a database our DBA's have created for
> me.
> I chose the interceptor route because it is easily enabled/disabled in the
> Spring config, and we want to use it across many of our webservices without
> changing the webservice code.
> These are SOAP services over Http.
> First, my interceptor class declaration:
> public class SimpleUsageTrackingCXFInterceptor implements
> PhaseInterceptor<Message>
> public void handleMessage(Message soapMessage) throws Fault {
> ....
> }
> soapMessage has a ton of methods. I need to get a handle to the Java
>  objects the XML represents. if I call Message.getValues() I get a bunch of
>  QName objects. Is there a better method to use to get the unmarshalled
>  objects?
> I've read through the mailing list that where I insert my interceptor in
>  the chain has a lot to do with this... I've tried setting breakpoints in
>  PhaseInterceptorChain but It's really not clicking. Is there a particular
>  interceptor I should insert my interceptor after?
> I'm not asking for someone to write my code, just a stern shove in the
> correct direction. Thanks for any help guys!

Daniel Kulp

View raw message