public static SoapException Soap12FaultToSoapException(Soap12Fault fault) { Soap12FaultReasonText text = fault.Reason != null && fault.Reason.Texts != null && fault.Reason.Texts.Length > 0 ? fault.Reason.Texts [fault.Reason.Texts.Length - 1] : null; XmlNode detail = (fault.Detail == null) ? null : (fault.Detail.Children != null && fault.Detail.Children.Length > 0) ? (XmlNode)fault.Detail.Children [0] : (fault.Detail.Attributes != null && fault.Detail.Attributes.Length > 0) ? fault.Detail.Attributes [0] : null; SoapFaultSubCode subcode = Soap12Fault.GetSoapFaultSubCode(fault.Code.Subcode); return(new SoapException( text != null ? text.Value : null, fault.Code.Value, null, fault.Role, text != null ? text.XmlLang : null, detail, subcode, null)); }
public static SoapException Soap12FaultToSoapException (Soap12Fault fault) { Soap12FaultReasonText text = fault.Reason != null && fault.Reason.Texts != null && fault.Reason.Texts.Length > 0 ? fault.Reason.Texts [fault.Reason.Texts.Length - 1] : null; XmlNode detail = (fault.Detail == null) ? null : (fault.Detail.Children != null && fault.Detail.Children.Length > 0) ? (XmlNode) fault.Detail.Children [0] : (fault.Detail.Attributes != null && fault.Detail.Attributes.Length > 0) ? fault.Detail.Attributes [0] : null; SoapFaultSubCode subcode = Soap12Fault.GetSoapFaultSubCode (fault.Code.Subcode); return new SoapException ( text != null ? text.Value : null, fault.Code.Value, null, fault.Role, text != null ? text.XmlLang : null, detail, subcode, null); }