Validating WCF-messages with WSDL

Posted by Marcus Hammarberg on August 14, 2008
Stats
When you first think about it, it's quite strange that no validation, takes place out-of-the-box ,against the WSDL that describes a service (asmx or WCF). Then you (read: I) forget it and all of a sudden you don't think that much about it; the generated proxy or services code doesn't contain logic. Period.

It's even more so when you only create services that is generating WSDL when asked. BUT (and it's a big but ;)) - when you start doing Contract First you are actually specifying the WSDL first and then generate the code... then the question arises again.

I mean you're specifying things in the WSDL that doesn't get generated into the code. Things like format, lengths and stuff like that. It's a bit strange that it's lost. And the best scenario is that it's simply validated when the request is received.

Lo and behold - here is mr Skonnard with a brilliant solution. Here are some other articles brushing on the same subject.

Thanks to Fredrik for finding this, especially since I serious doubted that it could be done. We are trying to implement it now - I'll get back to you with our experience in a while.

Published by Marcus Hammarberg on Last updated