我正在写一个WebService,并想找出客户用来调用我的WebMethod的URL。如何在使用asp.net的webservice中获取请求的url?
Ok..i将详细解释一下..
假设我有一个web服务(HTTP://myWebservice/HashGenerator/HashValidator.asmx) 如下
[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
}
请给我一个解决方案。
请给更多的细节。 “获取请求的网址”是什么意思?你只是想下载内容? – 2010-11-24 08:34:53
我认为他正在编写一个WebService,并想找出客户用来调用他的WebMethod的URL。 – Turrau 2010-11-24 08:38:16
好的,那么Darin是对的:除非您将它作为参数传递给您的Web方法或某个自定义HTTP标头,否则无法执行此操作。 – Turrau 2010-11-24 09:39:53