You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2010/12/15 01:18:55 UTC

Re: svn commit: r1049357 - in /cxf/branches/2.3.x-fixes: rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/

Jim,


On Tuesday 14 December 2010 7:07:47 pm ema@apache.org 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
dkulp@apache.org
http://dankulp.com/blog

Re: svn commit: r1049357 - in /cxf/branches/2.3.x-fixes: rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/

Posted by Jim Ma <ma...@gmail.com>.
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 <dk...@apache.org> wrote:
>
> Jim,
>
>
> On Tuesday 14 December 2010 7:07:47 pm ema@apache.org 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
> dkulp@apache.org
> http://dankulp.com/blog
>