title: WCF Error: The identity check failed for the outgoing message
body: <p>i am trying to consuming wcf web service and got error</p>
  
  <p>The identity check failed for the outgoing message. The expected identity is 'identity(http://schemas.xmlsoap.org/ws/2005/05/identity/right/possessproperty: <a href="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn" rel="nofollow">http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn</a>)' for the 'http://localhost/SCVMMService/VirtualMachineManagementService.svc' target endpoint. </p>
  
  <p>for consuming webservice i am using code : </p>
  
  <pre><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();
  </code></pre>
  
  <p>WebConfig:</p>
  
  <pre><code>&lt;bindings&gt;
              &lt;wsHttpBinding&gt;
                  &lt;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"&gt;
                      &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/&gt;
                      &lt;reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/&gt;
                      &lt;security mode="Message"&gt;
                          &lt;transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/&gt;
                          &lt;message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/&gt;
                      &lt;/security&gt;
                  &lt;/binding&gt;
              &lt;/wsHttpBinding&gt;
          &lt;/bindings&gt;
          &lt;client&gt;
              &lt;endpoint address="http://localhost/SCVMMService/VirtualMachineManagementService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IVirtualMachineManagementService" contract="ServiceReference1.IVirtualMachineManagementService" name="WSHttpBinding_IVirtualMachineManagementService"&gt;
                  &lt;identity&gt;
                      &lt;servicePrincipalName value="DDC-SC-VMM02.testlab.ourcp.com\Administrator"/&gt;
                  &lt;/identity&gt;
              &lt;/endpoint&gt;
          &lt;/client&gt;
  </code></pre>
  
  <p>and in webService config file for identity use:</p>
  
  <pre><code>    &lt;dns value="localhost"/&gt;
  </code></pre>