How to access lists of a sub-site in Sharepoint using web services?

ぃ、小莉子 提交于 2019-12-30 07:29:40

问题


I'm experiencing problems when trying to access my sharepoint site using web services (on powershell) given the following configuration:

  • my site is located at https://sharepoint.company.tld/sites/siteid/
  • the WSDL was fetched from https://sharepoint.company.tld/_vti_bin/Lists.asmx (redirected from https://sharepoint.company.tld/sites/siteid/_vti_bin/Lists.asmx)

After building the web service DLL (following these steps), I do a

$list = New-Object Lists

and try to obtain a list by it's GUID (known to me):

$docs = $list.GetList("GUID-HERE")

This results in an exception:

Retrieving the list by it's name is the same.

Doing a $list.GetListCollection() returns me the lists known by https://sharepoint.company.tld and yes, my list is not amongst these. Only some lists containing webparts that shall be used for the real sites and similar stuff.

So, here's the question: Is there any way how I could tell the web services that they shall not access a list located under https://sharepoint.company.tld but to search my lists located at https://sharepoint.company.tld/sites/siteid/Lists?


回答1:


Check out this: http://www.nivot.org/2008/02/29/ManipulatingRemoteSharePointListsWithPowerShell.aspx

You just need to set up Url property

$list.Url = "http://sharepoint/sites/root/subsite/_vti_bin/lists.asmx"


来源:https://stackoverflow.com/questions/4657954/how-to-access-lists-of-a-sub-site-in-sharepoint-using-web-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!