tags:

views:

95

answers:

1

Hello,

I'm quite a heavy user of WCF and ADO.NET data services. I use them a lot in links between different systems. Now sometimes I would update one side of such a link and forget another side. The other side will crash and most of the times give a pretty useless error about some type being not found or something like that.

Is it possible to compare the proxy generated with the actual service definition to check if the service might have been updated? That way I could throw a much more usefull error which states that the definitions are out of sync and either one of the sides should be updated to match the correct definition again.

This goes for WCF services as well as ADO.NET data services, so I'm looking for a way to compare both.

A: 

One approach that a lot of experts will call for is using versioning based on the namespaces of your methods and data contracts.

E.g. your original first version is something like this:

[ServiceContract(Namespace="http://services.yourcompany.com/YourService/2009/09")]
interface IMyService
{
 ...
}

and then if you change your service definition in October, you'd change the namespace to:

[ServiceContract(Namespace="http://services.yourcompany.com/YourService/2009/10")]
interface IMyService2
{
 ...
}

That way, you'll be sure that a client is never accidentally calling an out-of-date service, because the namespaces wouldn't match.

Another idea might be to have a "GetVersion" method on each of your services, and call that before starting to call your actual service methods, to check whether a new service version has been deployed. But for this, you're on your own - there's nothing inherently in WCF or ADO.NET DataServices to facilitate this.

Marc

marc_s
Hmm, too bad. A ValidateServiceDefinition method or something like that would be great.
Jasper

related questions