If I skip, do I still need to read the end element?
reader.ReadStartElement("ENCODING");
reader.Skip();
reader.ReadEndElement();
And I don't get when we need to ReadEndElement. For example we've gotten by in some of our classes with not using it at all. For example:
using (reader)
{
reader.Read();
reader.ReadStartElement("Envelope");
reader.ReadStartElement("Body");
reader.ReadStartElement("RESULT");
reader.ReadStartElement("SUCCESS");
_success = reader.ReadString();
if (!Success)
{
if (SomeUtil.ReadUntilElement(reader, "FaultString"))
{
string _errorMessage = reader.ReadString();
InvalidOperationException ex = new InvalidOperationException(_errorMessage);
throw ex;
}
else
throw new InvalidOperationException("Invalid Error Message");
}
}