Http 绑定上的代理
我有一个网络应用程序使用代理服务器连接计算机上的网络服务。 Internet Explorer 上的连接正常,如图所示
我的 web.config 是:
<system.net>
<defaultProxy>
<proxy autoDetect="true" usesystemdefault="true"/>
</defaultProxy>
</system.net>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ProcessSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
useDefaultWebProxy="true" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
>
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://www.serveraddressthatiwanttoconnect.com/services/WebService.asmx"
binding="basicHttpBinding" bindingConfiguration="ProcessSoap"
contract="PINAlmaServis.ProcessSoap" name="ProcessSoap" />
</client>
我想使用系统代理设置,因为它会不时更改。 “kurumsalproxy”是本地网络上的计算机名称。我在 http://msdn.microsoft 上尝试了 web.config 的所有潜在变体。 com/en-us/library/kd3cf2ex.aspx 但无法建立连接。
有什么我想念的吗?
I have a web application connects web service on a machine uses proxy server. Connections are ok on internet explorer as shown in image
And my web.config is:
<system.net>
<defaultProxy>
<proxy autoDetect="true" usesystemdefault="true"/>
</defaultProxy>
</system.net>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ProcessSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
useDefaultWebProxy="true" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
>
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://www.serveraddressthatiwanttoconnect.com/services/WebService.asmx"
binding="basicHttpBinding" bindingConfiguration="ProcessSoap"
contract="PINAlmaServis.ProcessSoap" name="ProcessSoap" />
</client>
I want to use system proxy settings, because it can change time to time. "kurumsalproxy" is a machine name on local network. I tried every potential variations for web.config on http://msdn.microsoft.com/en-us/library/kd3cf2ex.aspx but can not establish to connect.
Is there something that i miss?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有“系统”代理设置。每个用户都拥有个人代理配置。您可以使用代理配置创建一个用户,并更改应用程序池身份以使用该帐户。
更新:如何在 ASP.NET 应用程序中使用 Internet Explorer 中使用的代理
There is no “system” proxy settings. Every user owns personal proxy configuration. You could create a user with the proxy configuration and change app pool identity to use that account.
UPDATE: How to use the proxy used in Internet Explorer in an ASP.NET application
如果您仔细阅读此服务器故障线程,我认为您不需要更改应用程序池标识,
https://serverfault.com/questions/34940/how-do-i-configure-proxy-settings-for-local-system
您需要为系统配置代理设置帐户(本地系统、本地服务和网络服务)(如果您的应用程序池标识是网络服务)。
I don't think you need to change application pool identity, if you carefully read this server fault thread,
https://serverfault.com/questions/34940/how-do-i-configure-proxy-settings-for-local-system
You need to configure the proxy setting for system accounts (local system, local service, and network service) if your application pool identity is Network Service.