Windows Phone 8 – Debug REST Service With Fiddler
While trying to fix a REST service issue that I mentioned here. I needed to see what traffic was going between my Windows 8 mobile and the REST service hosted on my development machine. I always use Fiddler to look into service traffic, but as the phone wasn’t using the network card of my local machine, I could only see limited outgoing traffic.
So I setup Fiddler as a Proxy Server and passed the phone through the proxy, this way i could see all the traffic going to and from the phone to the REST service. The method i used will work with a physical phone or the Windows 8 phone emulator. So this is how I did it…
- Download and install Fiddler.
- Open up Fiddler and click on the Tools > Fiddler Options.
- If you are using HTTPS you will need to go to the HTTPS tab and enable Capture HTTPS Connections. You will be prompted to accept the certificate that Fiddler creates, let it install the certificate on your computer, you must also install this certificate on your phone.
- Go to the Connections tab and configure the proxy the same as below. If Fiddler moans about using the current port, change it to another unused port.
- Now on the Windows 8 Phone or emulator go to Settings > System > Wi-Fi > Tap the network you are currently connected to.
- Turn the Proxy setting on.
- For Server/URL enter the IP address of your computer that Fiddler is running on.
- For Port enter the port you configured in Fiddler. This can be found on the Connections tab in Fiddler Options.
- Click the tick to apply settings.
- On fiddler make sure the Stream setting is selected from the top toolbar. You should now see traffic from your phone in fiddler.
Its worth noting that with the Proxy configured on the phone, if you close Fiddler you will loose internet connectivity on the phone. To resolve this just go to the Wi-Fi settings again and turn the Proxy off.