//if the conversion fails and the endpoint is not a ServiceAdapter
//just drop the object directly into an array
args = new Object[]{msg.body};
}
IPendingServiceCall call = new PendingCall(operation, args);
try {
if (!serviceInvoker.invoke(call, endpoint)) {
if (call.getException() != null) {
// Use regular exception handling
Throwable err = call.getException();
return returnError(msg, "Server.Invoke.Error", err.getMessage(), err);
}
return returnError(msg, "Server.Invoke.Error", "Can't invoke method.", "");
}
} catch (Throwable err) {
log.error("Error while invoking method.", err);
return returnError(msg, "Server.Invoke.Error", err.getMessage(), err);
}
//we got a valid result from the method call.
result.body = call.getResult();
}
return result;
}