Vishal Rastogi
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?
By Vishal Rastogi in .NET on Feb 20 2017
  • Dhanik Sahni
    May, 2017 23

    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.

    • 3
  • Kaushal Parik
    Apr, 2017 10

    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.

    • 1
  • Mohammad Ilyas
    Jun, 2017 14

    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.

    • 0
  • Akash Varshney
    Jun, 2017 5

    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..

    • 0
  • Akash Varshney
    Jun, 2017 5

    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..

    • 0
  • Akash Varshney
    Jun, 2017 5

    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..

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS