title: How to Impersonate WCF Client executed inside WorkflowApplication?
body: <p>I have the following scenario:</p>
  
  <p>I have workflow application object running a workflow activity. In the workflow activity logic, I call a WCF service in which the service operations is also generated as a set activities.</p>
  
  <p>The problem is: How can I pass the credentials and impersonate other user in this case as its regularly done like this:</p>
  
  <pre><code>MyServiceClient client = new MyServiceClient();
  client.ClientCredentials.Windows.ClientCredential.Domain = domain;
  client.ClientCredentials.Windows.ClientCredential.UserName = username;
  client.ClientCredentials.Windows.ClientCredential.Password = password;
  </code></pre>
  
  <p>I tried to impersonate the code block that runs the the workflow application object, but in that case, I get some kind of exception saying "Could not load file or assembly ....  Access is denied". As I understand, the reason of this exception is that the workflow application is trying to call assembly which is under the original logged on user.</p>
  
  <p>Any help please?</p>