2012-03-15 39 views
1

我正嘗試使用wcf Web服務並收到錯誤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)'。

用於消費web服務我使用代碼:

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:

<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"/> 

回答

2

是WCF服務你」重新嘗試訪問配置使用Service Identity?如果不是,則從endpoint元素中刪除整個identity元素,因爲它僅用於服務縮進功能。

+0

我已經改變 現在 上述錯誤已經得到解決我得到新的錯誤: 無法連接到SCVMM服務器。異常:Microsoft.Hosting.Management.HostingManagementException - 消息:無法連接到SCVMM服務器。您無法聯繫Virtual Machine Manager服務器。提供的憑據在localhost上沒有足夠的權限。確保您的帳戶有權訪問Virtual Machine Manager服務器本地主機,然後再次嘗試操作。 – 2012-03-16 05:39:05

+0

對不起,不能幫助解決這個問題。我從來沒有在WCF中見過這個異常。 – 2012-03-16 12:37:28

相關問題