WCF Net-TCP Adapter - Setting ClientCredentials for Windows Authentication RRS feed

  • Question

  • Hi,

     I am calling a WCF Service from BizTalk via a Two-Way Send port (BizTalk 2009) (Net-TCP Binding)

     The services security mode is set as:

     mode="Message"  ClientCredentialType="Windows"

     I am using a two way Send port using the WCF-Custom Adapter.

     I can call the service, if the Send Ports Host Instance is using the correct Login Credentials: 

    ie Login: SomeDomain\SomeUserName  Password: SomePassword

     What I would like to do though, is to set the BizTalk Host Instance to use a Different Set of Login Credentials and then somewhere in the WCF-Send Ports Configuration, set the proper Credentials. For example if I call the service using straight code -> (SEE CODE SNIPPET below), I can set the Domain, UserName and Password and then successfully call the Service. Can I do the same in the configuration for the Send Ports WCF-Custom Adapter Settings and somewhere configure it to use the proper set of credentials? I have tried this (changed Login Credentials for the BizTalk Host Instance to another set of credentials) and then have been trying to set the proper Credentials with the Credentials, Behaviour and Binding Tabs for the WCF-Custom Adapter , but have been receiving errors.



      using (IntegrationService.IntegrationClient client = new IntegrationService.IntegrationClient())


          client.ClientCredentials.Windows.ClientCredential.Domain = "SomeDomain";
          client.ClientCredentials.Windows.ClientCredential.UserName = "SomeUserName";
           client.ClientCredentials.Windows.ClientCredential.Password = "SomePassword";

          string result = client.GetData(10);



    • Edited by Freddy King Friday, January 14, 2011 12:23 PM added more info
    Friday, January 14, 2011 12:01 AM


  • The easiest approach would be to create a custom host just for this purpose. Have it run under the account you want. Then add the WCF send/receive handlers for the host, and specify the port run under the custom host.

    If you want it to be more dynamic, then I would suggest using the WCF context properties and set them in an orchestration. Here is a link on the WCF context properties: So in your case it would be a combination of the Identity and Password properties.


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Saturday, January 15, 2011 11:29 PM