Thanks! I think this will get me where I need to go!
-----Original Message----- From: Daniel Kulp [mailto:[email protected]] Sent: Monday, September 28, 2009 12:27 PM To: [email protected] Cc: Fisher, Jonathan Subject: Re: Stuck: What interceptor unmarshals qnames back into java objects? 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. Dan 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 [email protected] http://www.dankulp.com/blog PRIVILEGED AND CONFIDENTIAL This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above. If the reader of the email is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any use, dissemination or copying of this email transmission is strictly prohibited by the sender. If you have received this transmission in error, please delete the email and immediately notify the sender via the email return address or mailto:[email protected]. Thank you.
