Matei's blog

Confessions of Mort

About the author

Author Name is someone.
E-mail me Send mail

Recent posts

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Bing maps web service weirdness

I’ve experienced some interesting issues with the Bing Maps web services, specifically the token service. Looks like it’s been a problem for some folks, and this time Google produced no conclusive results.

The symptoms are that despite entering your account id and password correctly you cannot add a Web Service reference from VS 2008. You get an error message similar to this:

There was an error downloading 'https://staging.common.virtualearth.net/find-30/common.asmx?wsdl'.
The request failed with HTTP status 400: Bad Request.

I’ve tried this on several machines with the same result. Hitting the site via IE works fine. Normally you have the option of using wsdl.exe/svcutil.exe and generating your proxy and this is what I normally use for web services. In this case that doesn't work well since my project is a Compact Framework project. The usual tools don’t seem to do the job, there is no switch that allows to specify the target framework as Compact Framework.

The trick that worked for me was to download the .wsdl as common.wsdl and serve this file from my Web Development Server. Once this is set up, you can go ahead and add the Web Service reference from VS and point to this locally hosted common.wsdl. This should allow you to generate a web service proxy for the token service.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by mateid on Tuesday, July 07, 2009 4:27 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Some more shots

A few more shots I’ve taken over the past few weeks. The first one is in Vancouver, where I just missed ALT .Net. It was amazing how crowded the bay was, the weather was fantastic and there were quite a few sailboats about.

Next couple of shot at Calgary Farmer’s Market. I have a couple of more of the textured ones, there was a small shop selling a variety of items made of felt. The colors and textures were too much to resist.

3677292218_dd014c24ca_b

3687737969_8e823ae448_b

3687731991_fb6886ab3e

 

 

 

 

 

 

 

Enjoy!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Photography
Posted by mateid on Monday, July 06, 2009 2:00 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Blown gasket

I have a ‘98 Subaru Legacy GT which has now developed the infamous head gasket issue. There’s 180K on the clock, and I just got back from Vancouver where I missed the ALT .Net conference due to a variety of mechanical failures. Ballpark figure around $2200 to make this go away. Who knows how bad the damage is, there is so much junk in the coolant now it’s hard to tell. I really like this car, but this is depressing. I need a 2005-2006 GT with a manual transmission, that’ll cheer me up.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Rants
Posted by mateid on Wednesday, June 17, 2009 9:41 AM
Permalink | Comments (2) | Post RSSRSS comment feed

Some HDR shots

I’ve gotten a digital camera for my birthday from the wife – nothing too fancy, a Canon XS with the EFS 18-55 IS kit lens. I’ve been putting it through its paces lately, getting some practice with a variety of shots. A few weeks ago, I’ve found some pretty interesting shots on Flickr and it turns out it was Trey Ratcliff’s work. Needless to say I find his stuff pretty awesome. He’s got an HDR tutorial that inspired me quite a bit, and after a few unsuccessful HDR attempts I came up with a pretty decent shot.

This was taken around 8:15 PM at the Anderson train station in Calgary. Three exposures, +/-2 EV, from the tripod, with the kit lens. It’s the best one yet, although it has some ghosting and noise issues. I don’t really have a good noise reduction software.

Here’s another one, from our living room. Three exposures, +/-2 EV apart, with the tripod and the EF 50 1.8 II. Pretty mundane subject, I’m trying to get the creative juices flowing and learn more about light.

By the way, the EF 50 is absolutely amazing, scored it for 120 at Future Shop of all places and it’s worth every penny. It’s giving me some grief with the slow/noisy focus. The DOP is also very shallow, which makes certain shots tricky until you get used to it.

_MG_2066_7_8_MG_2494_5_6

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Photography
Posted by mateid on Monday, May 11, 2009 3:29 PM
Permalink | Comments (3) | Post RSSRSS comment feed

jQuery web service proxy

A little while back I was looking for a nice convenient way of calling ASP .Net web services from JavaScript. I looked at the MS Ajax implementation, however I’m a little uncomfortable with the Script Manager and all the related plumbing. It’s just a little heavy for my taste, and I’m not a big fan of the auto generated web service proxy. I also wanted to keep the door open for porting my project to Mono and I wasn’t sure if those features have been ported yet (if they have, ping me). I looked at jQuery, Prototype and Scriptaculous and of those three I liked jQuery the best for the additional features the package offers. Right off the bat jQuery was pretty simple to use and set up, but a little too much typing for my taste. Here’s what I came up with:

   1:  (function($) { $.proxy = function(options) {
   2:          
   3:          /* Default .Net web service proxy options. */
   4:          var defaults = {
   5:              mode: "POST",
   6:              contentType: "application/json;charset=utf-8",
   7:              dataType: "json",
   8:              endPoint: "",
   9:              data: "",
  10:              success: {},
  11:              failure: {}
  12:          };
  13:          
  14:          /* Extend (or override) the defaults with any passed in options. I really like this extend feature. */
  15:          var options = $.extend(defaults, options);
  16:   
  17:          /* Make the ajax call using $.ajax() */
  18:          return $.ajax({
  19:              url: options.endPoint,
  20:              type: options.mode,
  21:              contentType: options.contentType,
  22:              dataType: options.dataType,
  23:              data: options.data,
  24:              success: options.success,
  25:              error: options.failure
  26:          });
  27:      };
  28:  })(jQuery);

This is a simple jQuery plug-in that encapsulate the details of calling ASP .Net web services. This is pretty sweet since now I can do something like this and avoid all that set-up work every time I need to call into the back-end:

   1:  Zanzibar = {}
   2:  Zanzibar.Web = {
   3:      LocationService: {
   4:          Get: function(options) {
   5:              $.extend(options, { endPoint: "http://localhost:60088/RPC/GeoLocation.asmx/Get" });
   6:              
   7:              return $.proxy(options);
   8:          }
   9:      }
  10:  }

This becomes my proxy now. I’m extending the options with the specific end point for the web method I need to call and the usage pattern for this becomes something like the following:

   1:  Zanzibar.Web.LocationService.Get({
   2:      data: "{ userId: 10001 }",
   3:      success: successCallback,
   4:      failure: errorCallback
   5:  });

This is great, because now all I need to worry about is the actual parameters I want to call my web service with, none of the setup work is needed up front anymore. Clearly other methods can be added and you can provide a really nice, rich wrapper for a web service this way. No complex inheritance, just some simple composition and extension of passed in parameters with some default settings. I really like the $.extend() function, comes in very handy for defaulting parameters and helping cut down on verbosity somewhat. Using that cool feature I can trim the code down but I still retain the power of customizing every aspect of my web service call if I need to.

Currently rated 4.5 by 2 people

  • Currently 4.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by mateid on Wednesday, April 01, 2009 2:46 PM
Permalink | Comments (0) | Post RSSRSS comment feed