在尝试使用具有以下配置的 Web 服务(在 powershell 上)访问我的共享点网站时遇到问题:
- 我的网站位于
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(按照 these 步骤)后,我执行了
$list = New-Object Lists
并尝试通过它的 GUID(我知道)获取列表:
$docs = $list.GetList("GUID-HERE")
这会导致异常: 通过名称检索列表是相同的。
正在做$list.GetListCollection()
返回 https://sharepoint.company.tld
已知的列表是的,我的名单不在其中。只有一些包含用于真实网站和类似内容的 Web 部件的列表。
所以,问题是:有什么方法可以告诉网络服务它们不应访问位于 https://sharepoint.company.tld
下的列表吗?但要搜索位于 https://sharepoint.company.tld/sites/siteid/Lists
的我的列表?
最佳答案
看看这个: http://www.nivot.org/2008/02/29/ManipulatingRemoteSharePointListsWithPowerShell.aspx
您只需要设置 Url 属性
$list.Url = "http://sharepoint/sites/root/subsite/_vti_bin/lists.asmx"
关于web-services - 如何使用 Web 服务访问 Sharepoint 中的子站点列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4657954/