Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Service Backwards Compatibility Check

I have just written a new version of a WCF web service and I want to make sure that I have not made any breaking changes with regard to Service and Data contracts.

Thinking back to my days as a VB6 Com Api developer I recall how easy it was to specify the previous release version of the component at compile time, and have the compiler check that binary compatibility is being maintained.

I envisage something similar called (hopefully) a “Contract Compatibility” check. It would use the metadata to perform a similar check to the one that the VB6 dev env did. This could be done as a separate build step that would execute a utility.

I am prepared to accept that there exists no such utility out there. If that is the case, does anyone have any ideas about how the algorithm to achieve this would look?

  1. Retrieve metadata from current live service version
  2. Retrieve meta data from new service version
  3. Check Service Contract and each Data Contract for compatibility. Only reporting breaking changes.

Step 3 seems like it would be complex but certainly automatable...

like image 454
Andy McCluggage Avatar asked Mar 19 '09 18:03

Andy McCluggage


2 Answers

These situations are solved by integration/regression testing. You write integration tests for initial version and after modifying service to new version you run integration tests again using old client. If they success you didn't break anything. If they fail you see exactly what calls caused problems.

like image 106
Ladislav Mrnka Avatar answered Oct 26 '22 23:10

Ladislav Mrnka


Nothing like that exists Andy but if you get something up and running whereby you have 2 DLLs (one old and one new), you could then use something like BitDiffer to compare them.

There was a project on Codeplex that helped with WCF releases, but I can't remember what it is called, sorry.

Good luck,

-Keith

like image 44
Keith Elder Avatar answered Oct 26 '22 23:10

Keith Elder