WCF错误:传出邮件的身份检查失败 [英] WCF Error: The identity check failed for the outgoing message

查看:87
本文介绍了WCF错误:传出邮件的身份检查失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

i am trying to consuming wcf web service and got error

The identity check failed for the outgoing message. The expected identity is 'identity(http://schemas.xmlsoap.org/ws/2005/05/identity/right/possessproperty: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn)' for the 'http://localhost/SCVMMService/VirtualMachineManagementService.svc' target endpoint.

for consuming webservice i am using code :


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();



WebConfig:



WebConfig:

<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配置文件中供身份使用:



and in webService config file for identity use:

<dns value="localhost"/>

推荐答案

可以使用userPrincipalName属性代替DNS名称.
Instead of the DNS name you could use the userPrincipalName attribute..
<identity>

         <userPrincipalName value="Company\WebServiceAppPool" />

       </identity>



其中:Company \ WebServiceAppPool是域名帐户.

我的Web服务以该域名运行,因此客户端在访问服务时在端点中使用此凭据



where: Company\WebServiceAppPool is the domain name account.

My webservice runs under this domain name, and therefore the client uses this credential in the endpoint while accessing the service


这篇关于WCF错误:传出邮件的身份检查失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆