无法从 Web Portal 将大小为 27 MB 的文件上传到 MS CRM

Unable to upload the file of size 27 MB to MS CRM from Web Portal

我们正在尝试从门户网站将大小为 27 MB 的文件上传到 CRM 2015。但是我们收到以下错误消息。但可以从 CRM 上传相同的文件。我们也可以从门户网站上传大小为 15 MB 的文件。

"There was no endpoint listening at http://MyServer/MyOrg/XRMServices/2011/Organization.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."

启用 CRM 跟踪后,下面是我捕获的错误消息。

"[2017-01-05 18:56:15.309] Process:Microsoft.Crm.Sandbox.WorkerProcess |组织:00000000-0000-0000-0000-000000000000 |主题:1 |类别:沙箱 |用户:00000000-0000-0000-0000-000000000000 |级别:错误 |ReqId:00000000-0000-0000-0000-000000000000 | SandboxWorkerMain.Main ilOffset = 0x23E
>已将 worker 的 MinIOThreads 从 1 更改为 101,并将 MinWorkerThreads 从 1 更改为 101

如果您对此问题有任何解决方案,我们将不胜感激。

[已编辑] 下面是一段代码,用于创建带有门户附件的笔记。

    public IOrganizationService ServiceProxy { get { return _ServiceProxy; } }

    public void Create(Entity newEntity, Guid? impersonateUserId = null, bool detectDuplicates = true)
    {
        setServiceCredentials(impersonateUserId);
        Guid newId = ServiceProxy.Create(newEntity);
        newEntity.Id = newId;            
    }

    public Guid CreateNote(Guid objectId, string fileName, byte[] documentData, string mimeType = "application\ms-word"
        , string subject = "", string notetext = "", LookupValue ownerId = null )
    {
        string encodedData = System.Convert.ToBase64String(documentData);
        Entity annotation = new Entity("annotation");
        annotation["objectid"] = new EntityReference(GetEntityName(), objectId);
        annotation["subject"] = subject;
        annotation["notetext"] = notetext;
        annotation["documentbody"] = encodedData;
        annotation["filename"] = fileName;
        annotation["mimetype"] = mimeType;
        if(ownerId != null)
            annotation["ownerid"] = new EntityReference(ownerId.LogicalName, ownerId.Id);
        Context.Create(annotation);
        return annotation.Id;
    }

您使用以下设置增加它,最大可能大小为 32MB(我认为)

Settings->Administration->System settings-> EMail Tab >> set file size limit for attachments

此问题已通过以下解决方案解决。您也可以参考 this link.

我的解决方案是26MB,我用feedler看到发送的内容接近46MB(因​​为它涉及SOAP请求,Base64等)。

我将 httpRuntime 中的 CRM webconfig 属性 maxRequestLength 更改为 100000000(100MB,因为我的解决方案仍在增长)并且还在 CRM 网站的 IIS 中的请求过滤中更改了 maxAllowedContentLength