/** {@inheritDoc} */ @Override protected void doInvoke(@Nonnull final MessageContext messageContext) throws MessageHandlerException { final Collection<ChannelBindings> channelBindings = new ArrayList<>(); final List<XMLObject> headers = SOAPMessagingSupport.getHeaderBlock(messageContext, ChannelBindings.DEFAULT_ELEMENT_NAME, null, finalDestination); for (final XMLObject header : headers) { if (header instanceof ChannelBindings) { if (null == ((ActorBearing) header).getSOAP11Actor() || nextDestination) { channelBindings.add((ChannelBindings) header); } } } if (channelBindings.isEmpty()) { log.debug("{} No ChannelBindings header blocks found", getLogPrefix()); } else { log.debug("{} {} ChannelBindings header block(s) found", getLogPrefix(), channelBindings.size()); messageContext.getSubcontext(SOAP11Context.class).getSubcontext(ChannelBindingsContext.class, true).getChannelBindings().addAll(channelBindings); } }