views:

1504

answers:

3

I wrote the WCF Service and hosted in windows service. I need to know how to consume this windows service in my client application.


Note:

I wrote Net pipe binding service.


Edit:

How can I write the client application for net pipe binding?

A: 

You can consume it like any other WCF service. The method used for hosting the WCF service is not relevant to the client side.

If you need details on how to actually build the client, let me know and i'll update the post.

Edit : Start here to learn how to build a WCF client.

AlexDrenea
I need to know how to write client application for this.
BALAMURUGAN
Ok, here is a link to get you started : http://msdn.microsoft.com/en-us/library/ms734691.aspx
AlexDrenea
+1  A: 

you need to use ChannelFactory to create a proxy, and then you can use the proxy to perform wcf tasks.

ChannelFactory<IWCFService> pipeFactory = new ChannelFactory<IWCFService>(
                                                  new NetNamedPipeBinding(), 
                                                  new EndpointAddress("net.pipe://localhost/PipeWCFService"));

IWCFService pipeProxy = pipeFactory.CreateChannel();
pipeProxy.RunWCFServiceMethod();}

http://www.switchonthecode.com/tutorials/wcf-tutorial-basic-interprocess-communication

wschenkai
+1  A: 

You need to do a few easy steps:

  • start your Windows service hosting your WCF service
  • from within Visual Studio (2008 or higher), right-click on a project node in the solution explorer and choose "Add service reference"
  • enter the URL where your service can be reached

That's about all there is, really. Visual Studio will go to your running service, get all the metadata it needs (assuming you've enabled a MEX endpoint for metadata exchange), and will create a client proxy class for you to use to connect your client to your service.

Marc

marc_s