Debug Windows Mobile with webservices on localhost using Visual Studio Web Development Server and Fiddler

This has frustrated me for a while, but seems I found a solution this evening.
I build a lot of Compact Framework apps which communicate via webservices with an webservice. During development, I prefer to use the built-in web development server instead of having to mess around with IIS etc.

The problem: the web dev server only allows connections from “localhost”, which doesnt include your dev pda, assuming you are using activesync. Long story, but even though the pda can browse the web using your desktop’s ip, it has it’s own local ip which makes the dev web server think it is a remote connection. Thus is winds up blocked.

Solution seems to be, download this tool:
Fiddler is a local proxy which is used for debugging http connections, and is normally used along with development.

You can disable the logging in fiddler so we’re just using it as a local proxy.

On your windows mobile device, add an http proxy to the connection settings. Use port 8888 (the fiddler default), and use ppp_peer as the host name. Im told that windows mobile 5 and greater use dtpt_peer instead, but I havent tested this yet.

NOW: when you wish to connect to a locally hosted web app or web service from the pda, use this:


where 1234 is your port number and.. you get the idea. *But* notice the single “.” after localhost. This is the magic that makes this work. How? Well, I’ve fought this battle long enough, discovering why is a luxury I don’t have at the moment.


2 Responses to “Debug Windows Mobile with webservices on localhost using Visual Studio Web Development Server and Fiddler”

  1. Debug Windows Mobile with webservices with Fiddler - part 2 « Boomhauer’s braindump Says:

    […] bradymoritz  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 […]

  2. Glaucio Barizon Says:

    My friend, i do this magic…
    The answer to your question is:

    The localhost for the mobile devices is himself, when you address the server instead localhost put http://yourlocalIpMachine/webserver.asmx
    ex: so the mobile will search in the localnetwork that is automatic configured and will find the server.

    localhost for the mobile is himself. (this is why your proxy work, for the mobile when you use proxy … the target now is your machine not the mobile device.)

    Sorry for the bad english…

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: