0

Hi I have a requirement here, I have WCF service which is implementing 2 interfaces, naturally it will generate 2 endpoints in the client config. Now I have to control who can create which endpoint based on some condition like username/password or based on some condition, there should be only 1 endpoint exposed to the client.

I have also tried using custom authentication in the service, but it is not the required solution as the username/pwd can also be sent through the message.

  • It will not generate two endpoints to the client, if you don't expose both of them. Do you have control over the clients? – Jocke Jan 29 '14 at 07:01
  • I agree with Jocke, that it won't "naturally generate" any end points unless you're host you're using a service reference (svc) while developing the client side. But if the requirement is that the host shows two end points, and you want the client side to choose the endpoint based on conditions like the existance of a ID/Password combo, you configure at runtime (based on conditions) which endpoint the client hits. – Brian Jan 29 '14 at 08:33
  • In order to do this, however, you have to create your own generic endpoint that inherits your working interface class and the System.ServiceModel.IClientChannel. Once you've developed this, you can dynamically configure which of 1-to-many endpoints you want to hit. --yes, it's complicated. – Brian Jan 29 '14 at 08:36
  • When you say you have a WCF service implementing 2 interfaces, do you mean something like `Service1 : IInterface1, Interface2` or you do you mean you have two separate services? – Tim Jan 29 '14 at 15:42
  • Tim, I am doing `Service1 : IInterface1, Interface2`. Thing is when I add the service reference, both the interfaces will be exposed, is there a way where I can allow to download only 1 client based on some condition? Consider this scenario, my WCF service is hosted in a server, There are 2 consumers A and B. If consumer A consumes my Service he should get IInterface1 endpoint, If consumer B then IInterface2. I want to control when the metadata gets downloaded. – Pradeep Kumar Jan 30 '14 at 05:55

0 Answers0