}
// THIS NEXT PART WILL EVENTUALLY GO AWAY WHEN Callback DOES
// OK, this must be an old-style Callback
Callback callback = (Callback)callbackObj;
AsyncResult result = new AsyncResult(msgContext);
// check whether the result is a fault.
try {
SOAPEnvelope envelope = result.getResponseEnvelope();
OperationContext opContext = msgContext.getOperationContext();
if (opContext != null && !opContext.isComplete()) {
opContext.addMessageContext(msgContext);
}
if (envelope.hasFault()) {
AxisFault axisFault =
Utils.getInboundFaultFromMessageContext(msgContext);
callback.onError(axisFault);
} else {
callback.onComplete(result);
}
} catch (Exception e) {
callback.onError(e);
} finally {
callback.setComplete(true);
}
}