private Object buildPayloadFromResponse() {
Method m = (Method)msgContext.get(ObjectMessageContext.METHOD_OBJ);
// TODO -- add support for 'out' params
//
if (!Void.TYPE.equals(m.getReturnType())) {
ResponseWrapper ann = m.getAnnotation(ResponseWrapper.class);
assert ann != null : "ResponseWrapper is null";
WebResult wr = m.getAnnotation(WebResult.class);
assert wr != null : "WebResult is null for method " + m;
Object returnVal = msgContext.get(ObjectMessageContext.METHOD_RETURN);
// if a handler has aborted the processing sequence, the
// return type may be null
if (returnVal != null) {
Object wrapper = createWrapperInstance(ann.className());
setWrapperValue(wrapper, wr.name(), returnVal);
return wrapper;
}
}
return null;