3

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.

3

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>
2
  • Thanks. I will give this a try and see how it works. It may be a while for me to be able to mark this as the answer since the problem shows intermittently. I'll give it a week or so of testing by setting the values in the config file first. Also, the version of the SDK code I have isn't using HttpWebRequest. Am I using the wrong version of the SDK? The SDKVersion string in the code is set to "FuelSDX-C#-V.9".
    – MMarks
    May 28 '15 at 20:10
  • Sure, no problem. Intermittent issues can be fiddly. I was looking at the latest code in Github. It looks like the most recent commit was the 31st of January 2014. They also list 0.9 as the latest release. You're correct that most of the code uses the SoapClient. I've updated the answer. May 28 '15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.