Hello,
I have a SOAP C#Desktop application.
This can return an error.
Is there a way to simply parse this return string?
If yes, how?
I need ErrorNumber, Message, faultcode, faultstring
What do I have to consider when reading out? Namespace and so on
Thank you.
Works not
XDocument doc = XDocument.Parse(xmlAnalyse);
XNamespace ns = "http://schemas.xmlsoap.org/soap/envelope/";
//Grab the reader
var reader = xDoc.CreateReader();
//Set the root
var root = xDoc.Root;
//Use the reader NameTable
var namespaceManager = new XmlNamespaceManager(reader.NameTable);
IEnumerable<XElement> responses = doc.Descendants(ns + "OracleError");
foreach (XElement response in responses)
{
string strResponseErrorNumber = (string)response.Element(ns + "ErrorNumber");
string strResponseMessage = (string)response.Element(ns + "Message");
}
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Error processing input</faultstring>
<detail>
<OracleErrors
xmlns="http://xmlns.oracle.com/orawdsv/faults">
<OracleError>
<ErrorNumber>ORA-41821</ErrorNumber>
<Message>XML parsing failed</Message>
</OracleError>
</OracleErrors>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>