无法在asp.net web服务[WebMethod]中使用HTTP GET

无法在asp.net web服务[WebMethod]中使用HTTP GET,asp.net,web-services,Asp.net,Web Services,在asp.Net web服务中,通过.Net中的HttpWebRequest使用HTTP GET/POST时遇到问题 有人能帮个忙吗?这里有什么问题吗。 同样的代码在Windows窗体/控制台应用程序中也可以正常工作 [WebMethod] public string someWebMethod() { HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://www.go

在asp.Net web服务中,通过.Net中的HttpWebRequest使用HTTP GET/POST时遇到问题 有人能帮个忙吗?这里有什么问题吗。 同样的代码在Windows窗体/控制台应用程序中也可以正常工作

    [WebMethod]
    public string someWebMethod()
    {
        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://www.google.com");
        WebResponse resp = request.GetResponse(); <---------This is hanging... any idea how to work around?
         .......

    }
[WebMethod]
公共字符串someWebMethod()
{
HttpWebRequest请求=(HttpWebRequest)HttpWebRequest.Create(“http://www.google.com");

WebResponse resp=request.GetResponse();这是我通过显式指定默认代理使其工作的方式

[WebMethod]
     public string someWebMethod()
     {
           HttpWebRequest request =(HttpWebRequest) HttpWebRequest.Create(@"http://www.google.com");
           request.Proxy = new WebProxy("10.168.0.17", 8080);
      }