how to disable WebService call from other domains

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

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 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.

Method 2

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.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x