Thursday, September 23, 2010

Using Web service in C Sharp

Step 1: Creating a proxy
Goto visual studio command prompt. Type wsdl url
for example:
C:\Program Files\Microsoft Visual Studio 10.0\VC>cd c:\
c:\>wsdl http://www50.brinkster.com/vbfacileinpt/np.asmx?wsdl


Step2: Create an windows Application
copy the .cs file (here for example PrimeNumbers.cs) file from c:\ and paste into windows application folder. In visual studio right click on PrimeNumbers.cs and include in project
Step3: Goto project Add reference->.NET tab->system.web.services

Step4: create a namespace.
Ex: open PrimeNumbers.cs file and namspace Myprime{ enclosed by body of code ... }

Step5: create an object.
Ex: Myprime.PrimeNumbers p=new Myprime.PrimeNumbers();

Step6: now call the method in your application using object
Ex : p.GetPrimeNumbers(); it will return string containing prime numbers.

Step7: Run the windows application.

You can able to find lot of webservices at


Click here to download project files
Click here to see demo