Passing proxy server credentials through WCF service RRS feed

  • Question

  • Hi,

    My wcf service needs to send some files to another wcf service which present over the internet. My WCF service is hosted in a windows service on a computer in my organization's domain. All the communications to the outside world happen through a Proxy Server. I tried turning on the impersonation in the host Windows Service and then gave valid credentials to the 'Log on as' property of the service. It is working fine. But, apparently, this is not to be done.

    Is there anything, that I can set the proxy server details and send the valid credentials to the proxy server before sending files through my WCF service code to another WCF service over the internet?

    Friday, November 29, 2013 8:27 AM


  • Hi,

    I am not sure that if I have misunderstood you.

    For passing the proxy server credentials through wcf service, maybe we can try the following:

    BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
    basicHttpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
    basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
    EndpointAddress endpoint = new EndpointAddress("");
    List.ListsSoapClient client = new ConsoleApplication1.List.ListsSoapClient(basicHttpBinding, endpoint);
    client.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
    client.ChannelFactory.Credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;

    Also please try to check the following article:
    #How to: Use Impersonation with WCF: .

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 2, 2013 9:00 AM