简体   繁体   中英

Calling a WSE web-service though a proxy

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>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM