1

当我尝试更新 CmisObject 时,DotCMIS.dll CmisRuntimeException Unauthorized 中发生了“DotCMIS.Exceptions.CmisRuntimeException”类型的第一次机会异常。这是我的代码,谁能帮忙。

        IOperationContext oc = session.CreateOperationContext();
        oc.CacheEnabled = false;
        oc.FilterString = "cmis:name, cmis:objectId, cmis:objectTypeId";
        ICmisObject doc = session.GetObject(curProj.SharePointId, oc);
        if (doc != null)
        {
            try
            {

                String fileName = curProj.ProjectFilePath.Substring(curProj.ProjectFilePath.LastIndexOf('\\') + 1);
                IDictionary<String, Object> properties = new Dictionary<String, Object>();
                properties.Add(PropertyIds.Name, fileName);

                ICmisObject objectId = doc.UpdateProperties(properties);
            }
            catch (DotCMIS.Exceptions.CmisRuntimeException re)
            {
                System.Console.WriteLine("CmisRuntimeException " + re.Message);
            }
            catch (DotCMIS.Exceptions.CmisConstraintException cce)
            {
                System.Console.WriteLine("CmisConstraintException " + cce.Message + " " + doc.GetPropertyValue(PropertyIds.ObjectId));
            }
       }
4

0 回答 0