//A void return type is still marked by a value (which signifies null) on the wire, see
//TranscriptionStreamFactoryImpl for details
Object result = in.readObject();
return new InvocationResponseImpl(result);
} else {
ServerFaultCode code = (ServerFaultCode)in.readObject();
FaultDetail faultDetail = (FaultDetail) in.readObject();
if (faultDetail != null) {
if (faultDetail.getCause() != null) {
if (faultDetail.getCause() instanceof CougarApplicationException) {
return new InvocationResponseImpl(null, new CougarServiceException(code, faultDetail.getDetailMessage(), (CougarApplicationException)faultDetail.getCause()));
} else {
return new InvocationResponseImpl(null, new CougarServiceException(code, faultDetail.getDetailMessage(), faultDetail.getCause()));
}
}
else {
FaultCode faultCode = code == ServerFaultCode.ServiceCheckedException ? FaultCode.Server : code.getResponseCode().getFaultCode();
return new InvocationResponseImpl(null, new CougarServiceException(code, faultCode + " fault received from remote server: "+code,
new CougarServiceException(code, faultDetail.getDetailMessage())
));
}
}