public InOptionalOut createInOptionalOutExchange() throws MessagingException { InOptionalOut exchange = getExchangeFactory().createInOptionalOutExchange(); NormalizedMessage in = exchange.createMessage(); exchange.setInMessage(in); return exchange; }
/** * Return a <code>MessageExchangeDecorator</code> for Consumer, as * <code>InOptionalOut</code>. * * @see javax.jbi.messaging.MessageExchangeFactory#createInOptionalOutExchange() * @return * the message exchange * @throws MessagingException * impossible to create the message exchange */ public InOptionalOut createInOptionalOutExchange() throws MessagingException { // Create the concrete message exchange MessageExchange meC = this.concreteMef.createInOptionalOutExchange(); // Convert into fake message exchange InOptionalOut meF = (InOptionalOut) Convert. convertConcreteMessageExchangeToFakeMessageExchange(meC, Convert.IN_OPTIONAL_OUT_PATTERN); ((org.objectweb.petals.tools.rmi.common.serializable. MessageExchange) meF).setRole(meC.getRole()); // Store the messages this.messages.put(meF.getExchangeId(), meC); return meF; }
private boolean processInOptionalOut(PostMethod method, MessageExchange exchange, Context context, boolean txSync, boolean close) throws Exception { if (method.getResponseContentLength() == 0) { exchange.setStatus(ExchangeStatus.DONE); channel.send(exchange); } else { NormalizedMessage msg = exchange.createMessage(); SoapReader reader = soapHelper.getSoapMarshaler().createReader(); SoapMessage soapMessage = reader.read(method.getResponseBodyAsStream(), method.getResponseHeader(HEADER_CONTENT_TYPE).getValue()); context.setOutMessage(soapMessage); soapHelper.onAnswer(context); if (getConfiguration().isWantHeadersFromHttpIntoExchange()) { msg.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method)); } soapHelper.getJBIMarshaler().toNMS(msg, soapMessage); ((InOptionalOut) exchange).setOutMessage(msg); if (txSync) { channel.sendSync(exchange); } else { methods.put(exchange.getExchangeId(), method); channel.send(exchange); close = false; } } return close; }
public InOptionalOut createInOptionalOutExchange() throws MessagingException { InOptionalOut exchange = getExchangeFactory().createInOptionalOutExchange(); NormalizedMessage in = exchange.createMessage(); exchange.setInMessage(in); return exchange; }