Category Archives: Uncategorized

WCF Services – a compatibility hack

I’ve recently had to start developing a set of WCF services for my company to use.  All good stuff, you might say – and tyou’d be right.  For the most part.

The area in which things get “interesting” is around the requirement for backwards-compatibility with some existing .Net 1.1 applications that consume traditional web services.  These applications are horrendously complex, and the fewer changes to the code base we have to make, the better.  With this in mind, we created the WCF services to mirror the old web services as closely as possible and that’s where the fun began.

The issue that set me on a journey of discovery and hackery was around a method that returned a simple boolean type.

public bool NameIsInList(string name)

{

// implementation

return true;

}

Nothing fancy there.  However, exposing the service using basicHttpBinding had an unfortunate side effect.  The method signature was refactored to :

public void NameIsInList(string name, out bool NameIsInListResult, out bool NameIsInListResultSpecified);

Less than ideal.

No matter what I tried (including contacting Amit) I couldn’t make the down-level compatible web service return a simple boolean result.  Given how much effort we would have to go to to update the calling methods in the legacy systems, I had to find another way forward.

In the end, the solution was extremely simple, if a little hacky.  Create an ASMX web service that handled the calls to the WCF service, and presents the legacy apps with the data they expect.

[WebMethod]
public bool NameIsInList(string name)
{
using (MyWcfService.ServiceClient WcfClient = new MyWcfService.ServiceClient(“WSHttpBinding_MyService”))
{
return WcfClient.NameIsInList(name);
}
}

Not the prettiest solution, but it works.

There are a few extra benefits that I wasn’t expecting from this approach, too.  I’ll post about those tomorrow.

Stack Overflow – pretty darned cool

Over the course of the last week, I have been participating in the private beta of a new website, Stack Overflow.

The site is for programmers, by programmers and focussed on – you guessed it – programming.  So far it all looks pretty sweet.  Users aren’t required to register, and more importantly they aren’t required to pay to use the service (I’m looking at you, Experts Exchange!).  The overall quality of questions and answers seems pretty high, although I understand that the site is still in beta.  The quality may change once the site goes live, but the system of self management by the community should keep standard fairly high overall.

If you want to keep up to date with the project, and hopefully learn when the public launch is going to happen check out the blog.

Wild Garden

I’ve been a bit slack with my back garden, but I have to say, I’m quite pleased that I left a couple of small patches to their own devices. They’ve sprouted a small number of wild flowers, and last weekend, they were just about as good as I’ve seen them.

The Amazing Google Strike Again!

This morning I was given a tracking number for a parcel I am expecting.  However, I didn’t get the name of the company who were to deliver it.  Not a good start if I wanted to use the tracking number to actually track the parcel.

Then I remembered a discussion at work about Google’s recognition routines, and one of my few remaining synapses fired into life.

I went to Google’s homepage, typed in my tracking number (nothing else, just the number) and hit search.  I have to admit I was very pleasantly surprised when the top of the results page said “Track UPS package 1Z6 …..  70″

Very neat.

It had to happen sometime

It is almost inevitable in the modern world that someone will manage to get hold of at least part of your identity.  It happened to me this week.

I went downstairs first thing this morning to see what snail-mail had been delivered, only to find an urgent letter from my bank.  It seems that someone has managed to get hold of my bank card details and used them to spend around 4-500 pounds of my money.  It would have been more, but something tipped the bank off that there was something wrong and the put a stop on my card.

I am happy that the bank managed to catch this behaviour, and prevented another 500 pound being spent.  I can’t help but wonder, though, whether we are all a little complacent about our details.  I’ve always taken time to destroy paperwork that could hold vital information for use by an identity thief, but it seems that is not enough.  Just using your debit or credit card in the wrong place is enough to leave you open to fraud – a quick skim of your card details is all it takes…

It’s easy to be wise after the event, but now may be a good time to fall back on using good old cash for a while.

A fun waste of time

Last night Chester was directly under a fair sized thunder storm with some really impressed bolts of lightning.  Seeing that I had my camera with me, and that it could be set for up to 3 second exposures, I decided to try to photograph some of the lightning.  Please note the use of the word “try”.  As you can imagine, it was something less than completely successful, but I am now the proud owner of about 60  almost identical digital images of the street outside my hotel with a totally calm and lightning-free sky above.

Next time…

High Royds Psychiatric Hospital

Tucked away, back from the road between Guiseley and Menston is the High Royds Psychiatric Hospital.  Or rather, the buildings that house it. 

Build by the Victorians, and originally (and gloriously) named The West Riding Pauper Lunatic Asylum, the hospital closed its doors in 2003.  Now the property developers have moved in and are making the place into luxury housing.  Fortunately for those of us with a love of architecture, the buildings are grade II listed and as a result, the developers are not allowed to alter the external structure.

As you can see from the picture below, the buildings were connected by a series of covered walkways.  Unfortunately, these are almost all gone now.  They weren’t listed in their own right, so they have been demolished to make way for car parking.

You can see some really good photos of the place over at one of the urban exploration websites, but I’d really suggest that you get over there for a look yourself before the development is finished.  If you like Victorian utilitarian architecture, you’ll love High Royds.