WebRequest request = HttpWebRequest.Create("http://localhost:5483/WebService2.asmx");
request.Credentials = CredentialCache.DefaultCredentials;
byte[] bytes;
bytes = System.Text.Encoding.ASCII.GetBytes("ecoId=12246&aiId=1&action=test&comment=test");
//Set HttpWebRequest properties
request.Method = "POST";
request.ContentLength = bytes.Length;
request.ContentType = "text/xml; encoding='utf-8'";
//Sends the HttpWebRequest, and waits for a response.
using (WebResponse response = request.GetResponse())
{
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
string urlText = reader.ReadToEnd();
//Do whatever you need to do
}
}