Here are few tips for keeping Web Services Description Language (WSDL) documents modular and simpler to maintain:
- Import XML schemas for elements referenced by method contracts. Do not embed types/elements into the WSDL – because you will have multiple schema definitions that can quickly go out of synch. Organize XML schemas using a standard directory structure and host them externally. You can use the schemaLocation attribute to point to the physical location of the schema.
- Follow a consistent naming convention for WSDL namespaces. I use http://my-server.my-company.com/<DomainName>/<ServiceName>_<ServiceVersion>. This will make it easier for consumers when they generate service proxies and bindings.
- Use WSDL templates with variables for specifying transport specific information (e.g. when using HTTP you can have a variable for service endpoint host, port, etc. Alternatively, when using Java Message Service (JMS) you can specify queue name, user name, password etc.). Using an ant script with property files you can replace these variables with service specific values.