Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@traktraktrugui
Last active January 1, 2016 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save traktraktrugui/b1e88c35d8784acef80b to your computer and use it in GitHub Desktop.
Save traktraktrugui/b1e88c35d8784acef80b to your computer and use it in GitHub Desktop.
Under "configuration" section in Web.config add this:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true"></defaultProxy>
</system.net>
If you need to consume from HTTPS location add this configuration:
<message clientCredentialType="Certificate" algorithmSuite="Default" />
WebService wsrc = new WebService();
wsrc.Proxy = WebRequest.DefaultWebProxy;
wsrc.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
WebService wsrc = new WebService();
wsrc.Proxy = WebRequest.DefaultWebProxy;
wsrc.Proxy.Credentials = new NetworkCredential("name", "******************", "domain");
WebService wsrc = new WebService();
wsrc.Proxy = WebRequest.GetSystemWebProxy();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment