Schema Conformance

Yesterday, at the end of Scott's talk, someone asked whether the ASP.NET Web Services Infrastructure did Schema validation of incoming SOAP Messages according to the schema defined in the WSDL types section (or imported schemas in the WSDL). I happen to think this is a pretty interesting question, actually. My first reaction was to say "No, it doesn't" (ok, I actually went ahead and said it). But then, Chris Brooks said something that left me thinking. He agreed it didn't actually do validation, but some sort of check was done, in the sense that if your WebMethod's code executed, then something about the incoming message was right: it was enough for the XmlSerializer to reconstruct the WebMethod arguments and do the call.

I thought this was an interesting idea. Certainly, one could consider this some sort of very light, very superficial validation. But perhaps "Schema Conformance" would be a better term: One could say that the incoming message "conforms" to the specified schema, in the sense that there is a one-way transformation that can be done from the incoming data to the WebMethod's arguments. That transformation will possibly include taking advantage of nullable types (in this case, I actually mean passing null for a reference type-argument), default values for value types, etc.

It's actually much more interesting if you even consider that some specific types can "conform" to almost any possible schema representing the expected incoming message schema, such as XmlNode.

PS: I'm writing this as I watch Clemens talk about his Aspect Oriented Work :)

Comments (2)

Dare ObasanjoJune 5th, 2003 at 4:01 pm

You should have attended my talk. It was all about enabling ASP.NET web services to validate the incoming message according to the schema in the WSDL document.

Chris BrooksJune 5th, 2003 at 10:49 pm

I saw both Clemens and Dare speak today, and it was very eye-opening. Dare took us half the way, showing a reasonable why to intercept in the WS pipeline to enforce schema validation. Clemens brought us home by showing how we can declaratively (in code, not XML schema) achieve the same effect. Clemens’ model will be very appealing for those that prefer code-driven schema and WS design.

Leave a comment

Your comment