【问题标题】:Proxy on Http BindingsHttp 绑定上的代理
【发布时间】:2011-10-14 06:28:48
【问题描述】:

我有一个 Web 应用程序在使用代理服务器的机器上连接 Web 服务。如图所示,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.com/en-us/library/kd3cf2ex.aspx 上尝试了 web.config 的所有潜在变化,但无法建立连接。

有什么我想念的吗?

【问题讨论】:

    标签: c# asp.net networking proxy web-config


    【解决方案1】:

    我想使用系统代理设置

    没有“系统”代理设置。每个用户都拥有个人代理配置。您可以使用代理配置创建用户并更改应用程序池身份以使用该帐户。

    更新:How to use the proxy used in Internet Explorer in an ASP.NET application

    【讨论】:

      【解决方案2】:

      我认为您不需要更改应用程序池标识,如果您仔细阅读此服务器故障线程,

      https://serverfault.com/questions/34940/how-do-i-configure-proxy-settings-for-local-system

      如果您的应用程序池标识为网络服务,则需要为系统帐户(本地系统、本地服务和网络服务)配置代理设置。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-20
        • 1970-01-01
        • 2019-04-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-12-12
        • 1970-01-01
        相关资源
        最近更新 更多