Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

Share two endpoint

$
0
0

Hi All,

How to share/expose two methods to two different users in wcf.

Service Interface:

interface IArithmeticOperation
{
  [OperationContract]
  decimal AddTwoNemeric(decimal first, decimal second);
  [OperationContract]
  decimal SubtractTwoNemeric(decimal first, decimal second);
}

Service:

class ArithmeticOperation: IArithmeticOperation
{
  public decimal AddTwoNemeric(decimal first, decimal second)
  {
      return (first + second);
  }

  public decimal SubtractTwoNemeric(decimal first, decimal second)
  {
      return (first - second);
  }
}

endpoint: http://localhost:59338/ArithmeticOperation.svc

Above service expose two actions like arithmetic Addition and Subtraction, but my requirement is how I share the endpoint two different clients with access restriction. 

Client A: Only able to access AddTwoNemeric service method

Client B: only able to access SubtractTwoNemeric service method 

Thanks,


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>