如何使用 Web 服务访问 Sharepoint 中的子站点列表? [英] How to access lists of a sub-site in Sharepoint using web services?

查看:51
本文介绍了如何使用 Web 服务访问 Sharepoint 中的子站点列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试使用网络服务(在 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 之后(按照

您只需要设置 Url 属性

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

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?

解决方案

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"

这篇关于如何使用 Web 服务访问 Sharepoint 中的子站点列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆