I have written a WCF client which consumes a 3rd party web service.
I used the Visual Studio "Add Service Reference" wizard, and have used the code that it created without a hitch. It is great.
Once I had my client tested on my own development PC and then again on another PC (where internet access is different), I started deploying my WCF client to customers. It is now installed at over 20 sites and working well.
Except: at the latest customer, it will not work because their internet connection is set up to access the internet via a proxy server, and my WCF client fails with status 407.
Now, I know what the proxy server's IP address is, and the user name and password needed to authenticate to it. What I don't know is how I provide those three things to WCF so that it will authenticate with the proxy server for me.
I have tried using
MyWcfClient.ClientCredentials.UserName.UserName = proxyUsername;
MyWcfClient.ClientCredentials.UserName.Password = proxyPassword;
But that doesn't help.
I have searched around various forums for answers to this problem, and have tried some of the suggested solutions, but they seem to revolve around Windows authentication, and seem to be very, very complicated. And my application isn't really all that complicated - as I said above, it works with just the straight code as generated by the VS Service Reference wizard.
How can I specify the proxy's IP address, user name and password so that WCF will authenticate with the proxy for me?