How to consume WCF service in client Application ?

Posted by Mangesh.Barmate under WCF on 2/6/2013 | Points: 10 | Views : 2332 | Status : [Member] | Replies : 3
Hi,

I have created WCF service Library which gives me default Interface and service method and App.config.

I have after created testClient Application which is console. with the help of SVCUTIL.exe in command prompt i have created proxy for WCF class library.

after running svcutil.exe out\ config.......

i got proxygeneraion.cs and app.config file.

now i want to consume methods available in WCF, how i consume WCF methods.

i am not getting how to access WCF methods in client.

i am not having namespace and class name here,from where i am getting these!!

Approaches are welcome!!!

Thanks.




Responses

Posted by: Kundan64 on: 2/6/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Mangesh.Barmate,
Add the proxygeneraion.cs and config file in your project. Now import the WCF's NameSpace in your Consuming project. and then Create th CLIENT for wcf client. and use the Methods of wcf.


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

Posted by: Mangesh.Barmate on: 2/6/2013 [Member] Starter | Points: 25

Up
0
Down
I do agree with your below statement,bu how in codewise ? can u give me sample code ?
Now import the WCF's NameSpace in your Consuming project. and then Create th CLIENT for wcf client. and use the Methods of wcf.


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

Posted by: Kundan64 on: 2/7/2013 [Member] Starter | Points: 25

Up
0
Down
Add the Service Reference in you Project by Right Click on 'Service Reference'. Then in your page write "
using yourprojectname..ServiceReference1;
"
then write:
Service1Client _client = new Service1Client();

_client.YourMethodName();


I hope it will help you.


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

Login to post response