How to consume a WCF service?

Posted by Intelmayur under WCF on 8/30/2012 | Points: 10 | Views : 1196 | Status : [Member] | Replies : 1

I have an endpoint URL of a WCF service and I need to consume this service in a windows or console application? I used to consume web services using HttpWebRequest class. Is it possible to consume a WCF service in the same way? I am new to WCF, any help is welcome.

Thank You!


Posted by: Sourabh07 on: 10/14/2012 [Member] Starter | Points: 25

For adding a WCF service in Dot net just have to do is to right click on the name of the project listed in the solution explorer window and click on the Add Service Reference then the new pop up window will be displayed and asking for an Address and NameSpace, then Add your end point URL of your Web Service in address bar and give the name space accordingly for consuming the methods used as contracts in the WCF service. Also, you can check your URL end point of your Web Service is correct or not by click on the GO button shown next to the Address bar. After this, all the methods used as contracts will be listed which are having public access to the Application. In the end, click on the OK button to consume the WCF service into the application provided Web Service should be at running mode in whole process.


Intelmayur, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response