Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 571563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:31:13+00:00 2026-05-13T13:31:13+00:00

Is it possible to provide WCF with a custom proxy address and custom credentials?

  • 0

Is it possible to provide WCF with a custom proxy address and custom credentials?

I’ve found this answer on stackoverflow: How to set proxy with credentials to generated WCF client?, but I’ve got a complication, the service I’m authenticating against uses its own authentication, so I’ve got to use two sets of credentials (one to get through the proxy, and the other to authenticate against the service)

I’m using the technique described in the answers to the other question to provide the service credentials. e.g.

client.ClientCredentials.UserName.UserName = username;
client.ClientCredentials.UserName.Password = password;

I can set the address of the proxy using something like this:

(client.Endpoint.Binding as WSHttpBinding).ProxyAddress = ...;

How do I set what is effectively two sets of credentials? (NB: The credentials for the proxy and the actual service are different!) Also note that the proxy details are not necessarily the default system proxy details.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:31:14+00:00Added an answer on May 13, 2026 at 1:31 pm

    If you set the WebRequest.DefaultWebProxy property to a new WebProxy with credentials, WCF will use it for all HTTP requests that it makes. (This will affect all HttpWebRequests used by the application unless explicitly overridden).

    // get this information from the user / config file / etc.
    Uri proxyAddress;
    string userName;
    string password;
    
    // set this before any web requests or WCF calls
    WebRequest.DefaultWebProxy = new WebProxy(proxyAddress)
    {
        Credentials = new NetworkCredential(userName, password),
    };
    

    My blog post on proxy servers contains further details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I set up the SQL Membership provider for my WCF service. I have custom
Is it possible to use WCF Data Services to provide CRUD access to an
If it possible to provide a service to multiple clients whereby if the server
I know that it's possible to implicitly provide asynchronous interaction using: Asynchronous Delegates Asynchronous
Is it possible to create a Silverlight application which can be used to provide
Is it possible to use this Role Provider AspNetWindowsTokenRoleProvider with ASP.NET FORMS Authentication (via
is it possible that my mingw 3.4.5 installation is faulty? or is this provided
I just began studying WCF because i need it for a school assignment. But
Is it possible to override the default WCF DataContractSerializer behaviour when Serialize/DeSerialize entities and
I am new to WCF and I want to know if it is possible

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.