Java Code Examples for org.apache.cxf.binding.soap.SoapMessage#getInterceptorChain()
The following examples show how to use
org.apache.cxf.binding.soap.SoapMessage#getInterceptorChain() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MustUnderstandInterceptor.java From cxf with Apache License 2.0 | 6 votes |
private void initServiceSideInfo(Set<QName> mustUnderstandQNames, SoapMessage soapMessage, Set<URI> serviceRoles, Set<QName> paramHeaders) { if (paramHeaders != null) { mustUnderstandQNames.addAll(paramHeaders); } for (Interceptor<? extends org.apache.cxf.message.Message> interceptorInstance : soapMessage.getInterceptorChain()) { if (interceptorInstance instanceof SoapInterceptor) { SoapInterceptor si = (SoapInterceptor) interceptorInstance; Set<URI> roles = si.getRoles(); if (roles != null) { serviceRoles.addAll(roles); } Set<QName> understoodHeaders = si.getUnderstoodHeaders(); if (understoodHeaders != null) { mustUnderstandQNames.addAll(understoodHeaders); } } } }
Example 2
Source File: MAPCodec.java From cxf with Apache License 2.0 | 5 votes |
/** * Invoked when unwinding normal interceptor chain when a fault occurred. * * @param message the messsage message */ public void handleFault(SoapMessage message) { if (!message.getExchange().isOneWay()) { AddressingProperties maps = ContextUtils.retrieveMAPs(message, false, true, false); if (ContextUtils.isRequestor(message) && maps != null) { //fault occurred trying to send the message, remove it uncorrelatedExchanges.remove(maps.getMessageID().getValue()); } else if (!ContextUtils.isRequestor(message) && maps == null && !message.containsKey(MAPAggregator.class.getName())) { //fault occurred while processing the incoming message, but possibly //before the MAPAggregator was called. We need to see if we can //try and map this if at all possible so a FaultTo/ReplyTo can //be properly determined to get the fault back to the rightful //place. for (Interceptor<? extends Message> i : message.getInterceptorChain()) { if (i instanceof MAPAggregator) { try { MAPAggregator agg = (MAPAggregator)i; agg.handleMessage(message); } catch (Throwable t) { //ignore } return; } } } } if (MessageUtils.getContextualBoolean(message, DECOUPLED_FAULT_SUPPORT, false)) { new DecoupledFaultHandler().handleFault(message); } }
Example 3
Source File: RMSoapInInterceptor.java From cxf with Apache License 2.0 | 5 votes |
private RMManager getManager(SoapMessage message) { InterceptorChain chain = message.getInterceptorChain(); ListIterator<Interceptor<? extends Message>> it = chain.getIterator(); while (it.hasNext()) { Interceptor<? extends Message> i = it.next(); if (i instanceof AbstractRMInterceptor) { return ((AbstractRMInterceptor<? extends Message>)i).getManager(); } } return null; }