I couldn't think of a decent title, so let me first apologize for that.
I have a WebService (call it A) written for my app so I can take advantage of ASP.NET 3.5 AJAX features. I use the generated JavaScript proxy to make AJAX calls.
As a side effect, WebService A is exposed for anyone to add as a reference to another project, which is great, except I don't want certain WebMethods to be available to external applications (in the same domain, BTW).
So I've got two questions:
- Is there a way to control the exposure of WebMethods in WebService A?
If there isn't, I'm thinking I'll just add a separate WebService (B) that exposes the WebMethods I need from WebService A. But then,
- How can I prevent other applications from referencing WebService A while still allowing the application it originates in to access it?
If that's not possible, I'm not really worried about it. The apps are all intranet-only, I just don't want the WebServices to be abused.
Also, there is a similar question here already without any good anwers. The asker describes almost the same situation I'm in: http://stackoverflow.com/questions/1909484/asp-net-webservice-deny-remote-access