Web services 如何使用web服务访问Sharepoint中的子网站列表?

Web services 如何使用web服务访问Sharepoint中的子网站列表?,web-services,sharepoint,powershell,Web Services,Sharepoint,Powershell,鉴于以下配置,我尝试使用web服务(在powershell上)访问sharepoint网站时遇到问题: 我的网站位于https://sharepoint.company.tld/sites/siteid/ WSDL是从https://sharepoint.company.tld/_vti_bin/Lists.asmx(从https://sharepoint.company.tld/sites/siteid/_vti_bin/Lists.asmx) 在构建web服务DLL(以下步骤)之后,我执

鉴于以下配置,我尝试使用web服务(在powershell上)访问sharepoint网站时遇到问题:

  • 我的网站位于
    https://sharepoint.company.tld/sites/siteid/
  • WSDL是从
    https://sharepoint.company.tld/_vti_bin/Lists.asmx
    (从
    https://sharepoint.company.tld/sites/siteid/_vti_bin/Lists.asmx
在构建web服务DLL(以下步骤)之后,我执行

并尝试通过其GUID(我知道)获取列表:

这将导致一个例外: 按列表的名称检索列表是相同的

执行
$list.GetListCollection()
将返回
https://sharepoint.company.tld
是的,我的名单不在其中。只有一些列表包含的网页,应用于真正的网站和类似的东西

那么,问题来了:我有没有办法告诉web服务他们不能访问
https://sharepoint.company.tld
但要搜索位于
https://sharepoint.company.tld/sites/siteid/Lists

查看以下内容:

您只需要设置Url属性

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

如果你粘贴完整的代码,我可以准确地告诉你在哪里进行更改
$docs = $list.GetList("GUID-HERE")
$list.Url = "http://sharepoint/sites/root/subsite/_vti_bin/lists.asmx"