There is actually a way to do this: You can create your own WSDL (i.e., remove methods that you donβt want to publish) and then make it available in a dedicated place, this allows users to bind to it as usual.
So that users do not just retrieve the default WSDL ( foo.asmx?wsdl ), you need to turn the switch in the web.config of your web service:
<webServices> <protocols> <remove name="Documentation"/> </protocols> </webServices>
In the appropriate MSDN section :
Note Deleting the documentation protocol also disables the generation WSDL file for any XML web services in the web application. This prevents clients from creating a proxy class if a custom WSDL file is created and provided for them.
source share