You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by jim ma <ma...@gmail.com> on 2010/07/05 10:02:34 UTC

PolicyVerificationInterceptor

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