How to use Fiddler to monitor WCF service

前端 未结 10 588
情话喂你
情话喂你 2020-11-27 10:20

I have a WCF service that accepts a complex type and returns some data. I want to use Fiddler to see what the incoming requests to the service looks like. The client is .ne

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 10:32

    Consolidating the caveats mentioned in comments/answers for several use cases.

    Mostly, see http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureDotNETApp

    • Start Fiddler before your app
    • In a console app, you might not need to specify the proxyaddress:

      
      
    • In a web application / something hosted in IIS, you need to add the proxyaddress:

      
      
    • When .NET makes a request (through a service client or HttpWebRequest, etc) it will always bypass the Fiddler proxy for URLs containing localhost, so you must use an alias like the machine name or make up something in your 'hosts' file (which is why something like localhost.fiddler or http://HOSTNAME works)
    • If you specify the proxyaddress, you must remove it from your config if Fiddler isn't on, or any requests your app makes will throw an exception like:

      No connection could be made because the target machine actively refused it 127.0.0.1:8888

    • Don't forget to use config transformations to remove the proxy section in production

提交回复
热议问题