I am simply looking for an example of an ASP.NET Web Application (in C#) that consumes a published HTTP-GET web service.
Seems like it should be an easy thing to find online, but I have yet to come across one.
I am simply looking for an example of an ASP.NET Web Application (in C#) that consumes a published HTTP-GET web service.
Seems like it should be an easy thing to find online, but I have yet to come across one.
Right-click your project in Visual Studio 2010 and select the option "Add Web-Reference...".
In the "Add Web Reference" dialog, type the URL of the web-service, for example http://www.startvbdotnet.com/web/sample2.asmx, and a "Web reference name", for example "com.startvbdotnet.www".
A lot of code will be generated on your project. The "Web reference name" will be the name of the generated namespace.
The classes of that namespace will work like "normal" classes, but behind the scenes the method calls will be web-service calls.
com.startvbdotnet.www.Sample teste = new com.startvbdotnet.www.Sample();
int result = teste.Add(1, 2);