通过 CMIS (dotCMIS) 连接到 SP2010:异常未授权

本文关键字:SP2010 异常 授权 连接 CMIS dotCMIS 通过 | 更新日期: 2023-09-27 18:36:28

我使用dotCMIS,并希望简单地连接到我的SP2010服务器。我试图用 C# 做到这一点,就像这里 http://chemistry.apache.org/dotnet/getting-started-with-dotcmis.html 第一部分中

一样

所以我有这样的东西:

    Dictionary<string, string> parameters = new Dictionary<string, string>();
    parameters[SessionParameter.BindingType] = BindingType.AtomPub;
    parameters[SessionParameter.AtomPubUrl] = "http://mysharepoint";
    parameters[SessionParameter.User] = "SPAdmin";
    parameters[SessionParameter.Password] = "1234sharepoint";
    SessionFactory factory = SessionFactory.NewInstance();
    ISession session = factory.GetRepositories(parameters)[0].CreateSession(); //exception unathorized

但我总是得到例外:DotCMIS.Expcetions.CmisRunterimException: Unathorised

有什么想法吗?通过浏览器,我可以使用相同的用户/通行证登录该站点,因此这可能不是问题。起初,我因为 NTLM 问题 (https://issues.apache.org/jira/browse/CMIS-531) 而坚持它,但即使我使用 parameters[SessionParameter.AuthenticationProviderClass] = "DotCMIS.Binding.NtlmAuthenticationProvider"; 也是同样的例外。嗯...这个例外并没有真正帮助我。我希望我能得到更多信息 - 也许有更好的方法?我还能尝试什么?谢谢!

PS:是的,在我开始使用dotCMIS之前,我确实安装和配置了MS CMIS连接器:http://technet.microsoft.com/en-us/library/ff934619.aspx

通过 CMIS (dotCMIS) 连接到 SP2010:异常未授权

你的AtomPubUrl看起来很可疑。我无法判断这是您添加的占位符以掩盖真实 URL,还是您正在使用的实际 URL。如果它是实际的URL,则看起来缺少AtomPub服务文档的路径。要判断是否是这种情况,您应该能够调用URL,登录并获取一堆XML,这是CMIS服务描述符。相反,如果您得到的是一个充满 HTML 的面向用户的页面,那么您使用的是错误的 URL。

例如,在Alfresco中,用户登录到/share,但AtomPub绑定位于/alfresco/cmisatom。

是的,AtomPubUrl 是错误的。

对于 sharepoint,仅将默认的 sp url ( http://mysharepoint ) 或 url 发布到 cmis lib ( http://mysharepoint/cmis ) 是不够的我需要指向存储库 ID,不知何故,CMIS 的 sp 端点是:

http://mysharepoint/_vti_bin/<myLib4CMIS>/<repID>?getRepositoryInfo

http://technet.microsoft.com/en-us/library/ff934619.aspx

不知何故,它令人困惑,但它的工作:)dotCMIS真的很好。