Debug Windows Mobile with webservices with Fiddler – part 2

 The day following my posting the original “using fiddler” info (see this ), I got to try my same setup using a windows mobile 5 pda… and failed.

I won’t go into all the things I tried to get this to work again, but FINALLY found the right combo to allow a locally-connected PDA (via activesync) to connect to a webservice running in the visual studio development webserver.

WM5+ apparently no longer likes to use the ppp_peer name for accessing the locally connected pc. I’ve read there is a replacement called dtpt_peer that should work, but so far this one is batting zero. Instead, you can use an IP that gets configged automatically by activesync. I wish there were a name to use in place of the ip, but if there is one, i havent found it.

Basically:  is the IP given to the desktop pc. is the ip given to the PDA.

Why not just use this IP in place of ppp_peer and get busy? Well windows on the desktop also treats these ip’s differently from the normal local ip, and when a connection is made through them, they are treated as remote connections.

Step 1. Let’s configure Fiddler to accept external IP’s. Note: the method I used will allow connections from *anywhere*, which is a bit dangerous as it could allow others to use your proxy and do bad-people stuff through it. You should really configure fiddler to only allow remote connections from the 169.254.2.* range.

Check this box:

enable remote connections

enable remote connections

Restart fiddler and your personal firewall will likely warn that fiddler wants to accept connections on port 8888, tell it yes that’s cool. Really, the personal firewall is a better place to go set some rules regarding the allowable ip range mentioned above.

Step 2. Add some script code to fiddler. Open the script editor and add this to the event called OnBeforeRequest, replacing the port 1234 with the appropriate one (the one web development server dynamically assigns):

if (”″){”″;

This entry will take the “remote” connection from the 169 ip and make it look like a local connection that the dev server will be happy with accepting.

Step 3. Setup the connection on the pda to use a proxy, and put the for the proxy ip. For the http proxy portion, specify port 8888.

Step 4. Now open a browser on the PDA and connect to: http://localhost.:1234 , again replacing the port 1234 with your own. Yes, that is a “.” between localhost and the “:”. Go read on the fiddler website about it, I dont understand it either. If things work, fiddler should show your connection attempt in its log, and your mobile browser should show the locally hosted web content.

Now, you can use this same url scheme with your webservice calls from the PDA.

Warning! I also tried this same setup today with a compact framework 1.0 app. It *almost* worked, but the older CF.Net trimmed off the port number portion and thus was trying to hit port 80… and failed. As soon as I upgraded to 3.5, everything worked fine, and Im sure 2.0 is ok as well, though I should know better than to be sure of anything at all with winmo and dev 😉


One Response to “Debug Windows Mobile with webservices with Fiddler – part 2”

  1. Marthijn Says:

    On a pc you have a host file. This file states e.g. that localhost should be resolved as The pda has the same except that it is not a file, but it is stored in the registry. If you search the registry for a WM5 device you will see that DTPT_PEER will resolve to PPP_PEER might resolve to e.g. If you want to use the name instead of an ip, make sure you use the one that resolves to (which is the ip of active sync).
    Anyway, great article. It helped me out a lot!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: