Keeping WSDLs Modular and Simpler to Maintain

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&gt;. 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.

Like this post? Subscribe to RSS feed or get blog updates via email.

add to del.icio.us: Digg it : post to facebook: Stumble It! : :

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: