0

i want to avoid the others to access my webservice.

I have Web Service called WebService.asmx, which is hosted in www.xyz.com and we know that we can access the service like http://www.xyz.com/WebService.asmx

  1. How to avoid Listing all the Functions
  2. Other should not Add as " Web Reference and they should call my web service functions "

please help me to solved these issues, my project is running and i want to avoid this issues...

advance thanks

  • possible duplicate of [Is there a way to restrict access to an ASMX Webservice, i.e. the asmx page and its WSDL?](http://stackoverflow.com/questions/1400198/is-there-a-way-to-restrict-access-to-an-asmx-webservice-i-e-the-asmx-page-and) – Ehsan Dec 31 '13 at 06:55
  • Thanks, Peter J your simple trick is helped lot... I used Cookies concept.... this is really awesome.... Set Cookies Before Call & Remove after that.... – Saheel Ahmed Dec 31 '13 at 07:52

2 Answers2

1

One way of doing this is to authenticate all your requests to your methods and reject the calls that are not authenticated. A very detailed answer is given here.

Community
  • 1
  • 1
Ehsan
  • 31,833
  • 6
  • 56
  • 65
0

Web Services can be checked form the firewall where request is coming. It can checked by the content-type of the response. All webservices have "application/soap-xml" as content-type.

Saurabh
  • 5,661
  • 2
  • 26
  • 32