}
// if the transport to use for sending is not specified, try to find it from the URL
TransportOutDescription transportOut = options.getTransportOut();
if (transportOut == null) {
EndpointReference toEPR =
(options.getTo() != null) ? options.getTo() : outMsgCtx.getTo();
transportOut =
ClientUtils.inferOutTransport(cfgCtx.getAxisConfiguration(), toEPR, outMsgCtx);
}
outMsgCtx.setTransportOut(transportOut);
if (options.getTransportIn() == null && outMsgCtx.getTransportIn() == null) {
outMsgCtx.setTransportIn(ClientUtils.inferInTransport(
cfgCtx.getAxisConfiguration(), options, outMsgCtx));
} else if (outMsgCtx.getTransportIn() == null) {
outMsgCtx.setTransportIn(options.getTransportIn());
}
// add reference parameters to To EPR
addReferenceParameters(outMsgCtx);
if (options.isUseSeparateListener()) {
options.setTransportIn(outMsgCtx.getConfigurationContext()
.getAxisConfiguration().getTransportIn(Constants.TRANSPORT_HTTP));
SynapseCallbackReceiver callbackReceiver =
(SynapseCallbackReceiver) axisOp.getMessageReceiver();
((Axis2MessageContext)((AsyncCallback)
axisCallback).getSynapseOutMsgCtx()).getAxis2MessageContext().setProperty(
NhttpConstants.IGNORE_SC_ACCEPTED, Constants.VALUE_TRUE);
callbackReceiver.addCallback(outMsgCtx.getMessageID(), axisCallback);
EndpointReference replyToFromTransport = outMsgCtx.getConfigurationContext()
.getListenerManager().getEPRforService(sc.getAxisService().getName(),
axisOp.getName().getLocalPart(), outMsgCtx.getTransportOut().getName());
if (outMsgCtx.getReplyTo() == null) {
outMsgCtx.setReplyTo(replyToFromTransport);
} else {
outMsgCtx.getReplyTo().setAddress(replyToFromTransport.getAddress());
}
outMsgCtx.getConfigurationContext().registerOperationContext(
outMsgCtx.getMessageID(), oc);