2017-03-16 91 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