// Axis2 operationClients can not be shared so create a new one for each request
final OperationClient operationClient = serviceClient.createClient(wsdlOperationName);
operationClient.setOptions(options);
Endpoint callbackEndpoint;
AsyncResponseInvoker<String> respInvoker = (AsyncResponseInvoker<String>) msg.getHeaders().get(Constants.ASYNC_RESPONSE_INVOKER);
if( respInvoker != null ) {
callbackEndpoint = createAsyncResponseEndpoint( msg, respInvoker );
msg.setTo(callbackEndpoint);
} else {
callbackEndpoint = msg.getFrom().getCallbackEndpoint();
} // end if
SOAPEnvelope sev = requestMC.getEnvelope();
SOAPHeader sh = sev.getHeader();
// Add WS-Addressing header for the invocation of a bidirectional service
if (callbackEndpoint != null) {
// Load the actual callback endpoint URI into an Axis EPR ready to form the content of the wsa:From header
EndpointReference fromEPR = new EndpointReference(callbackEndpoint.getBinding().getURI());
addWSAFromHeader( sh, fromEPR );
addWSAActionHeader( sh );
addWSAMessageIDHeader( sh, (String)msg.getHeaders().get("MESSAGE_ID"));