Expose a WCF Service through a Named Pipes binding
Asked Answered
S

2

11

Intro:

I successfully implemented a WCF Service hosted in a Windows Service a few days ago. The community here at StackOverflow helped me with the WSDL exposure here. I thank you once again. However recently I found out that there is another potential client for this service this time located on the same machine as the service and this lead me to think I should add another endpoint with the namedPipesBinding.

Named pipes seem to be the best solution for intra-machine communication as far as I am concerned. Please correct me if this is wrong.

Problem:

I need to expose another endpoint for the same service/contract but this time using a netNamedPipeBinding. However I really don't understand how do I can then add a service reference from a client. Foolishly after adding

<endpoint address="net.pipe://localhost/OfficeService"
          binding="netNamedPipeBinding"
          contract="netBridge.Development.OfficeService.IWordService"
          bindingConfiguration="localBinding" />

I have tried to add a service reference in a Windows Forms Application located on the same machine typing the net.pipe://.... url. It didn't work. I must mention I have removed the mex (MetaData Exchange) endpoint earlier because I considered it not necessary.

  1. Is this mex endpoint necessary for named pipes endpoint binding discovery?
  2. How should I add a service reference in the client app to the named pipe endpoint?
Skye answered 8/10, 2008 at 20:58 Comment(0)
S
13

Your endpoint looks fine, although I'm curious about what's in localBinding...

Sounds like the easiest option is to just change the endpoint configuration on the named pipes client to match your service endpoint. The client shouldn't care as long as it's the only endpoint in the clients config file. Otherwise you'll have to add names to your endpoints and have the client pick a specific one when you new-up the proxy object.

Good luck!

Spiny answered 8/10, 2008 at 21:27 Comment(2)
@James Bender : I will look tomorrow (01:11 AM here) at the config in the production environment and I will try to use the mex endpoint for discovery/add service reference. I will post further information about the config file and others. Thanks for the support ;)Scholasticism
No problem. I would still use SVCUTIL to generate your deployment proxies. I've had .... "unpredictable" results with "Add Service Reference..." It's on my blog if you want to take a look (www.jamescbender.com)Spiny
C
6

the mex endpoint is necessary during development as it provides an http location where the wsdl is built. the wsdl describes to the client how to communicate with the server through named pipes, or TCP/IP, or anything else. once the client app has built the proxy to the named pipes binding and set up the configuration, the mex endpoint is no longer necessary. hence, the mex endpoint can be removed prior to deployment through the environments if desired.

Cleanthes answered 19/6, 2009 at 12:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.