title: call webservice(asmx) Using POST method
body: <p>hi i want to call my web application's web service from desktop application in c# i have tried this but it gives error internal server error 500.my URL of web service is too long so i need to pass it with POST method.
  what is not right in my code ? any suggestion please.</p>
  
  <pre><code> private void button1_Click(object sender, EventArgs e)
          {
              //HttpWebRequest request = (HttpWebRequest)WebRequest.Create("URL OF Webservice");
              //WebResponse response = request.GetResponse();
              //response.Close();
  
              using (var wb = new WebClient())
              {
  
                  var data = new NameValueCollection();
                  data["authU"] = "value";
                  data["authP"] = "value";
                  data["cmp"] = "value";
                  data["sales_id"] = "value";
                  data["Login"] = "value";
                  data["total_amount"] = "value";
                  data["total_discount"] = "value";
                  data["net_amount"] = "value";
                  data["change"] = "value";
                  data["tax"] = "value";
                  data["ip"] = "value";
                  data["Tran_Type"] = "value";
                  data["mac_id"] = "value";
                  data["ref_id"] = "value";
                  data["venue_id"] = "value";
                  data["store_name"] = "value";
                  data["actual_total_amount"] = "value";
                  data["temp_sale_id"] = "value";
                  data["is_return"] = "value";
                  data["created_date"] = "2018-06-14 14:26:09";
                  data["modify_date"] = "2018-06-14 14:26:09";
                  data["mode"] = "value";
                  data["value"] = "value";
                  data["machine_id"] = "value";
                  data["location_id"] = "value";
                  data["input_amount"] = "value";
                  data["sale_type"] = "value";
                  data["is_table"] = "value";
                  data["Payment_Date"] = "2018-06-14 14:26:09";
                  data["Payment_Amount"] = "value";
                  data["Table_name"] = "value";
                  data["is_close"] = "value";
                  data["values"] = "value";
  
                  var response = wb.UploadValues("http://localhost:53653/POS_WebService.asmx/Sales_Master_Full", "POST", data);
                  string responseInString = Encoding.UTF8.GetString(response);
  </code></pre>