Friday, September 28, 2007

Now this is interesting.   I've often wondered why about 10 minutes before doing any demo.  the Windows Mobile device emulator fails to connect to the Internet.    More annoyingly the closer to the demonstration the more likelihood of such occurrence taking place.      Today maybe I've come closer to working out why this law stands, and may I pray be the end to the last minute demo nightmare.

I'm sure that this is well documented and very obvious,  but I'd never noticed it before.    When you cradle a mobile device (using the device emulator manager),   the mobile device acquires the proxy server of the Internet connection you are using, as follows -

image

This can cause all sorts of grief if say the mobile application you are using connects to SQL Compact server by IP address or if your using web-services.

So apart from remembering to go into your connection settings and uncheck the second checkbox,  today I came up with a way that would make you proxy proof.    To avoid the 10 minute demo nightmare we need a way to tell in our application to ignore this inherited proxy settings.  This is an example of calling a web-service by its IP address.   I use a static class to take the pain out of building a reference to our webservice -

public static gsqa01.RA WS()
     {
         gsqa01.RA ret = new gsqa01.RA();
         ret.Url =
http://10.0.0.1/test/test.asmx";
         ret.Credentials = WSCreds(); // go get our authentication
         ret.PreAuthenticate = true;
         ret.Proxy = new WebProxy(); // ignore the standard proxy
         return ret;
     }

Its exactly the same deal with SQL Compact replication.  I did a demo today  and I'm pleased to say the demo went smoothly and proxy problem free.

Friday, September 28, 2007 8:32:13 PM UTC  #    Comments [0]  | 

Theme design by Jelle Druyts

Pick a theme: