Click here to Skip to main content
15,885,126 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi Friends,

i'm New to WCF..i want to know one thing in wcf....
i have 10 methods and i want display/Execute only 3 methods, rest of wouldn't work and future purpose i'm designed ....
Posted

If you don't want to allow all the methods to be called, simply don't publish them. From the calling side point of view the client sees only the methods your interface defines. You can decide what to include in the interface and what is not inlcuded.

If you want to include all of the methods in the interface in the beginning, you can prevent further execution in your code, just return from the method.

There are quite good tutorials about creating WCF services, for example Implementing a Basic Hello World WCF Service (v4.5)[^] or WCF: From a Beginner's perspective & a Tutorial[^]
 
Share this answer
 
Comments
Abhinav S 16-Jan-16 4:12am    
5! Or the user could implement authentication and authorization.
Sergey Alexandrovich Kryukov 16-Jan-16 5:40am    
Makes sense, a 5.
—SA
Wendelius 16-Jan-16 6:10am    
Thanks SA!
Implement authorization in WCF. Authorization will allow access to certain methods to be accessed by some users only.
Try
Chapter 5: Authentication, Authorization, and Identities in WCF[^]
Authentication and Authorization in WCF Services - Part 1[^]
Custom Authentication and Authorization in WCF[^]
 
Share this answer
 
Comments
Wendelius 16-Jan-16 4:19am    
Good point, a 5.
Abhinav S 16-Jan-16 4:20am    
Thanks.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900