On Friday, January 06, 2012 8:16:49 AM XiLai Dai wrote:
> Hello,
> 
> We have a interceptor which is used to get operation name and something
> else. It works for most of use cases but not works with the security fault
> case. After some debugging, the order of the interceptors like this:
> 
> org.apache.cxf.ws.policy.PolicyInInterceptor@4db9dc 
> (message.getExchange().getBindingOperationInfo() = null)
> ourInterceptor@1d00259  (message.getExchange().getBindingOperationInfo() =
> null) ............
> org.apache.cxf.ws.security.wss4j.UsernameTokenInterceptor@1b8935b
> (message.getExchange().getBindingOperationInfo() = null)   //Exception if
> password is wrong and stop iterate over interceptor chain. ............
> org.apache.cxf.interceptor.URIMappingInterceptor@14d583a
> (message.getExchange().getBindingOperationInfo() ok)
> 
> who can give some proposal on how to get the operation name in the security
> fault case? Thanks!

In general, you cannot.    If you have unique SOAP Actions for the operations, 
the SOAPActionInInterceptor may have found one for you, but without that, you 
won't be able to get the operation at this point in the processing.

The basic reason is that the soap body may be encrypted.   Or maybe a JAX-WS 
handler needs to manipulate it.   Of an interceptor may want to transform it 
for backwords compatibility.   Or it may not even be XML (maybe fastinfoset or 
json or something).      Basically, until the chain proceeds into the various 
DatabindingInInterceptor's where it will then look at the elements in the body 
and find the operation, it's likely not going to have the operation name.



-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to