__log.error(errmsg);
odeMex.replyWithFailure(FailureType.INVALID_ENDPOINT, errmsg, null);
return;
}
ServiceEndpoint se = targetEndpoint.getServiceEndpoint();
boolean isTwoWay = odeMex.getMessageExchangePattern() == org.apache.ode.bpel.iapi.MessageExchange.MessageExchangePattern.REQUEST_RESPONSE;
QName opname = new QName(se.getServiceName().getNamespaceURI(), odeMex.getOperation().getName());
MessageExchangeFactory mexf = _ode.getChannel().createExchangeFactory(se);
final MessageExchange jbiMex;
try {
jbiMex = mexf.createExchange(isTwoWay ? MessageExchangePattern.IN_OUT : MessageExchangePattern.IN_ONLY);
jbiMex.setEndpoint(se);
jbiMex.setService(se.getServiceName());
jbiMex.setOperation(opname);
} catch (MessagingException e) {
String errmsg = "Unable to create JBI message exchange for ODE message exchange " + odeMex;
__log.error(errmsg, e);
odeMex.replyWithFailure(FailureType.COMMUNICATION_ERROR, errmsg, null);