DeserializationContext dser =
new DeserializationContext(new InputSource(in), resMsg.getMessageContext(), null);
dser.parse();
SOAPEnvelope responseEnvelope = dser.getEnvelope();
SOAPBodyElement bodyEl = responseEnvelope.getFirstBody();
if (bodyEl == null) {
return null;
}
QName returnType = operation.getReturnType();
if (XMLType.AXIS_VOID.equals(returnType)) {
return null;
}
Object result = null;
if (bodyEl instanceof RPCElement) {
RPCElement body = (RPCElement)bodyEl;
body.setNeedDeser(true);
Vector args = null;
try {
args = body.getParams();
} catch (SAXException e) {
if (e.getException() != null) {
throw e.getException();
}
throw e;
}
QName returnParamQName = operation.getReturnQName();
if (args != null && args.size() > 0) {
if (returnParamQName == null) {
RPCParam param = (RPCParam) args.get(0);
result = param.getObjectValue();
} else {
for (int i = 0; i < args.size(); i++) {
RPCParam param = (RPCParam) args.get(i);
if (returnParamQName.equals(param.getQName())) {
result = param.getObjectValue();
break;
}
}
}
}
} else {
try {
result = bodyEl.getValueAsType(returnType);
} catch (Exception e) {
result = bodyEl;
}
}