locked
Getting Started page on MSDN sample RRS feed

  • Question

  • Hi,

    I am following steps on Getting Started with Microsoft Translator > Using the HTTP API (http://msdn.microsoft.com/en-us/library/ff512387.aspx) and in the code snippets part:

    Text Box: WebResponse resp = req.GetResponse(); Stream strm = resp.GetResponseStream(); StreamReader reader = new System.IO.StreamReader(strm); string locale = reader.ReadToEnd(); Text Box: lblOutput.Text =

    locale would return an xml like:

    <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">en</string>

    so the string should be parsed first before it would display as it's shown as the result

    8.jpg

    Am I missing something? or there's a bug in the sample? This would mislead NEW developers who would be the majority of readers of samples.

    Thanks. 

    Friday, December 17, 2010 4:42 AM

All replies

  • Hi Khumara - I have asked our engineering team to look into this. Thanks for reporting it to us.
    Friday, February 4, 2011 3:07 AM
  • The output is a xml document with namespace on the elements. Yes, you should parse the document and get the value of the xml element.

    Friday, February 11, 2011 1:04 AM