/** * Send an IN_OUT message to the target Service. * @param messagePayload The message payload. * @return The response message. * @throws InvocationFaultException if the message exchange produces a fault */ public Message sendInOut(Object messagePayload) throws InvocationFaultException { ExchangeHandlerProxy exchangeHandlerProxy = _exchangeHandlerProxy; ResponseCatcher responseCatcher = null; if (exchangeHandlerProxy == null) { responseCatcher = new ResponseCatcher(); exchangeHandlerProxy = createHandlerProxy(responseCatcher); } Exchange exchange = createExchange(ExchangePattern.IN_OUT, exchangeHandlerProxy._exchangeHandlerProxy); Message message = exchange.createMessage().setContent(messagePayload); setProperties(exchange, message); addAttachments(message); exchange.send(message); exchangeHandlerProxy._proxyInvocationHandler.waitForResponse(_timeoutMillis); if (responseCatcher != null) { if (responseCatcher._isFault) { throw new InvocationFaultException(responseCatcher._response); } else { return responseCatcher._response; } } return null; }
/** * Send an IN_OUT message to the target Service. * @param messagePayload The message payload. * @return The response message. * @throws InvocationFaultException if the message exchange produces a fault */ public Message sendInOut(Object messagePayload) throws InvocationFaultException { ExchangeHandlerProxy exchangeHandlerProxy = _exchangeHandlerProxy; ResponseCatcher responseCatcher = null; if (exchangeHandlerProxy == null) { responseCatcher = new ResponseCatcher(); exchangeHandlerProxy = createHandlerProxy(responseCatcher); } Exchange exchange = createExchange(ExchangePattern.IN_OUT, exchangeHandlerProxy._exchangeHandlerProxy); Message message = exchange.createMessage().setContent(messagePayload); setProperties(exchange, message); addAttachments(message); exchange.send(message); exchangeHandlerProxy._proxyInvocationHandler.waitForResponse(_timeoutMillis); if (responseCatcher != null) { if (responseCatcher._isFault) { throw new InvocationFaultException(responseCatcher._response); } else { return responseCatcher._response; } } return null; }
/** * Send an IN_ONLY message to the target Service. * @param messagePayload The message payload. * @throws InvocationFaultException if the message exchange produces a fault */ public void sendInOnly(Object messagePayload) throws InvocationFaultException { ExchangeHandlerProxy exchangeHandlerProxy = _exchangeHandlerProxy; ResponseCatcher responseCatcher = null; if (exchangeHandlerProxy == null) { responseCatcher = new ResponseCatcher(); exchangeHandlerProxy = createHandlerProxy(responseCatcher); } Exchange exchange = createExchange(ExchangePattern.IN_ONLY, exchangeHandlerProxy._exchangeHandlerProxy); Message message = exchange.createMessage().setContent(messagePayload); setProperties(exchange, message); addAttachments(message); exchange.send(message); if (exchange.getState().equals(ExchangeState.FAULT)) { throw new InvocationFaultException(exchange.getMessage()); } }
/** * Send an IN_ONLY message to the target Service. * @param messagePayload The message payload. * @throws InvocationFaultException if the message exchange produces a fault */ public void sendInOnly(Object messagePayload) throws InvocationFaultException { ExchangeHandlerProxy exchangeHandlerProxy = _exchangeHandlerProxy; ResponseCatcher responseCatcher = null; if (exchangeHandlerProxy == null) { responseCatcher = new ResponseCatcher(); exchangeHandlerProxy = createHandlerProxy(responseCatcher); } Exchange exchange = createExchange(ExchangePattern.IN_ONLY, exchangeHandlerProxy._exchangeHandlerProxy); Message message = exchange.createMessage().setContent(messagePayload); setProperties(exchange, message); addAttachments(message); exchange.send(message); if (exchange.getState().equals(ExchangeState.FAULT)) { throw new InvocationFaultException(exchange.getMessage()); } }