【问题标题】:WCF Error: The identity check failed for the outgoing messageWCF 错误:传出消息的身份检查失败
【发布时间】:2012-03-15 21:33:19
【问题描述】:

我正在尝试使用 wcf 网络服务并出现错误

外发消息的身份检查失败。 'http://localhost/SCVMMService/VirtualMachineManagementService.svc' 目标的预期身份是 'identity(http://schemas.xmlsoap.org/ws/2005/05/identity/right/possessproperty: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn)'端点。

为了使用网络服务,我正在使用代码:

Client.ClientCredentials.Windows.ClientCredential.Domain = "testlab.ourcp.com";
  Client.ClientCredentials.Windows.ClientCredential.UserName = "administrator";
  Client.ClientCredentials.Windows.ClientCredential.Password = "M!ndMasT23";
  Client.ClientCredentials.UserName.UserName = "administrator";
  Client.ClientCredentials.UserName.Password = "M!ndMasT23";        
  Client.Open();

网络配置:

<bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IVirtualMachineManagementService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
                    <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
                        <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost/SCVMMService/VirtualMachineManagementService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IVirtualMachineManagementService" contract="ServiceReference1.IVirtualMachineManagementService" name="WSHttpBinding_IVirtualMachineManagementService">
                <identity>
                    <servicePrincipalName value="DDC-SC-VMM02.testlab.ourcp.com\Administrator"/>
                </identity>
            </endpoint>
        </client>

并在 webService 配置文件中用于身份使用:

    <dns value="localhost"/>

【问题讨论】:

    标签: wcf wcf-security wcf-client


    【解决方案1】:

    您尝试访问的 WCF 服务是否配置为使用 Service Identity?如果不是,请从 endpoint 元素中删除整个 identity 元素,因为它仅与服务身份功能一起使用。

    【讨论】:

    • 我已更改 现在上面的错误已解决,现在我收到新错误:无法连接到 SCVMM 服务器。异常:Microsoft.Hosting.Management.HostingManagementException - 消息:无法连接到 SCVMM 服务器。您无法联系 Virtual Machine Manager 服务器。提供的凭据在 localhost 上的权限不足。确保您的帐户可以访问 Virtual Machine Manager 服务器 localhost,然后重试该操作。
    • 抱歉,无法解决这个问题。我以前在 WCF 中从未见过这种异常。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-07-31
    • 2011-03-31
    • 1970-01-01
    • 2021-11-20
    • 2012-10-08
    • 2015-12-14
    • 1970-01-01
    相关资源
    最近更新 更多