I have an XML / Soap file that looks like this:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <SendData xmlns="http://stuff.com/stuff"> <SendDataResult>True</SendDataResult> </SendData> </soap:Body> </soap:Envelope>
I want to extract the SendDataResult value, but I am having difficulty with this code and various other methods that I tried. It always returns null, even if the element has a value.
XElement responseXml = XElement.Load(responseOutputFile); string data = responseXml.Element("SendDataResult").Value;
What you need to do to retrieve the SendDataResult element.
source share