Reputation: 11
I have read that setting the position of the stream to 0 resolves this, but this fails as the stream "does not support seek operations".
It fails on this:
XDocument doc = XDocument.Load(resp.GetResponseStream());
Reading the stream:
string t = new StreamReader(resp.GetResponseStream(), Encoding.Default).ReadToEnd();
...reveals that my xml could not be any simpler:
<xml version="1.0">
<ActiveStorms>
</ActiveStorms>
</xml>
Is this somehow malformed?
Thanks for any help, Mike
Upvotes: 1
Views: 1690
Reputation: 170
The right XML declaration is
<?xml version="1.0" encoding="utf-8" ?>
and after that add your root node <ActiveStorms>
so,
<?xml version="1.0" encoding="utf-8" ?>
<ActiveStorms>
</ActiveStorms>
Upvotes: 0
Reputation: 22638
XML documents do not end with a </xml>
closing tag so delete that. The initial <xml version="1.0">
should be: <?xml version="1.0">
(note the question mark).
So a valid version would look like:
<?xml version="1.0">
<ActiveStorms>
</ActiveStorms>
Upvotes: 1