Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis 503 HTTP请求错误-内部消息_Iis_Sharepoint 2010 - Fatal编程技术网

Iis 503 HTTP请求错误-内部消息

Iis 503 HTTP请求错误-内部消息,iis,sharepoint-2010,Iis,Sharepoint 2010,我正在向SharePoint服务器(从SharePoint网页)发送HTTP请求,以读取同一服务器(SharePoint库中)上的文档。我收到503错误,文档未加载 如何在IIS上捕获此错误消息以获取有关此异常的更多信息(详细信息或内部消息)?这是一个普遍的错误,我认为只有获得更多的细节才是有益的。谢谢 try{ //try to read } catch(Exception er) { lblError.Text = "Details:"+er.Message; } 这是修复此问题的

我正在向SharePoint服务器(从SharePoint网页)发送HTTP请求,以读取同一服务器(SharePoint库中)上的文档。我收到503错误,文档未加载

如何在IIS上捕获此错误消息以获取有关此异常的更多信息(详细信息或内部消息)?这是一个普遍的错误,我认为只有获得更多的细节才是有益的。谢谢

try{ 
//try to read
} 
catch(Exception er)
{
 lblError.Text = "Details:"+er.Message;
}

这是修复此问题的代码:

var uri = "mysite.com";
var request = WebRequest.Create(uri);
request.Credentials = CredentialCache.DefaultCredentials;
request.PreAuthenticate = true;
request.Proxy = null;
HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse();

代理必须设置为空

已尝试过。内部异常为空。只有503,没有其他详细信息。有一种方法可以直接在IIS上捕获和记录服务器错误(如503),但找不到它的确切位置。这就像过滤这样的消息或其他东西。修复。代理是个问题。为了禁用它,我使用了“request.Proxy=null;”我知道它很晚了,但如果您修复了它,如果您添加为您修复的内容作为答案并接受这一点将非常好,这将对将来可能遇到此问题的任何人都有帮助:)