QName operationName = getOperationNameToUse(request, ServiceClient.ANON_OUT_IN_OP);
// TODO: Will the ServiceClient stick around on the InvocationContext
// or will we need some other mechanism of creating this?
// Try to create an OperationClient from the passed in ServiceClient
InvocationContext ic = request.getInvocationContext();
ServiceClient svcClient = ic.getServiceClient();
OperationClient opClient = createOperationClient(svcClient, operationName);
initOperationClient(opClient, request);
// Setup the client so that it knows whether the underlying call to
// Axis2 knows whether or not to start a listening port for an
// asynchronous response.
Boolean useAsyncMep = (Boolean)request.getProperty(Constants.USE_ASYNC_MEP);
if ((useAsyncMep != null && useAsyncMep.booleanValue())
|| opClient.getOptions().isUseSeparateListener()) {
configureAsyncListener(opClient, request.getAxisMessageContext());
} else {
if (log.isDebugEnabled()) {
log.debug(
"Asynchronous message exchange not enabled. The invocation will be synchronous.");
}
}
AsyncResponse resp = ic.getAsyncResponseListener();
PollingFuture pf = new PollingFuture(ic);
opClient.setCallback(pf);
org.apache.axis2.context.MessageContext axisRequestMsgCtx = request.getAxisMessageContext();
try {