Click here to Skip to main content
14,300,217 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi
thanks for advance help

in my wcf service i have 10 methods i want to give my client to access 5 methods only.
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

Make those methods "internal".


(30-character minimum made me add this text)
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Bear in mind that you expose methods via a contract. If you do not want people to have access to 5 of those methods, just expose a contract that has the remaining 5 methods and use that instead.

You can have exactly the same code in place implementing the contracts, as long as the two interfaces are similar enough that they satisfy your needs. In other words, as long as the signatures/names of the methods are the same in the two interfaces, the same concrete class can be used.
   
Comments
Kunal Chowdhury «IN» 21-Aug-10 9:17am
   
Reason for my vote of 5
Correct Answer
Nish Nishant 21-Aug-10 10:29am
   
Reason for my vote of 5
Proposed answer.
Rate this:
Please Sign up or sign in to vote.

Solution 3

Hi,

Just to add to Hanlon's explanation....

IExternal
{
//5 methods declaration
}


IInternal
{
//5 Internal methods declaration
}


Service : IExternal,IInternal
{

}



Expose the IExternal....


I hope this helps!.

Regards,
-Vinayak
   
Comments
Nish Nishant 21-Aug-10 10:29am
   
Reason for my vote of 5
Proposed answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100