Right , Dan. No need to add this interceptor in the client side. Thanks for the review and committed the optimized code in revision 1049415.
On Wed, Dec 15, 2010 at 8:18 AM, Daniel Kulp <[email protected]> wrote: > > Jim, > > > On Tuesday 14 December 2010 7:07:47 pm [email protected] wrote: >> MustUnderstandEndingInterceptor(); + >> public MustUnderstandInterceptor() { >> super(Phase.PRE_PROTOCOL); >> } >> @@ -80,12 +83,18 @@ public class MustUnderstandInterceptor e >> checkUnderstand(mustUnderstandHeaders, mustUnderstandQNames, >> notUnderstandHeaders); >> >> if (!notUnderstandHeaders.isEmpty()) { >> - throw new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, >> notUnderstandHeaders), - >> soapVersion.getMustUnderstand()); >> + SoapFault soapFault = new SoapFault(new >> Message("MUST_UNDERSTAND", BUNDLE, notUnderstandHeaders), + >> soapVersion.getMustUnderstand()); + >> if (!isRequestor(soapMessage)) { >> + soapMessage.put(MustUnderstandInterceptor.FAULT, >> soapFault); + } else { >> + throw soapFault; >> + } >> } >> if (!ultimateReceiverHeaders.isEmpty() && >> !isRequestor(soapMessage)) { >> checkUltimateReceiverHeaders(ultimateReceiverHeaders, >> mustUnderstandQNames, soapMessage); } >> + soapMessage.getInterceptorChain().add(ending); >> } > > > Can this be optimized a bit? Basically, could the call to: > > soapMessage.getInterceptorChain().add(ending); > > be placed into the > if (!isRequestor(soapMessage)) { > > block? Since the interceptor only does anything if that block is called, we > don't need to add it for every invokation. Right? > > -- > Daniel Kulp > [email protected] > http://dankulp.com/blog >
