I'm running into an issue where our proxy is occasionally requiring authentication when instantiating the ET_Client class in the C# FuelSDK. The problem will sometimes go away on it's own, or I just open IE and run my code again and it is fine for another few days. Is there a way to pass in proxy credentials to the ET_Client class, or is there some other way of coding to make this not be an issue? The ET_Client class looks like it uses SOAP inside it so I am not sure what is possible. Thanks.
It's odd that it is working intermittently and that opening IE resolves the issue. That implies that the .NET code is picking up the default proxy details from the operating system.
The ET_Client class seems like a good place to make any explicit proxy modifications. There is usage of the
HttpWebRequest class in there where you could set the
Proxy property as required.
The instance of SoapClient is also constructed from a BasicHttpBinding instance. BasicHttpBinding has properties for configuring a proxy, such as ProxyAddress.
.NET also has the concept of a default proxy, which can be set as follows in the app/web.config.
<configuration> <system.net> <defaultProxy> <proxy usesystemdefault="true" proxyaddress="http://192.168.1.10:3128" bypassonlocal="true" /> </defaultProxy> </system.net> </configuration>