title: UWP and Json parsing
body: <p>I have method like this: </p>
  
  <pre><code>public static async void DoSomething()
  {
      try
      {
          var client = new HttpClient();
          var url = "http://10.0.0.68/SET Initialization";
          var url2 = "http://10.0.0.68/GET Status";
          var response = await client.GetAsync(url);
          Debug.WriteLine(response);
          response = await client.GetAsync(url2);
          Debug.WriteLine(response);
          var result =await response.Content.ReadAsStringAsync();
          var jsonString = result.Substring(4);
          var serializer = new DataContractJsonSerializer(typeof(MediaStatus));
          var ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
          var data = (MediaStatus)serializer.ReadObject(ms);
          Debug.Write(data.ProgNo);
      }
      catch (Exception exception)
      {
          Debug.WriteLine(exception.Message, exception.Source);
      }
  }
  </code></pre>
  
  <p>MediaStatus.cs</p>
  
  <pre><code>[DataContract]
  public class MediaStatus
  {
      [DataMember(Name = "progNo")]
      public int ProgNo { get; set; }
      [DataMember(Name = "index")]
      public int Index { get; set; }
      [DataMember(Name = "type")]
      public string Type { get; set; }
      [DataMember(Name = "group")]
      public int Group { get; set; }
      [DataMember(Name = "msg")]
      public string Msg { get; set; }
      [DataMember(Name = "secondGroup")]
      public int SecondGroup { get; set; }
      [DataMember(Name = "playFlag")]
      public int PlayFlag { get; set; }
  }
  </code></pre>
  
  <p>I am calling it simply: </p>
  
  <pre><code>common.DoSomething();
  </code></pre>
  
  <p><strong>My problem is, that sometimes, the code is running well and will give me result, but sometimes I have an error:</strong> </p>
  
  <blockquote>
    <p>Exception thrown: 'System.Runtime.Serialization.SerializationException' in System.Private.DataContractSerialization.dll
    System.Private.DataContractSerialization:Expecting element 'root' from namespace ''.. Encountered 'None'  with name '', namespace ''.</p>
  </blockquote>
  
  <p>I have to call two times <code>await client.GetAsync</code> with different urls</p>
  
  <ol>
  <li>to say server that I would like to talk with him</li>
  <li>to obtain status info </li>
  </ol>