【问题标题】:How do I set the proxy in webhttpbinding configuration to use fiddler如何在 webhttpbinding 配置中设置代理以使用提琴手
【发布时间】:2023-03-24 19:53:01
【问题描述】:

我正在尝试通过在 webhttpbinding 配置文件中进行如下设置来设置我的 Web 服务客户端以使用提琴手代理:

<bindings>
  <webHttpBinding>
    <binding name="RestBinding" proxyAddress="http://localhost:8888"  
         useDefaultWebProxy="false">

    </binding>
  </webHttpBinding>
</bindings>
<client>
   <endpoint address="http://localhost:2172/RestServiceImpl.svc" 
       binding="webHttpBinding"  behaviorConfiguration="RestService" 
       bindingConfiguration="RestBinding" 
       contract="IWS.IRestServiceImpl" name="Rest"/>
</client>

这似乎不起作用。从客户端调用 web 服务时,我没有看到任何登录 fiddler 的内容。我知道正在拨打电话,因为我收到了服务的回复。

我似乎无法弄清楚我做错了什么。

感谢任何帮助!

谢谢!!

【问题讨论】:

    标签: wcf fiddler wcf-rest webhttpbinding


    【解决方案1】:

    .NET Framework 不会将“localhost”请求发送到任何代理,包括 Fiddler。要解决此问题,请尝试使用您的机器名称作为端点地址(例如 http://mymachine:2172/RestServiceImpl.svc)。

    另外,看看Using Fiddler with IIS7 Express

    【讨论】:

    • 感谢您花时间阅读我的帖子。我尝试将其更改为使用计算机名称和 ip,但两者都给我错误“错误代码:10061。无法建立连接,因为目标机器主动拒绝它”我觉得这现在是我的 Windows 上的权限问题7机。你知道我应该怎么做才能访问我的网络服务吗?
    • 我更新了我的 hosts 文件并且能够让它工作。将其更改为使用计算机名称就可以了!非常感谢!
    猜你喜欢
    • 2013-10-26
    • 2015-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-27
    • 1970-01-01
    • 2013-04-18
    相关资源
    最近更新 更多