Writing WSDL
Following are a few rules for how I think WSDL documents should be created, with the goal of maximum interoperability without sacrificing flexibility. Here are my rules:
Use the 2001 recommendation XML Schema. There are many possibilities for what you can put in the <types> section of a WSDL—an earlier version of the XML Schema, Relax NG, or something else entirely. However, the most reliable and interoperable thing you can put there is a 2001 schema.
Use the <types> section. Even if all of the messages are simple data types, use the <types> section to describe everything. Don't merely refer to the types in the <message> section.
Break up your WSDL into several pieces. Take advantage of the WSDL import feature WSDL to create a WSDL for the abstract piece of the WSDL, another for the <binding> section, and one more for the service element and ports.
Start your design with a WSDL. It's fine to let ASP.NET Web Services automatically generate WSDL documents for you during prototyping, but once you decide on a design and interface layout, stay with it. This means that you will need some way to verify the WSDL against your code.
|