我知道有很多关于SO的问题与此类似,但我找不到这个问题.
有几点,第一点:
我正在尝试编写一个简单的控制台应用程序来使用Sharepoint Web Services操作Sharepoint数据.我添加了服务参考,以下是我的app.config:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ListsSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://subdomain.companysite.com/subsite/_vti_bin/Lists.asmx"
binding="basicHttpBinding" bindingConfiguration="ListsSoap"
contract="ServiceReference1.ListsSoap" name="ListsSoap" />
</client>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
static void Main(string[] args)
{
using (var client = new ListsSoapClient())
{
client.ClientCredentials.Windows.ClientCredential = new …Run Code Online (Sandbox Code Playgroud) 几天前,当在客户端和wcf Web服务之间使用Windows身份验证时,我对身份验证问题感到非常头疼.我得到的错误是"HTTP请求未经授权,客户端身份验证方案'协商'.从服务器收到的身份验证头是"NTLM".堆栈上的解决方案都没有工作,因为大多数解决方案与旧方法有关.