6
Reply

How to expose different methods of a WCF service to different clients? Like, I have 2 methods in a WCF service named as Method1 and Method2, so now how can I restrict 2 different clients in such a way that Client1 can access only Method1 and Client2 can access Method2?

Vishal Rastogi

Vishal Rastogi

7y
2.5k
3
Reply

    1. Simply create two services (interface) each for each client and deploy them on different endpoint. Give different URL to different client.
    2. If you have only one service and want to restrict client to methods, then use Custom Authorization and restrict client.

    The easiest solution would be to separate them into different services for each client. Alternatively, you will require to expose all the methods (OperationContract) then do an authorization check on method level to check whether the client who is accessing has sufficient permission to actually call it or not.

    Hi, Create two different service contracts and end points.Put Method1 in IServiceContract1 and Method2 in IServiceContract2.Create two different endpoints for IServiceContract1 and IServiceContract2.I hope this will be helpful.

    As you must aware Interface is contract (IService) So if you have multiple client . you can have multiple contract for the other client as per there requirement . so just create multiple service interface and implement it in the service class . and create multiple endpoint for each client and give. them..

    As you must aware Interface is contract (IService) So if you have multiple client . you can have multiple contract for the other client as per there reqirement . so just create multiple service interface and implement it in the service class . and create multiple endpoint for each client and give. them..

    As you must aware Interface is contract (IService) So if you have multiple client . you can have multiple contract for the other client as per there reqirement . so just create multiple service interface and implement it in the service class . and create multiple endpoint for each client and give. them..