Click here to Skip to main content
15,843,498 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
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 :

C#
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:

XML
<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>


and in webService config file for identity use:
<dns value="localhost"/>
Posted

1 solution

Instead of the DNS name you could use the userPrincipalName attribute..
XML
<identity>

         <userPrincipalName value="Company\WebServiceAppPool" />

       </identity>


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
 
Share this answer
 
Comments
prateekfgiet 16-Mar-12 1:26am    
Hi GanesanSenthilvel,

i tried with your solution,but i am getting new error.

Log Name: Application
Source: Fabric Management Services
Date: 3/16/2012 10:52:38 AM
Event ID: 1
Task Category: (1)
Level: Error
Keywords: Classic
User: N/A
Computer: DDC-SC-VMM02.testlab.ourcp.com
Description:
Cannot connect to SCVMM server.
Exception: Microsoft.Hosting.Management.HostingManagementException - Message: Cannot connect to SCVMM server.You cannot contact the Virtual Machine Manager server. The credentials provided have insufficient privileges on localhost.
Ensure that your account has access to the Virtual Machine Manager server localhost, and then try the operation again.
Stack Trace: at Microsoft.Hosting.VirtualMachineManagement.ServiceImplementation.VirtualMachineManagementService.GetServerConnection()
at Microsoft.Hosting.VirtualMachineManagement.ServiceImplementation.VirtualMachineManagementService..ctor()
Event Xml:
<event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<system>
<Provider Name="Fabric Management Services" />
<eventid qualifiers="0">1
<level>2
<task>1
<keywords>0x80000000000000
<timecreated systemtime="2012-03-16T05:22:38.000000000Z">
<eventrecordid>5464
<channel>Application
<computer>DDC-SC-VMM02.testlab.ourcp.com
<security>

Cannot connect to SCVMM server.
Exception: Microsoft.Hosting.Management.HostingManagementException - Message: Cannot connect to SCVMM server.You cannot contact the Virtual Machine Manager server. The credentials provided have insufficient privileges on localhost.
Ensure that your account has access to the Virtual Machine Manager server localhost, and then try the operation again.
Stack Trace: at Microsoft.Hosting.VirtualMachineManagement.ServiceImplementation.VirtualMachineManagementService.GetServerConnection()
at Microsoft.Hosting.VirtualMachineManagement.ServiceImplementation.VirtualMachineManagementService..ctor()

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900