Beispiel #1
0
		public Soap12Fault (SoapException ex) 
		{
			Code = new Soap12FaultCode ();
			Code.Value = ex.Code;
			if (ex.SubCode != null)
				Code.Subcode = CreateFaultCode (ex.SubCode);
			Node = ex.Node;
			Role = ex.Role;
			Reason = new Soap12FaultReason ();
			Soap12FaultReasonText text =
				new Soap12FaultReasonText ();
			text.XmlLang = ex.Lang;
			text.Value = ex.Message;
			Reason.Texts = new Soap12FaultReasonText [] {text};
			if (ex.Detail != null) {
				Detail = new Soap12FaultDetail ();
				if (ex.Detail.NodeType == XmlNodeType.Attribute)
					Detail.Attributes = new XmlAttribute [] {
						(XmlAttribute) ex.Detail};
				else if (ex.Detail.NodeType == XmlNodeType.Element)
					Detail.Children = new XmlElement [] {
						(XmlElement) ex.Detail};
				else
					Detail.Text = ex.Detail.Value;
			}
		}
Beispiel #2
0
        public Soap12Fault(SoapException ex)
        {
            Code       = new Soap12FaultCode();
            Code.Value = ex.Code;
            if (ex.SubCode != null)
            {
                Code.Subcode = CreateFaultCode(ex.SubCode);
            }
            Node   = ex.Node;
            Role   = ex.Role;
            Reason = new Soap12FaultReason();
            Soap12FaultReasonText text =
                new Soap12FaultReasonText();

            text.XmlLang = ex.Lang;
            text.Value   = ex.Message;
            Reason.Texts = new Soap12FaultReasonText [] { text };
            if (ex.Detail != null)
            {
                Detail = new Soap12FaultDetail();
                if (ex.Detail.NodeType == XmlNodeType.Attribute)
                {
                    Detail.Attributes = new XmlAttribute [] {
                        (XmlAttribute)ex.Detail
                    }
                }
                ;
                else if (ex.Detail.NodeType == XmlNodeType.Element)
                {
                    Detail.Children = new XmlElement [] {
                        (XmlElement)ex.Detail
                    }
                }
                ;
                else
                {
                    Detail.Text = ex.Detail.Value;
                }
            }
        }