return msg;
}
protected Object invokeTarget(Message msg) throws AxisFault {
WSAxis2BindingContext bindingContext = msg.getBindingContext();
final OperationClient operationClient = bindingContext.getAxisOperationClient();
// ensure connections are tracked so that they can be closed by the reference binding
MessageContext requestMC = operationClient.getMessageContext("Out");
requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
requestMC.getOptions().setTimeOutInMilliSeconds(240000L);
// Allow privileged access to read properties. Requires PropertiesPermission read in
// security policy.
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() throws AxisFault {
operationClient.execute(true);
return null;
}
});
} catch (PrivilegedActionException e) {
operationClient.complete(requestMC);
throw (AxisFault)e.getException();
}
MessageContext responseMC = operationClient.getMessageContext("In");
bindingContext.setAxisInMessageContext(responseMC);
OMElement response = responseMC.getEnvelope().getBody().getFirstElement();
// FIXME: [rfeng] We have to pay performance penalty to build the complete OM as the operationClient.complete() will
// release the underlying HTTP connection.