【问题标题】:Unable to make web request through proxy server无法通过代理服务器发出 Web 请求
【发布时间】:2010-07-16 00:57:39
【问题描述】:

当通过代理服务器发出请求时调用 HttpWebRequest.GetRequestStream 时,我的 sharepoint webpart 引发错误。错误是“无法连接到远程服务器”。客户端的机器(失败的地方)设置为在 IE 设置中使用特定的代理服务器(为您的 LAN 使用代理服务器)。

我是否需要在配置中添加任何代理设置才能使其正常工作?

另外,重现客户场景的最简单方法是什么——如何在我的终端添加代理?

【问题讨论】:

    标签: c# .net security sharepoint proxy


    【解决方案1】:

    您可以尝试在 web.config 中将 autodetect 设置为 false

       <system.net>
          <defaultProxy>
            <proxy autoDetect="false" />
          </defaultProxy>
       </system.net>
    

    【讨论】:

    • 是否还需要将 useDefaultCredentials 设置为 false?
    • 我会尝试两者。我想我通常在代码中将该值设置为 true。
    【解决方案2】:

    查看 Sharepoint 日志以获取详细的错误描述。

    通常可以在这里找到: C:\program files\common files\microsoft shared\web server extensions\12\LOGS\

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多