小编Car*_*ter的帖子

SharePoint错误:服务器不允许大于2097152字节的邮件

我有指向sharepoint 2013 Office 365的Web服务.我使用客户端对象模型.我正在尝试更新存储4个附件的xml文件.当我在xml文件中有大量二进制数据时执行此操作时,出现以下错误:

信息

请求消息太大了.服务器不允许大于2097152字节的消息.

我意识到我可能不得不分离xml文件中的附件,但目前我的infopath表单将它们存储在那里.有没有办法可以增加请求长度或者可以节省大量的东西.我真的只是修改一个节点,除非我更新xml,否则它将无法工作.谢谢 .代码如下.

我的代码:

ListItem docReq = GetDocRequestLight(docRequestID, businessID);
string fPath = (string)docReq["FileRef"];
using (FileInformation fInfo = Microsoft.SharePoint.Client.File.OpenBinaryDirect(ctx, fPath))
{
    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.Load(fInfo.Stream);
    XmlNamespaceManager xmlNameSpaceMgr = new XmlNamespaceManager(xmlDoc.NameTable);
    xmlNameSpaceMgr.AddNamespace("my", DocReqXmlNameSpace);

    // Get Parent Node
    XmlNode node = xmlDoc.SelectSingleNode(GetXPathFromItemKey(velmaKey), xmlNameSpaceMgr);

    DateTime outDate;
    bool outBool;
    if (DateTime.TryParse(newValue, out outDate))
        node.InnerText = outDate.ToString("yyyy-MM-dd");
    if (Boolean.TryParse(newValue, out outBool))
        node.InnerText = newValue;

    // Update Statuses
    XmlNode statusIDNode = xmlDoc.SelectSingleNode(DocReqStatusIDFieldXPath, xmlNameSpaceMgr);
    statusIDNode.InnerText = updatedStatus.ID.ToString();
    XmlNode statusNode = xmlDoc.SelectSingleNode(DocReqStatusFieldXPath, …
Run Code Online (Sandbox Code Playgroud)

sharepoint sharepoint-2013 csom

12
推荐指数
4
解决办法
1万
查看次数

标签 统计

csom ×1

sharepoint ×1

sharepoint-2013 ×1