I currently have a WCF service running in IIS7 and I have have added impersonation on each of the public web methods with the following:
[OperationBehavior(Impersonation = ImpersonationOption.Required)]
public void TestMethod(){}
When ever I call this method from my test client application I get the following error:
Could not load file or assembly 'System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=waeraewrar' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid.
I'm currently using Microsoft Enterprise Library 3.1, and .Net 4.0.
Sample code:
WcfService client = new WcfService();
client.TestMethod();
Try configuring the client to allow an impersonation level of impersonation. For example:
<system.serviceModel>
<client>
<endpoint address="http://xxxxx/Services/xxService.svc"
binding="wsHttpBinding"
contract="IServiceContract"
behaviorConfiguration = "ImpersonationBehavior" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="ImpersonationBehavior">
<clientCredentials>
<windows allowedImpersonationLevel = "Impersonation" />
</clientCredentials>
</behavior>
<endpointBehaviors>
</behaviors>
</system.serviceModel>
See this article for more on impersonation and delegation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With