【发布时间】:2015-02-17 13:22:05
【问题描述】:
我正在托管 WCF Web 服务(在 Azure 上),并已将 WPF 桌面应用程序发送给(显然)尝试通过代理访问服务的客户端。
服务调用失败,返回
远程服务器返回意外响应:407 代理 需要身份验证
客户端 app.config 文件的 ServiceModel 部分如下所示:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ILicensing" closeTimeout="00:00:15" openTimeout="00:00:15"
receiveTimeout="00:00:15" sendTimeout="00:00:15" maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="xxxxxxx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ILicensing"
contract="Cloud.ILicensing" name="BasicHttpBinding_ILicensing" />
</client>
</system.serviceModel>
这基本上就是我所知道的。
我想通过修改服务的 app.config 文件和/或 web.config 文件来解决此问题(这无关紧要,因为无论如何都无法访问该服务)。
据我了解,绑定节点有useDefaultWebProxy属性,它要求查找系统代理配置,并使用它来连接服务。但是,由于默认值为 true,我希望将其显式设置为 true 不会改变任何内容(我猜这基本上是默认值的定义)。
考虑到
useDefaultWebProxy未设置,因此由于它的默认值应该是true,代理身份验证失败的原因是什么?如何修改 app.config 以解决考虑到信息有限的问题?基本上:我需要知道/询问我的客户什么(即代理服务器地址)以及我需要在我的客户配置文件中的什么位置插入信息?
如何在我的本地机器上设置一个模拟问题的测试环境?
【问题讨论】: