I am writing a WebService and wants to find out the URL the client used to call my WebMethod.
Ok..i will explain it in detail..
Suppose i have a webservice (http://myWebservice/HashGenerator/HashValidator.asmx) as follows
[WebMethod]
public string ValidateCode(string sCode)
{
//need to check requested url here.The call will be coming from different sites
//For example www.abc.com/accesscode.aspx
}
please send me a solution for this.
You need this:
[WebMethod]
public static string mywebmethod()
{
string parameters = HttpContext.Current.Request.UrlReferrer.PathAndQuery.ToString();
return parameters
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With