private void changeToOneway(Exchange exchange) { exchange.setOneWay(true); exchange.setOutMessage(null); javax.servlet.http.HttpServletResponse httpresp = (javax.servlet.http.HttpServletResponse)exchange.getInMessage(). get("HTTP.RESPONSE"); if (httpresp != null) { httpresp.setStatus(202); } }
private Message createResponseMessage(Exchange exchange) { if (exchange == null) { return null; } Message m = exchange.getOutMessage(); if (m == null && !exchange.isOneWay()) { Endpoint ep = exchange.getEndpoint(); m = new MessageImpl(); m.setExchange(exchange); m = ep.getBinding().createMessage(m); exchange.setOutMessage(m); } return m; }
private void handleAbort(Message message, W3CDOMStreamWriter writer) { message.getInterceptorChain().abort(); if (!message.getExchange().isOneWay()) { //server side inbound Endpoint e = message.getExchange().getEndpoint(); Message responseMsg = new MessageImpl(); responseMsg.setExchange(message.getExchange()); responseMsg = e.getBinding().createMessage(responseMsg); message.getExchange().setOutMessage(responseMsg); XMLStreamReader reader = message.getContent(XMLStreamReader.class); if (reader == null && writer != null) { reader = StaxUtils.createXMLStreamReader(writer.getDocument()); } InterceptorChain chain = OutgoingChainInterceptor .getOutInterceptorChain(message.getExchange()); responseMsg.setInterceptorChain(chain); responseMsg.put("LogicalHandlerInterceptor.INREADER", reader); chain.doIntercept(responseMsg); } }
m.setExchange(exchange); m = ep.getBinding().createMessage(m); exchange.setOutMessage(m);
private void changeToOneway(Exchange exchange) { exchange.setOneWay(true); exchange.setOutMessage(null); javax.servlet.http.HttpServletResponse httpresp = (javax.servlet.http.HttpServletResponse)exchange.getInMessage(). get("HTTP.RESPONSE"); if (httpresp != null) { httpresp.setStatus(202); } }
faultMessage.put(FaultMode.class, mode); exchange.setOutMessage(null); exchange.setOutFaultMessage(faultMessage);
responseMsg.setExchange(message.getExchange()); responseMsg = e.getBinding().createMessage(responseMsg); message.getExchange().setOutMessage(responseMsg); SOAPMessage soapMessage = ((SOAPMessageContext)context).getMessage();
private Message getOutMessage(Message inMessage) { Exchange exchange = inMessage.getExchange(); Message outMessage = exchange.getOutMessage(); if (outMessage == null) { Endpoint endpoint = exchange.get(Endpoint.class); outMessage = endpoint.getBinding().createMessage(); exchange.setOutMessage(outMessage); } outMessage.putAll(inMessage); return outMessage; }
private Message getOutMessage(Message inMessage) { Exchange exchange = inMessage.getExchange(); Message outMessage = exchange.getOutMessage(); if (outMessage == null) { Endpoint endpoint = exchange.get(Endpoint.class); outMessage = endpoint.getBinding().createMessage(); exchange.setOutMessage(outMessage); } outMessage.putAll(inMessage); return outMessage; }
private Message createResponseMessage(Exchange exchange) { if (exchange == null) { return null; } Message m = exchange.getOutMessage(); if (m == null && !exchange.isOneWay()) { Endpoint ep = exchange.getEndpoint(); m = new MessageImpl(); m.setExchange(exchange); m = ep.getBinding().createMessage(m); exchange.setOutMessage(m); } return m; }
private Message createOutMessage(Message inMessage, Response r) { Endpoint e = inMessage.getExchange().getEndpoint(); Message mout = e.getBinding().createMessage(); mout.setContent(List.class, new MessageContentsList(r)); mout.setExchange(inMessage.getExchange()); mout.setInterceptorChain( OutgoingChainInterceptor.getOutInterceptorChain(inMessage.getExchange())); inMessage.getExchange().setOutMessage(mout); if (r.getStatus() >= Response.Status.BAD_REQUEST.getStatusCode()) { inMessage.getExchange().put("cxf.io.cacheinput", Boolean.FALSE); } return mout; } }
private Message getOutMessage() { Message message = m.getExchange().getOutMessage(); if (message == null) { Endpoint ep = m.getExchange().getEndpoint(); message = new org.apache.cxf.message.MessageImpl(); message.setExchange(m.getExchange()); message = ep.getBinding().createMessage(message); m.getExchange().setOutMessage(message); } return message; }
private Message getOutMessage() { Message message = m.getExchange().getOutMessage(); if (message == null) { Endpoint ep = m.getExchange().get(Endpoint.class); message = new org.apache.cxf.message.MessageImpl(); message.setExchange(m.getExchange()); message = ep.getBinding().createMessage(message); m.getExchange().setOutMessage(message); } return message; }
/** * Propagate inbound MAPs onto full reponse & fault messages. * * @param inMAPs the inbound MAPs * @param exchange the current Exchange */ public static void propogateReceivedMAPs(AddressingProperties inMAPs, Exchange exchange) { if (exchange.getOutMessage() == null) { exchange.setOutMessage(createMessage(exchange)); } propogateReceivedMAPs(inMAPs, exchange.getOutMessage()); if (exchange.getOutFaultMessage() == null) { exchange.setOutFaultMessage(createMessage(exchange)); } propogateReceivedMAPs(inMAPs, exchange.getOutFaultMessage()); }
private Message createOutMessage(Message inMessage) { Endpoint e = inMessage.getExchange().getEndpoint(); Message mout = e.getBinding().createMessage(); mout.setExchange(inMessage.getExchange()); mout.setInterceptorChain( OutgoingChainInterceptor.getOutInterceptorChain(inMessage.getExchange())); inMessage.getExchange().setOutMessage(mout); inMessage.getExchange().put("cxf.io.cacheinput", Boolean.FALSE); return mout; } }
private Message createOutMessage(Message inMessage) { Endpoint e = inMessage.getExchange().getEndpoint(); Message mout = e.getBinding().createMessage(); mout.setExchange(inMessage.getExchange()); mout.setInterceptorChain( OutgoingChainInterceptor.getOutInterceptorChain(inMessage.getExchange())); inMessage.getExchange().setOutMessage(mout); inMessage.getExchange().put("cxf.io.cacheinput", Boolean.FALSE); return mout; } }
protected Exchange createExchange(Message m, Exchange exchange) { if (exchange == null) { exchange = new ExchangeImpl(); } exchange.setSynchronous(true); exchange.setOutMessage(m); exchange.put(Bus.class, cfg.getBus()); exchange.put(MessageObserver.class, new ClientMessageObserver(cfg)); exchange.put(Endpoint.class, cfg.getConduitSelector().getEndpoint()); exchange.put("org.apache.cxf.transport.no_io_exceptions", true); //REVISIT - when response handling is actually put onto the in chain, this will likely not be needed exchange.put(StaxInEndingInterceptor.STAX_IN_NOCLOSE, Boolean.TRUE); m.setExchange(exchange); return exchange; }
protected Exchange createExchange(Message m, Exchange exchange) { if (exchange == null) { exchange = new ExchangeImpl(); } exchange.setSynchronous(true); exchange.setOutMessage(m); exchange.put(Bus.class, cfg.getBus()); exchange.put(MessageObserver.class, new ClientMessageObserver(cfg)); exchange.put(Endpoint.class, cfg.getConduitSelector().getEndpoint()); exchange.put("org.apache.cxf.transport.no_io_exceptions", true); //REVISIT - when response handling is actually put onto the in chain, this will likely not be needed exchange.put(StaxInEndingInterceptor.STAX_IN_NOCLOSE, Boolean.TRUE); m.setExchange(exchange); return exchange; }
protected Exchange createExchange(Message m, Exchange exchange) { if (exchange == null) { exchange = new ExchangeImpl(); } exchange.setSynchronous(true); exchange.setOutMessage(m); exchange.put(Bus.class, cfg.getBus()); exchange.put(MessageObserver.class, new ClientMessageObserver(cfg)); exchange.put(Endpoint.class, cfg.getConduitSelector().getEndpoint()); exchange.put("org.apache.cxf.transport.no_io_exceptions", true); //REVISIT - when response handling is actually put onto the in chain, this will likely not be needed exchange.put(StaxInEndingInterceptor.STAX_IN_NOCLOSE, Boolean.TRUE); m.setExchange(exchange); return exchange; }
/** * Retrieves/creates the corresponding Outbound Message. */ private Message getOutMessage(Message message) { Exchange exchange = message.getExchange(); Message outMessage = exchange.getOutMessage(); if (outMessage == null) { Endpoint endpoint = exchange.getEndpoint(); outMessage = new MessageImpl(); outMessage.putAll(message); outMessage.remove(Message.PROTOCOL_HEADERS); outMessage.setExchange(exchange); outMessage = endpoint.getBinding().createMessage(outMessage); exchange.setOutMessage(outMessage); } return outMessage; }