title: Windows Phone 8 Web Request Async Call for XML
body: <p>I have a php service that generates XML. How can I parse the XML in C#? I tried using something like this:</p>
  
  <pre><code>WebRequest request = WebRequest.Create("http://devstage.jokeroo.com/rest.php");
  request.Method = "GET";
  request.ContentType = "text/html";
  IAsyncResult result = request.BeginGetResponse(RequestCallback, request);
  
  private void RequestCallback(IAsyncResult ar)
      {
          var request = ar.AsyncState as WebRequest;
          Stream reader = request.EndGetResponse(ar).GetResponseStream();
          //use this reader to read the content
      }
  </code></pre>
  
  <p>But it keeps throwing this exception:</p>
  
  <p>An exception of type <code>'System.Net.ProtocolViolationException'</code> occurred in <code>System.Windows.ni.dll</code> but was not handled in user code</p>
  
  <p>Any suggestions?</p>