views:

28

answers:

2

We generate xml schema for our web services.

Amongst other details these schema contain the defintion of the complex types consumers of our services pass in.

Those complex types can change if our third party suppliers decide they want to add more details but as can be imagined that's something that shouldn't happen on the whim of a developer.

So we'd like to compare schemas to ensure that we're deploying what we think we ought to be and if there are changes, what they are.

There's always XMLDiffPatch.exe I guess but I wondered if anywhere in the .net framework there was some schema specific functionality that would make comparing schema more strightforward.

A: 

Not schema specific, but would a checksum work? Pretty easy in c#:

FileStream file = new FileStream(fileName, FileMode.Open);
MD5 md5 = new MD5CryptoServiceProvider();
byte[] retVal = md5.ComputeHash(file);
file.Close();
Steve Jackson
For just identifying that something has changed that'd do but for knowing what has changed......I'll edit the question to make that clear.
A: 

Maybe Xnode deepequals can be used?

It kind of depends how much can be changed without you are seeing it as a change.

Is it okay to change xml-comments?

Henrik Jepsen
Hmmm...that would do as I don't think we should have any xml-comments in the generated schema. Only thing is I'd have to do the heavy lifting identifying which node I was examining and identifying what was changed. Even if I don't use it for this it's nice to know that it exists, thanks for the heads up.Just been looking at XMLDiffPatch and that's looking promising.
Yeah, promising like a gift wrapped poo!Diffgram output is horrid to read but that would be okay if it was correct......it's not.Guess I'm writing an XML comparison tool <rolleyes>