Reputation: 857
I am connecting to a web-service and getting errors in form of SoapException. This can contain different types of faults but are send down within the Detail property of SoapException. It can contain more than one faults. Here is one example of what is contained in the SoapException instance Detail.FirstChild.OuterXml.
<SomeErrorFault xmlns=\"urn:somenamespace\" xsi:type=\"SomeError\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"></SomeErrorFault>
The InnerExcpetion property is null. I would like to inspect all type of faults and take action on those. I of-course can do Detail.FirstChild.OuterXml.Contains("TypeOfFaultIAmLookingFor") but wondering if there is any better of retrieving this information?
Upvotes: 2
Views: 80
Reputation: 1899
You basically have to understand the data structure of SOAP fault. See this link might help. http://msdn.microsoft.com/en-us/library/ms189538(v=sql.105).aspx
Upvotes: 1