在声明模式下以Sharepoint托管的WCF服务

时间:2011-06-18 19:13:16

标签: wcf sharepoint claims

我在声明模式下为Https配置了一个sharepoint服务器。我在sharepoint服务器上托管了一个WCF服务。此WCF服务器使用客户端证书进行身份验证。

WCF服务使用BasicHttpBinding

在客户端,以下是绑定:

BasicHttpBinding binding = new BasicHttpBinding();
binding.TransferMode = TransferMode.StreamedResponse;
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm;

我还使用以下调用设置了客户端证书:

base.ClientCredentials.ClientCertificate.SetCertificate(
    "CN=tempClientcert", StoreLocation.LocalMachine, StoreName.My
);

在客户端和服务器中正确设置了客户端证书。

当我尝试调用该服务时,出现以下错误:

System.Security.MessageSecurityException :  The HTTP request is unauthorized 
    with client authentication scheme 'Anonymous'. The authentication header
    received from the server was 'NTLM'

虽然我已将客户端凭据设置为证书,但尚不清楚为什么它说http客户端身份验证方案是匿名的。

2 个答案:

答案 0 :(得分:0)

看起来这个配置可能有一些相关性? SharePoint, WCF and Anonymous Access(注意模式 - TransportOnly)

答案 1 :(得分:0)

WCF服务支持许多传输选项,它们未完全集成到SharePoint