private Collection<Attachment> setupAttachmentOutput(SoapMessage message) { // We have attachments, so add the interceptor message.getInterceptorChain().add(attachOut); // We should probably come up with another property for this message.put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE); Collection<Attachment> atts = message.getAttachments(); if (atts == null) { atts = new ArrayList<>(); message.setAttachments(atts); } return atts; } }
public void handleMessage(SoapMessage message) { if (binding.getHandlerChain().isEmpty()) { return; } if (getInvoker(message).getProtocolHandlers().isEmpty()) { return; } checkUnderstoodHeaders(message); if (getInvoker(message).isOutbound()) { //The SOAPMessage might be set from the outchain, in this case, //we need to clean it up and create a new SOAPMessage dedicated to fault. message.setContent(SOAPMessage.class, null); SAAJ_OUT.handleMessage(message); message.getInterceptorChain().add(ending); } }
public void handleMessage(Message message) throws Fault { if (binding.getHandlerChain().isEmpty()) { return; } HandlerChainInvoker invoker = getInvoker(message); if (invoker.getLogicalHandlers().isEmpty()) { return; } XMLStreamWriter origWriter = message.getContent(XMLStreamWriter.class); Document doc = DOMUtils.newDocument(); message.setContent(Node.class, doc); W3CDOMStreamWriter writer = new W3CDOMStreamWriter(doc); // set up the namespace context try { writer.setNamespaceContext(origWriter.getNamespaceContext()); } catch (XMLStreamException ex) { // don't set the namespaceContext } // Replace stax writer with DomStreamWriter message.setContent(XMLStreamWriter.class, writer); message.put(ORIGINAL_WRITER, origWriter); message.getInterceptorChain().add(ending); }
public void handleMessage(Message message) throws Fault { if (binding.getHandlerChain().isEmpty()) { return; } HandlerChainInvoker invoker = getInvoker(message); if (invoker.getLogicalHandlers().isEmpty()) { return; } XMLStreamWriter origWriter = message.getContent(XMLStreamWriter.class); Node nd = message.getContent(Node.class); SOAPMessage m = message.getContent(SOAPMessage.class); Document document = null; if (m != null) { document = m.getSOAPPart(); } else if (nd != null) { document = nd.getOwnerDocument(); } else { document = DOMUtils.newDocument(); message.setContent(Node.class, document); } W3CDOMStreamWriter writer = new W3CDOMStreamWriter(document.createDocumentFragment()); // Replace stax writer with DomStreamWriter message.setContent(XMLStreamWriter.class, writer); message.put(ORIGINAL_WRITER, origWriter); message.getInterceptorChain().add(ending); } @Override
SAAJ_OUT.handleMessage(message); message.getInterceptorChain().add(ending); } else { boolean isFault = handleMessageInternal(message);
message.getInterceptorChain().add(internal);
message.getInterceptorChain().add(CertConstraintsInterceptor.INSTANCE);
private static void addInterceptors(List<Interceptor<? extends Message>> interceptors, Message msg) { for (Interceptor<? extends Message> oi : interceptors) { msg.getInterceptorChain().add(oi); LOG.log(Level.FINE, "Added interceptor of type {0}", oi.getClass().getSimpleName()); } } }
private static void addInterceptors(List<Interceptor<? extends Message>> interceptors, Message msg) { for (Interceptor<? extends Message> oi : interceptors) { msg.getInterceptorChain().add(oi); LOG.log(Level.FINE, "Added interceptor of type {0}", oi.getClass().getSimpleName()); } } }
@Override public void filter(ContainerRequestContext context) throws IOException { InterceptorChain chain = PhaseInterceptorChain.getCurrentMessage().getInterceptorChain(); chain.add(this); } }
message.getInterceptorChain().add(SAAJOutEndingInterceptor.INSTANCE);
public void handleMessage(SoapMessage message) throws Fault { Fault f = (Fault) message.getContent(Exception.class); message.put(org.apache.cxf.message.Message.RESPONSE_CODE, f.getStatusCode()); if (message.getVersion() == Soap11.getInstance()) { message.getInterceptorChain().add(Soap11FaultOutInterceptorInternal.INSTANCE); } else { message.getInterceptorChain().add(Soap12FaultOutInterceptorInternal.INSTANCE); } }
public void handleMessage(SoapMessage message) throws Fault { Fault f = (Fault) message.getContent(Exception.class); message.put(org.apache.cxf.message.Message.RESPONSE_CODE, f.getStatusCode()); if (message.getVersion() == Soap11.getInstance()) { message.getInterceptorChain().add(Soap11FaultOutInterceptorInternal.INSTANCE); } else { message.getInterceptorChain().add(Soap12FaultOutInterceptorInternal.INSTANCE); } }
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); Boolean forceDisabled = Boolean.FALSE.equals(ex.get("org.apache.cxf.management.counter.enabled")); if (!forceDisabled && isServiceCounterEnabled(ex)) { message.getInterceptorChain().add(new ResponseTimeMessageInvokerEndingInteceptor()); } }
public void handleMessage(Message message) throws Fault { if (!canDocumentBeRead(message)) { return; } prepareMessage(message); message.getInterceptorChain().add( new StaxActionInInterceptor(requireSignature, requireEncryption)); }
public void handleMessage(SoapMessage mc) throws Fault { boolean enableStax = MessageUtils.getContextualBoolean(mc, SecurityConstants.ENABLE_STREAMING_SECURITY); if (!enableStax) { if (mc.getContent(SOAPMessage.class) == null) { saajOut.handleMessage(mc); } mc.put(SECURITY_PROCESSED, Boolean.TRUE); mc.getInterceptorChain().add(ending); } } public void handleFault(SoapMessage message) {
public void handleMessage(SoapMessage mc) throws Fault { boolean enableStax = MessageUtils.getContextualBoolean(mc, SecurityConstants.ENABLE_STREAMING_SECURITY); if (!enableStax) { if (mc.getContent(SOAPMessage.class) == null) { saajOut.handleMessage(mc); } mc.put(SECURITY_PROCESSED, Boolean.TRUE); mc.getInterceptorChain().add(ending); } } public void handleFault(SoapMessage message) {
public void handleMessage(Message message) { try { getConduit(message).prepare(message); } catch (IOException ex) { throw new Fault(new org.apache.cxf.common.i18n.Message("COULD_NOT_SEND", BUNDLE), ex); } // Add a final interceptor to close the conduit message.getInterceptorChain().add(ending); }
public void handleMessage(Message message) { try { getConduit(message).prepare(message); } catch (IOException ex) { throw new Fault(new org.apache.cxf.common.i18n.Message("COULD_NOT_SEND", BUNDLE), ex); } // Add a final interceptor to close the conduit message.getInterceptorChain().add(ending); }