XML Schema and Web Services
Most people are advocates of taking a WSDL-first/Schema-first/Contract-first approach to Web Services. I think most people would also agree that when implementing the service using Java or C#, the tooling support for this approach leaves a lot to be desired. That being said, we still need to do this.
The scenario gets more complicated when you take into account that many industry groups have produced data standards built using XML Schema. Many of these were established well before Web Services.
What I’ve been surprised by is the lack of documentation on how to bridge these two worlds. Maybe I haven’t looked hard enough, but I haven’t come across any best practices around XML Schema design when the intent is to use them within Web Services, especially when you know you’re going to be using Java or C# for the implementation. Anyone who’s gone the code first approach knows that class members map to child elements and not to attributes of an element. So, does this mean that when designing XML schemas for use within Web Services we should avoid using attributes of elements? If we don’t, does it mean that the developers writing the service are going to have to deal with low level XML APIs? Of course, a lot of this could be avoided by using a schema-oriented development environment typically associated with BPM tools, but that platform may not be appropriate for all scenarios.
Anyone with any pointers to some best practices or documentation in this space?