WCF basicHttpBinding和代理与Windows身份验证

时间:2012-05-29 11:09:56

标签: wcf proxy windows-authentication credentials

我有一个连接到外部Web服务的应用程序。

该应用程序工作正常,但有一个客户端我无法通过他们的代理。

由于我在

开始的计算机上配置了代理
<binding useDefaultWebProxy="true" ... >

有了这个,我收到错误信息:

The remote server returned an error: (407) Proxy Authentication Required.

然后我尝试添加:

    <security mode="Transport">
        <transport proxyCredentialType="Windows"
                   realm="" />
    </security>

但是错误消息没有改变

通过一些谷歌搜索,我发现默认设置是不向代理发送凭据。以下设置应该启用发送凭证:

<system.net>
    <defaultProxy useDefaultCredentials="true" />
</system.net>

但是,我现在收到另一条错误消息:

Insufficient permissions for setting the configuration section 'defaultProxy'. Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

我不明白这个消息。应用程序在本地计算机上运行,​​因此它应该具有完全信任。选中caspol -m -l并显示

1.  All code: Nothing
  1.1.  Zone - MyComputer: FullTrust

现在我没有想法。

我不知道如何将WebPermission添加到本地计算机上运行,​​我不知道这是否解决了代理身份验证的原始问题。

其他一些细节我不知道是否重要。

  • Windows 7 64位
  • webservice使用https(我可以通过Internet Explorer访问该服务)
  • 用户是本地管理员

0 个答案:

没有答案