【发布时间】:2015-07-30 13:09:30
【问题描述】:
我正在尝试访问 Sharepoint 2010 的 Lists.asmx Web 服务。我在 C# 中创建了新的控制台项目,添加了对 Web 服务 (http://[SITE]/_Vti_Bin/Lists.asmx) 的引用,它发现 Lists Web 服务没问题。但是,当我尝试做
ListsService.Lists objLists = new ...
它说列表不存在!在对象查看器中,我在 ListsService 命名空间中看到了各种各样的东西:
AddAttachmentRequest
AddAttachmentRequestBody
....
但我没有看到列表。但是,我在网上找到的每个示例都说,在我添加引用后,我应该在命名空间中有 Lists...
我做错了什么?
编辑:app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ListsSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://SITE/_Vti_Bin/Lists.asmx"
binding="basicHttpBinding" bindingConfiguration="ListsSoap"
contract="ListsService.ListsSoap" name="ListsSoap" />
</client>
</system.serviceModel>
</configuration>
【问题讨论】:
标签: c# web-services sharepoint sharepoint-2010