开发者

Under High load XDocument.Parse Creating errors

I am trying to access this webservice, The problem is that sometimes XDocument.Parse is not able to process and generates an error System.Xml.XmlException: Root element is missing. on the line:

XDocument xmlDoc = XDocument.Parse(xmlData);

Even though the XML sent is correct according to my logs.

I was wondering, Is it possible that the StreamReader is not working properly

    using (StreamReader reader = new StreamReader(context.Request.InputStream))
    {
    开发者_开发技巧    xmlData = reader.ReadToEnd();
    }

    XDocument xmlDoc = XDocument.Parse(xmlData);

By the way this is all under a Custom HttpHandler.

Can someone please me guide in the right direction for this.

Thanks


Does it work any more consistently if you use

XDocument.Load(new StreamReader(context.Request.InputStream))

instead of XDocument.Parse?


Your code sample doesn't include logging of the read inputstream. The problem is prior to this point.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜