title: SOAP Parsing in windows phone 7
body: <p>I will searching since 10 days but i have not succeed in soap parsing in wp7.</p>
  
  <p>My code is below. I get the The remote server returned an error: NotFound. and System.Net.WebException.</p>
  
  <p>code is below : </p>
  
  <pre><code> private const string AuthServiceUri = "http://manarws.org/WS/manarService.asmx";
      private const string AuthEnvelope =
                         @"&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;
                      &lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;
                          &lt;soap:Body&gt;
                              &lt;fnGetNewsResponse xmlns=""http://tempuri.org/""&gt;
                                 &lt;fnGetNewsResult&gt;&lt;/fnGetNewsResult&gt;
                                 &lt;/fnGetNewsResponse&gt;                
                          &lt;/soap:Body&gt;
                      &lt;/soap:Envelope&gt;";
  
   public void Authenticate()
      {
          HttpWebRequest spAuthReq = HttpWebRequest.Create(AuthServiceUri) as HttpWebRequest;
          spAuthReq.Headers["SOAPAction"] = "http://tempuri.org/fnGetNews";
          spAuthReq.ContentType = "text/xml; charset=utf-8";
          spAuthReq.Method = "POST";
          spAuthReq.BeginGetRequestStream(new AsyncCallback(spAuthReqCallBack), spAuthReq);
      }
  
   private void spAuthReqCallBack(IAsyncResult asyncResult)
      {
          UTF8Encoding encoding = new UTF8Encoding();
          HttpWebRequest request = (HttpWebRequest)asyncResult.AsyncState;
          System.Diagnostics.Debug.WriteLine("REquest is :" + request.Headers);
          Stream _body = request.EndGetRequestStream(asyncResult);
          string envelope = string.Format(AuthEnvelope,"","");
          System.Diagnostics.Debug.WriteLine("Envelope is :" + envelope);
          byte[] formBytes = encoding.GetBytes(envelope);
          _body.Write(formBytes, 0, formBytes.Length);
          _body.Close();
          request.BeginGetResponse(new AsyncCallback(ResponseCallback), request);
      }
  
   private void ResponseCallback(IAsyncResult asyncResult)
      {
          System.Diagnostics.Debug.WriteLine("Async Result is :" + asyncResult);
  
          HttpWebRequest request = (HttpWebRequest)asyncResult.AsyncState;
          HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult);
  
          System.Diagnostics.Debug.WriteLine("Response is :::::::::::::::::::----" + request.EndGetResponse(asyncResult));
  
          if (request != null &amp;&amp; response != null)
          {
              if (response.StatusCode == HttpStatusCode.OK)
              {
                  StreamReader reader = new StreamReader(response.GetResponseStream());
                  string responseString = reader.ReadToEnd();
              }
          }
      }
  </code></pre>
  
  <p>I get the error in <code>HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult);</code> line...</p>
  
  <p>So, Please help me.</p>
  
  <p>Thanks.</p>