Calling a WSE web-service though a proxy
-
04-07-2019 - |
Question
I'm using Web Services Enhancements 3.0 to call a web-service from an ASP.NET application written in C# with Visual Studio 2005.
I can call the web-service in Internet Explorer if I change the network connection settings to use a specific SOCKS5 proxy but from the .ASPX page I get an error message that tells me that I should be using the proxy.
Do you know how to configure the web-service client to use the proxy?
Thanks
PS:
Adding the following to Web.config doesn't work:
<system.net>
<defaultProxy>
<proxy proxyaddress="http://theproxy:8080" bypassonlocal="True" />
</defaultProxy>
</system.net>
Solution
You need to set "enabled" attribute of defaultProxy element to "true" to make it work:
<system.net>
<defaultProxy **enabled="true"**>
<proxy proxyaddress="http://theproxy:8080" bypassonlocal="True" />
</defaultProxy>
</system.net>
This should work.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow