> -----Original Message----- > From: Sven Zethelius [mailto:[email protected]] > Sent: Friday, November 12, 2010 10:10 AM > To: [email protected] > Subject: RE: How to have an interceptor execute on an exception in an > earlier interceptor? > > If you put an interceptor earlier in the same chain (e.g. Phase.SETUP > in the OUT chain), and override its handleFault with the logic you > want, it will get called during the unwinding of the phase interceptor > chain.
Ok, that will handle the Soap fault case, but what if the initial connection failed with an IOException, perhaps because of a timeout? Will it get to the "handleFault()" method? > -----Original Message----- > From: KARR, DAVID (ATTSI) [mailto:[email protected]] > Sent: Thursday, November 11, 2010 7:24 PM > To: [email protected] > Subject: How to have an interceptor execute on an exception in an > earlier interceptor? > > I'm working on replacing a custom soap client. One thing the old code > did was wrap the eventual sending of the message in a "try/finally" > block so that it could do work in the try block that was guaranteed to > match with code in the finally block. The two matching blocks are very > simple, just making a single function call. With CXF, the closest > analogue is a matching "Out" and "In" interceptor. However, I'm > finding > that if certain bad things happen, like a connection timeout, it > appears > that the "In" interceptor in the "RECEIVE" phase is never executed. Is > there some way I can do something analogous to the old code?
