Last post Apr 24, 2018 02:21 AM by Edward Z
Apr 23, 2018 03:12 AM|jayakumarvinayagam|LINK
How to share/expose two methods to two different users in wcf.
decimal AddTwoNemeric(decimal first, decimal second);
decimal SubtractTwoNemeric(decimal first, decimal second);
class ArithmeticOperation: IArithmeticOperation
public decimal AddTwoNemeric(decimal first, decimal second)
return (first + second);
public decimal SubtractTwoNemeric(decimal first, decimal second)
return (first - second);
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
Apr 23, 2018 12:17 PM|rajesh93180|LINK
I would suggest to create two separate web services one for each client and provide corresponding url, since it is not possible to provide methods access to different users. If we don't want user to consume a particulat web method, we can jus remote [OperationContract]
attribute in the interface. Doing this, no user will have access to that method.
This link below has a solution for your problem. Please check
How to restrict methods in WCF service based on client
Apr 24, 2018 01:34 AM|DA924|LINK
A single service can host multiple endpoints.
Apr 24, 2018 02:21 AM|Edward Z|LINK
>> my requirement is how I share the endpoint two different clients with access restriction.
In general, we try WCF Security to limit the access. While client try to access the service, check whether they have the permission.
If you do not want to use wcf security, I suggest you try WCF Extension to control the wsdl.
# WCF Extensibility – WSDL Export Extension