设置我的WCF服务以与Sharepoint Web服务进行通信时遇到了很多困难,特别是我正在尝试使用Lists.asmx和Copy.asmx服务.
我使用http链接到sharepoint进行开发,但现在我们需要切换到HTTPS链接.我获得了Web引用设置并更新了此链接,但是当它尝试调用服务(例如:GetListItems)时,它出错并出现以下错误:请求失败,HTTP状态为401:未经授权.
然后我试着看看我们的Sharepoint Server使用什么类型的身份验证,结果证明是NTLM.然后我尝试为此配置web.config文件.这是整个web.config文件:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="InventoryService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers …Run Code Online (Sandbox Code Playgroud)