I don't get this. I really don't get the ReadEndElement. I assume after every ReadStartElement, you need to close off the reader to advanced to the next start element and if there's no more start elements, close by ReadEndElement for all other elements?
Sample of the returned XML:
<Envelope>
<Body>
<RESULT>
<SUCCESS>true</SUCCESS>
<SESSIONID>dc302149861088513512481</SESSIONID>
<ENCODING>dc302149861088513512481
</ENCODING>
</RESULT>
</Body>
</Envelope>
reader.Read();
reader.ReadStartElement("Envelope");
reader.ReadStartElement("Body");
reader.ReadStartElement("RESULT");
reader.ReadStartElement("SUCCESS");
reader.ReadEndElement();
reader.ReadStartElement("SESSIONID");
_sessionID = reader.ReadString();
reader.ReadEndElement();
reader.ReadEndElement(); <-- error here
reader.ReadEndElement();
reader.ReadEndElement();
I am ignoring one of the elements (ENCODING) retuned, because I don't need it...not sure if that has anything to do with it. Maybe I'm required to read every element regardless if I want to use it or not.