[英]SharePoint document library versioning and require check out settings using web services
I need the information about the SharePoint document library. 我需要有关SharePoint文档库的信息。 Namely, I need the info whether the versioning is turned on or off and if the "require check out" option is selected. 即,无论版本控制是打开还是关闭以及是否选择了“需要签出”选项,我都需要信息。 I have to use SharePoint web services. 我必须使用SharePoint Web服务。
I have looked up in Versions.asmx, Lists.asmx and SiteData.asmx, but found no method or properties that suit my needs. 我在Versions.asmx,Lists.asmx和SiteData.asmx中进行了查找,但是找不到适合我需要的方法或属性。
Could anyone help me out please? 有人可以帮我吗? Thanks. 谢谢。
You will need to make use of the lists.asmx GetList method. 您将需要使用lists.asmx GetList方法。 It returns all of the metadata about a list. 它返回有关列表的所有元数据。
Here's some code I've been using in combination with Linq to XML: 这是我与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()
Hope this helps! 希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.