// get a reference to the DYNAMIC operation of the Anonymous Axis2 service
AxisOperation axisAnonymousOperation = anoymousService.getOperation(
new QName(AnonymousServiceFactory.DYNAMIC_OPERATION));
Options clientOptions = new Options();
clientOptions.setUseSeparateListener(separateListener);
// if RM is requested,
if (wsRMEnabled) {
// if a WS-RM policy is specified, use it
if (wsRMPolicyKey != null) {
clientOptions.setProperty(
org.apache.synapse.config.xml.Constants.SANDESHA_POLICY,
getPolicy(synapseOutMessageContext, wsRMPolicyKey));
}
copyRMOptions(originalInMsgCtx, clientOptions);
// always send each and every message in a new sequence and terminate sequence
//clientOptions.setProperty("Sandesha2LastMessage", "true");
}
// if security is enabled,
if (wsSecurityEnabled) {
// if a WS-Sec policy is specified, use it
if (wsSecPolicyKey != null) {
clientOptions.setProperty(
org.apache.synapse.config.xml.Constants.RAMPART_POLICY,
getPolicy(synapseOutMessageContext, wsSecPolicyKey));
}
}
OperationClient mepClient = axisAnonymousOperation.createClient(
serviceCtx, clientOptions);
mepClient.addMessageContext(axisOutMsgCtx);
if (clientOptions.isUseSeparateListener()) {
mepClient.setCallback(new AsyncCallback(synapseOutMessageContext));
axisOutMsgCtx.getOperationContext().setProperty(
org.apache.axis2.Constants.RESPONSE_WRITTEN, "SKIP");
mepClient.execute(false);
return null;