XmlDocumentxmlDoc=newXmlDocument(); //CreatetheDetailnode XmlNoderootNode=xmlDoc.CreateNode(XmlNodeType.Element, SoapException.DetailElementName.Name, SoapException.DetailElementName.Namespace); //BuildspecificdetailsfortheSoapException //AddfirstchildofdetailXMLelement. XmlNodeerrorNode=xmlDoc.CreateNode(XmlNodeType.Element,"Error", webServiceNamespace); //CreateandsetthevaluefortheErrorNumbernode XmlNodeerrorNumberNode= xmlDoc.CreateNode(XmlNodeType.Element,"ErrorNumber", webServiceNamespace); errorNumberNode.InnerText=errorNumber; //CreateandsetthevaluefortheErrorMessagenode XmlNodeerrorMessageNode=xmlDoc.CreateNode(XmlNodeType.Element, "ErrorMessage", webServiceNamespace); errorMessageNode.InnerText=errorMessage; //CreateandsetthevaluefortheErrorSourcenode XmlNodeerrorSourceNode= xmlDoc.CreateNode(XmlNodeType.Element,"ErrorSource", webServiceNamespace); errorSourceNode.InnerText=errorSource; //AppendtheErrorchildelementnodestotherootdetailnode. errorNode.AppendChild(errorNumberNode); errorNode.AppendChild(errorMessageNode); errorNode.AppendChild(errorSourceNode); //AppendtheDetailnodetotherootnode rootNode.AppendChild(errorNode); //Constructtheexception SoapExceptionsoapEx=newSoapException(errorMessage, faultCodeLocation,uri, rootNode); //Raisetheexceptionbacktothecaller returnsoapEx; } |
闁衡偓閹増顥戦柟瀛樺姇婵拷闁哄被鍎冲﹢鍛村绩閹増顥�>>
0正在阅读:Web服务中的异常处理(3)Web服务中的异常处理(3)
2004-02-14 09:34
出处:PConline
责任编辑:linjixiong
键盘也能翻页,试试“← →”键