cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jim ma <mail2ji...@gmail.com>
Subject Re: PolicyVerificationInterceptor
Date Wed, 07 Jul 2010 02:05:16 GMT
On Wed, Jul 7, 2010 at 8:48 AM, Daniel Kulp <dkulp@apache.org> wrote:
> Jim,
>
> My gut feeling is that this validation and exception belong in the
> MAPAggregator, not the PolicyInInterceptor.

The validation part is  in PolicyVerificationInterceptor not
PolicyInInterceptor.
The MAPAgggregator  tracks the adderssing policy error in AssertionInfoMap and
PolicyVerificationInterceptor will finally compute and check the
policy configuration to decide if these errors
are needed to be cast to PolicyException and throw.

> If Addressing is required, the
> addressing layer should throw the appropriate addressing fault.

As you can see from the interceptor chain list ,  the current chain
will NOT reach MAPAggregator which can validate the incoming
addressing properties when there is error in SOAPHandlerInterceptor. I
tried to validate the incoming message in MAPCodec,
there is no BindingOperationInfo set in exchange which stops me to get
the normalized policy.

>
> Dan
>
>
> On Jul 5, 2010, at 4:02 AM, jim ma <mail2jimma@gmail.com> wrote:
>
>> Hi all ,
>>
>> When I ran a service with ws addressing policy enabled and an handler
>> which always throw exception configured in
>> server side . When I sent a soap request WITHOUT wsa header ,
>> I saw the SOAPHandlerInterceptor in server side eat the WS addressing
>> violation exception and just throw the exception
>> in handler chain thrown .
>>
>> Below is the intercetor chain sequence in server side and my analysis
>> comments :
>>
>> -----------org.apache.cxf.ws.policy.PolicyInInterceptor@184b5c4
>>
>>                         #Add the wsa policy interceptorProvider and
>> PolicyVerificationIntercetor
>>
>> -----------org.apache.cxf.interceptor.AttachmentInInterceptor@8f299
>> -----------org.apache.cxf.transport.https.CertConstraintsInterceptor@88e798
>> -----------org.apache.cxf.interceptor.StaxInInterceptor@4757b
>> -----------
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor@fe0e2e
>> -----------
> org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor@568915
>> -----------
> org.apache.cxf.binding.soap.interceptor.StartBodyInterceptor@141dc8b
>> -----------
> org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor@f638ae
>> -----------org.apache.cxf.ws.addressing.soap.MAPCodec@178fce9
>>
>>                          #Here compose the WSA maps and already
>> know there is no wsa header in inbound soap message
>>
>> -----------org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor@187ab2d
>>
>>                          # Here will call the Handler and throw
>> exception , the execute path  will  be directed to fault chain,
>>                              hence the WS addressing policy error
>> will not be reported.
>>
>> -----------
> org.apache.cxf.jaxws.handler.logical.LogicalHandlerInInterceptor@ca2f5c
>> -----------
> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor@1eb416b
>> -----------
> org.apache.cxf.jaxb.attachment.JAXBAttachmentSchemaValidationHack@1405eb
>> -----------org.apache.cxf.interceptor.URIMappingInterceptor@90baa1
>> -----------org.apache.cxf.interceptor.DocLiteralInInterceptor@1ccd087
>> -----------
> org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor@1611006
>> -----------org.apache.cxf.ws.addressing.MAPAggregator@1b97041
>> -----------org.apache.cxf.interceptor.OneWayProcessorInterceptor@162fdb2
>> -----------
> org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor@1fded53
>> -----------org.apache.cxf.jaxws.interceptors.SwAInInterceptor@133c109
>> -----------org.apache.cxf.jaxws.interceptors.HolderInInterceptor@c63783
>> -----------org.apache.cxf.ws.policy.PolicyVerificationInInterceptor@166979a
>>
>>                       #This will not be executed because
>> SOAPHandlerInterceptor throws exception
>>
>> -----------org.apache.cxf.interceptor.ServiceInvokerInterceptor@172ff2b
>>
>> The above interceptor list is the normal execution path without
>> exception thrown in SOAPHandlerInterceptor.  As you can see ,
>> CXF actually can detect the ws addressing policy violation in MAPCodec
>> and throws the policy error immediately and not  pass in
>> the SOAPHandlerInterceptor.
>> So far our  policy check uses AssertionInfoMap to log the policy error
>> and checks the policy error in   "one point"
>> PolicyVerification*Interceptor,
>> The actual policy errors  will not be displayed or reported when the
>> other intercetors throws exceptoin before the check point
>> So how can we enable our current policy framework to check error in
>> the interceptor and report it immediately when there is policy error ?
>>
>> Cheers,
>> Jim
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>

Mime
View raw message