Pages

Men

rh

4/02/2013

How can we use web service web service in c# windows application that is developed in visual studio?


1: Create a new c# windows application 

2: Add a web reference using Project > Add Web Reference

3: Enter the URL of the web service that you have generated
A new namespace will be generated with the name of the server and a class called Service1 which derives from :
System.web.services.protocols.soapHttpClientProtocol

4: Add a click event to a button and create a new instance of the proxy class 
eg: localhost.Service1 ws = new localhost.Service1();
then call the method of the proxy class. A SOAP method is sent to the server and the web service is called.

No comments :

Post a Comment