* This {@link RequestContext} is used for invoking this method.
* We take this as a separate parameter because of the async invocation
* handling, which requires a separate copy.
*/
Object invoke(Object proxy, Object[] args, RequestContext rc, ResponseContextReceiver receiver) throws Throwable {
JavaCallInfo call = owner.databinding.createJavaCallInfo(method, args);
Packet req = (Packet) owner.databinding.serializeRequest(call);
// process the message
Packet reply = owner.doProcess(req,rc,receiver);
Message msg = reply.getMessage();
if(msg == null) {
if (!isOneway || !isVoid) {
throw new WebServiceException(DispatchMessages.INVALID_RESPONSE());
}
return null;
}
try {
call = owner.databinding.deserializeResponse(reply, call);
if (call.getException() != null) {
throw call.getException();
} else {
return call.getReturnValue();
}
} catch (JAXBException e) {
throw new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(), e);
} catch (XMLStreamException e) {
throw new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(),e);