title: C# ASP.Net : How to call a web service in .NET 4.0 C# without using the WSDL or proxy classes
body: <p>I have to send some  XML DATA to web service via POST Command , I have no information about the webserice or anything at all , i only know that i need to send a XMLstream to it , i know the server IP adress and the port , the XML tree of the parameters. and that all , I am a bet lost on how to consumme this web service and get the response . I've never worked with Web services so please understand if my code have some major errors and kindly guide me :</p>
  
  <pre><code>public  void Execute()
      {
          HttpWebRequest request = CreateWebRequest();
          XmlDocument soapEnvelopeXml = new XmlDocument();
          soapEnvelopeXml.LoadXml(@"&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;
          &lt;soap:Envelope              xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""  xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt;
  
           &lt;soap:Body&gt; 
  
                      &lt;mergeprofiles xmlns=""http://127.0.0.1:90""&gt;
                      &lt;Profile&gt;
                      &lt;Member&gt;278615&lt;/Member&gt;
                      &lt;ExtRef&gt;003D000001StY68IAF&lt;/ExtRef&gt;zs 
                      &lt;Name&gt;LESCA&lt;/Name&gt;
                      &lt;ChangedBy&gt;user&lt;/ChangedBy&gt;
                      &lt;FirstName&gt;Paolo&lt;/FirstName&gt;
                      &lt;Street1&gt;via magnanina 3947&lt;/Street1&gt;
                       &lt;Street2&gt;&lt;/Street2&gt;
                      &lt;Street3&gt;&lt;/Street3&gt;
                      &lt;City&gt;VIGEVANO&lt;/City&gt;
                      &lt;ZIP&gt;27029&lt;/ZIP&gt;
                      &lt;EMail&gt;test@test.it&lt;/EMail&gt;
                      &lt;Phone&gt;&lt;/Phone&gt;
                      &lt;MobilePhone&gt;+39331231233&lt;/MobilePhone&gt;
                      &lt;Fax&gt;&lt;/Fax&gt;
                      &lt;ISOLanguage&gt;en&lt;/ISOLanguage&gt;
                      &lt;Salut1&gt;Mr&lt;/Salut1&gt;
                      &lt;Homepage&gt;&lt;/Homepage&gt;
                      &lt;VATNo1&gt;0&lt;/VATNo1&gt;
                      &lt;/Profile&gt;
                      &lt;EndOfMessage&gt;@@@&lt;/EndOfMessage&gt;
                      &lt;/mergeprofiles&gt;
  
  &lt;/soap:Body&gt;
  
  &lt;/soap:Envelope&gt;");
  
  
  using (Stream stream = request.GetRequestStream())
          {
              soapEnvelopeXml.Save(stream);
          }
  
          using (WebResponse response = request.GetResponse())
          {
              using (StreamReader rd = new StreamReader(response.GetResponseStream()))
              {
                  string soapResult = rd.ReadToEnd();
                  Console.WriteLine(soapResult);
              }
          }
      }
      /// &lt;summary&gt;
      /// Create a soap webrequest to [Url]
      /// &lt;/summary&gt;
      /// &lt;returns&gt;&lt;/returns&gt;
      public HttpWebRequest CreateWebRequest()
      {
          HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(@"http://127.0.0.1:90/");
          webRequest.Headers.Add(@"SOAP:Action");
          webRequest.ContentType = "text/xml;charset=\"utf-8\"";
          webRequest.Accept = "text/xml";
          webRequest.Method = "POST";
          return webRequest;
      }
  </code></pre>
  
  <p>The problem is when ever I call the method <code>Execute</code> in <code>page_load</code>, it runs and runs and never stops. The web service is working when I call using other methods, I don't know how or why is that happening, can you please help ?</p>