how to pass paramters in an httprequest
-
Hi, I have created a webservice and on the client side i want to access it using Httprequest and httpresponse classes. There are two methods in that webservice.1 method returns a string.the 2nd method requires two integers as input parameters.how do i pass these parameters in the request from the client. call to Merthod1 from client:
HttpWebRequest myreq = (HttpWebRequest)WebRequest.Create("http://localhost:2054/my\_ws/MY\_WebService.asmx/HelloWorld");
myreq.Method = "POST";
myreq.ContentType = "application/x-www-form-urlencoded";call to method2 from client:
HttpWebRequest myreq = (HttpWebRequest)WebRequest.Create("http://localhost:2054/my\_ws/MY\_WebService.asmx/Add");
myreq.Method = "POST";
myreq.ContentType = "application/x-www-form-urlencoded";server side for method2:
\[WebMethod\] public int Add(int a, int b) { return (a + b); }
-
Hi, I have created a webservice and on the client side i want to access it using Httprequest and httpresponse classes. There are two methods in that webservice.1 method returns a string.the 2nd method requires two integers as input parameters.how do i pass these parameters in the request from the client. call to Merthod1 from client:
HttpWebRequest myreq = (HttpWebRequest)WebRequest.Create("http://localhost:2054/my\_ws/MY\_WebService.asmx/HelloWorld");
myreq.Method = "POST";
myreq.ContentType = "application/x-www-form-urlencoded";call to method2 from client:
HttpWebRequest myreq = (HttpWebRequest)WebRequest.Create("http://localhost:2054/my\_ws/MY\_WebService.asmx/Add");
myreq.Method = "POST";
myreq.ContentType = "application/x-www-form-urlencoded";server side for method2:
\[WebMethod\] public int Add(int a, int b) { return (a + b); }
-
What is the reason, that causes you to not insert a Web Reference to your Client Project?
Der Staat mit der niedrigsten Geburtenrate ist nicht die Bundesrepublik, sondern der Vatikan.