【问题标题】:SharePoint document library versioning and require check out settings using web servicesSharePoint 文档库版本控制和需要使用 Web 服务的签出设置
【发布时间】:2009-10-14 02:20:53
【问题描述】:

我需要有关 SharePoint 文档库的信息。即,我需要版本控制是打开还是关闭以及是否选择了“需要签出”选项的信息。我必须使用 SharePoint Web 服务。

我在 Versions.asmx、Lists.asmx 和 SiteData.asmx 中进行了查找,但没有找到适合我需要的方法或属性。

有人可以帮帮我吗?谢谢。

【问题讨论】:

    标签: sharepoint versioning


    【解决方案1】:

    您将需要使用 lists.asmx GetList 方法。它返回有关列表的所有元数据。

    这是我一直在结合 Linq to XML 使用的一些代码:

        Private _serviceRefrence As SharePointListsService.ListsSoapClient
        Dim endPoint As New ServiceModel.EndpointAddress(_serviceURL)
        Dim ListID as Guid = New Guid("<<Your List Guid>>") 
    
        _serviceRefrence = New SharePointListsService.ListsSoapClient("ListsSoap", endPoint)
        _serviceRefrence.ClientCredentials.Windows.ClientCredential = Credentials
        _serviceRefrence.ClientCredentials.Windows.AllowedImpersonationLevel = Security.Principal.TokenImpersonationLevel.Impersonation
    
        Dim results As XmlElement = _serviceRefrence.GetList(listID.ToString())
        Dim parserResults As XDocument = XDocument.Parse(results.OuterXml)
    
        Dim listinfo = (From list In parserResults.Descendants(XName.Get("List", "http://schemas.microsoft.com/sharepoint/soap/")) _
                        Select New With {.RequireCheckout = list.Attribute("RequireCheckout").Value, _
                                     .ModerationEnabled = list.Attribute("EnableModeration").Value, _
                                     .VersioningEnabled = list.Attribute("EnableVersioning")}).Single()
    

    希望这会有所帮助!

    【讨论】:

    • 克里斯,谢谢你的回复。有什么办法可以将其转换为 C#?我不懂VB的语法。感谢您的帮助。
    • 很遗憾,我在 C# 中没有大量使用 Linq to XML,所以我需要一些时间来弄清楚如何转换它。基本上,当您看到 Dim 时,将其转换如下: ServiceModel.EndpointAddress endPoint = new ServiceModel.EnpointAddress(_serviceURL);顺便说一句,我也在使用 WCF 与 SharePoint 对话。
    猜你喜欢
    • 1970-01-01
    • 2021-09-30
    • 2012-12-21
    • 2011-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-15
    • 1970-01-01
    相关资源
    最近更新 更多