2017-03-16 19 views
0

我有简单的客户端应用程序(控制台应用程序)和服务器应用程序(WCF库项目)使用WCF。我想看看Fiddler中WCF消息的外观如何。如何配置客户端以捕捉Fiddler中的本地WCF请求?

我添加以下代码,以客户的app.config:

<configuration>  
    <system.net> 
    <defaultProxy> 
     <proxy bypassonlocal="False" usesystemdefault="True" proxyaddress="http://127.0.0.1:8888" />  
    </defaultProxy> 
    </system.net> 

我的提琴手显示了浏览器,除了一个具有URL词“vshub”的所有连接,但也有显示WCF客户端/服务器应用程序之间没有任何连接。如何配置它?

UPDATE1:

我的WCF服务库(服务器应用程序)配置以下列方式:

<system.serviceModel> 
    <services> 
     <service name="WcfServer.Service1"> 
     <host> 
      <baseAddresses> 
      <add baseAddress = "http://localhost:8733/Design_Time_Addresses/WcfServer/Service1/" /> 
      </baseAddresses> 
     </host> 
     <!-- Service Endpoints --> 
     <!-- Unless fully qualified, address is relative to base address supplied above --> 
     <endpoint address="" binding="basicHttpBinding" contract="WcfServer.IService1"> 
      <!-- 
       Upon deployment, the following identity element should be removed or replaced to reflect the 
       identity under which the deployed service runs. If removed, WCF will infer an appropriate identity 
       automatically. 
      --> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     <!-- Metadata Endpoints --> 
     <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> 
     <!-- This endpoint does not use a secure binding and should be secured or removed before deployment --> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, 
      set the values below to false before deployment --> 
      <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/> 
      <!-- To receive exception details in faults for debugging purposes, 
      set the value below to true. Set to false before deployment 
      to avoid disclosing exception information --> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

回答

0

本地请求不被逮住提琴手。提琴手只捕获实际经过电线的请求。本地请求由Windows进行快捷方式。

an old post与一些替代品,但我不知道如何实际的清单是。

0

你在客户端配置中没有任何操作,你可以删除你的代理设置。提琴手将工作,如果你不使用“本地主机”,并将其替换为“我的机器名”

+0

任何示例如何更新它? –

+0

据我所知这并不重要。操作系统足够聪明,可以将您的计算机名称映射到本地主机。 –

+0

你的服务器可以监听本地主机,但将你的客户端端点更改为你的机器名称,如,这是为fiddler ...不适用于系统 – GCamel