Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.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
Sharepoint 2010 Sharepoint客户端模型-请求超时_Sharepoint 2010_Sharepoint Clientobject - Fatal编程技术网

Sharepoint 2010 Sharepoint客户端模型-请求超时

Sharepoint 2010 Sharepoint客户端模型-请求超时,sharepoint-2010,sharepoint-clientobject,Sharepoint 2010,Sharepoint Clientobject,我从Sharepoint客户端托管对象模型接收到超时 Microsoft.SharePoint.Client.ServerException: The operation has timed out. 基本上,我批量处理100个更新并一次性发送它们。这对我来说是没有问题的,如果需要时间,但我真的想避免超时异常 我已经尝试过无数种方法来增加客户端上下文中的超时时间,但都没有成功。我使用反射来尝试识别sharepoint在调用客户端上下文的executequery方法时正在做什么。sharepoi

我从Sharepoint客户端托管对象模型接收到超时

Microsoft.SharePoint.Client.ServerException: The operation has timed out.
基本上,我批量处理100个更新并一次性发送它们。这对我来说是没有问题的,如果需要时间,但我真的想避免超时异常

我已经尝试过无数种方法来增加客户端上下文中的超时时间,但都没有成功。我使用反射来尝试识别sharepoint在调用客户端上下文的executequery方法时正在做什么。sharepoint基本上是创建并发送HttpWebRequest

我以以下代码结束,但仍然没有成功:

 public static void SetInfinteTimeout(this ClientContext ctx)
{
    int timeout = 10 * 60 * 1000;
    ctx.RequestTimeout = timeout;
    ctx.PendingRequest.RequestExecutor.RequestKeepAlive = false;            
    ctx.PendingRequest.RequestExecutor.WebRequest.KeepAlive = false;
    ctx.PendingRequest.RequestExecutor.WebRequest.Timeout = timeout;
    ctx.PendingRequest.RequestExecutor.WebRequest.ReadWriteTimeout = timeout;            
    System.Net.ServicePointManager.DefaultConnectionLimit = 200;
    System.Net.ServicePointManager.MaxServicePointIdleTime = 2000;
    System.Net.ServicePointManager.MaxServicePoints = 1000;
    System.Net.ServicePointManager.SetTcpKeepAlive(false, 0, 0); 
    ServicePointManager.DnsRefreshTimeout = timeout; // 10 minutes       

}
但我仍然收到超时错误!
还有什么我遗漏的吗


任何帮助都将不胜感激。

您试过了吗

  • 保持默认的KeepAlive(true)
  • 禁用超时和
  • 保留默认的MaxServicePointIdleTime值(默认值为100秒) 默认设置,但设置为2)
正如:

public static void SetInfiniteTimeout(this ClientContext ctx)
{
    ctx.RequestTimeout = -1;  //ctx.RequestTimeout or System.Threading.Timeout.Infinite;
}
另外,在当前配置中,获得超时错误需要多少秒

你试过了吗

  • 保持默认的KeepAlive(true)
  • 禁用超时和
  • 保留默认的MaxServicePointIdleTime值(默认值为100秒) 默认设置,但设置为2)
正如:

public static void SetInfiniteTimeout(this ClientContext ctx)
{
    ctx.RequestTimeout = -1;  //ctx.RequestTimeout or System.Threading.Timeout.Infinite;
}

另外,在当前配置中,获得超时错误需要多少秒

解决方案是使用clientcallablesettings(SPWebApplication.clientcallablesettings):


这具有执行超时属性和其他相关设置。

解决方案是使用clientcallablesettings(SPWebApplication.clientcallablesettings):


这有一个执行超时属性和其他相关设置。

您好-感谢您的回复。是的,我已经尝试了所有的超时设置。1.5分钟后超时。最后,通过使用客户端可调用设置解决了这个问题。再次感谢+谢谢你的回复。是的,我已经尝试了所有的超时设置。1.5分钟后超时。最后,通过使用客户端可调用设置解决了这个问题。再次感谢+1作为输入。好的,但是如何获得SPWebApplication?最好的解决方案是使用服务器对象模型,而不是客户端对象模型。使用服务器对象模型,您将不会遇到这些问题,也不需要调整/更改SP设置,您将避免很多麻烦。@JosephCaruana您可以发布您的解决方案吗,你对ClientCallable设置做了什么?你在答案中的链接只包含了propertyOK的声明,但是如何获得SPWebApplication?最好的解决方案是使用服务器对象模型而不是客户端对象模型。使用服务器对象模型,您将不会遇到这些问题,也不需要调整/更改SP设置,这样您将避免很多头痛。@JosephCaruana您可以发布您的解决方案吗,你对ClientCallable设置做了什么?答案中的链接只有属性声明