We want any calls to our .asmx web service to be made by the client from https. If not, throw an error.
I've setup the following method in my .asmx:
private bool IsSecureConnection()
{
return HttpContext.Current.Request.IsSecureConnection;
}
Question is, do I have to call this in every method and throw or is there a better way to call this, lets say once so that any developer adding methods to this .asmx don't have to worry about calling this check.
Basically I'm looking for some sort of event that I can hook into that when any call is received to this web service, it calls IsSecureConnection and if false, throw an exception.