How to Create Proxy Class and Service EndPoint Information and Use It in Client Application

Step 1: Run your wcf service and copy your url

 (In my application it is  http://localhost:5174/MyService/MyService.svc )

Step 2: Open visual studio command promt and write thses commands

 svcutil.exe http://localhost:5174/MyService/MyService.svc?wsdl

Step 3: It create 2 files one config and another is .cs file in VC folder shown in command prompt path .
Step 4: Add this class files in the client application and also add config information to client application configuration file
Step 5: Create object/proxy of service

Mysqervice.MysqerviceClient client=new Mysqervice.MysqerviceClient();

Step 6; Call method of WCF Service

 int result=  client.Add(5,7)
//do  with result as your need.

Step 7: Close the client Proxy

client.Close();

Ebook Download
View all
Learn
View all