|
Article Excerpt Developers are beginning to develop more sophisticated Web services, exchanging complex XML documents rather than simple parameter types. As this shift takes place, development teams begin to grapple with different approaches to designing these Web services interfaces through the use of WSDL. As we've worked with a number of these teams, we've begun to discover some important best practices that can be applied, particularly in the use of XML Schemas in a Web services design.
In this article, we will focus on four specific areas: XML Schema style, namespaces, XML and WSDL import for modularity, and use of schema types for platform interoperability. Through the use of these techniques, you will be able to achieve a higher degree of portability of your WSDL and XML Schemas and will realize improved reusability and interoperability between a broader collection of Web services platforms.
Design Style for Reusability and Portability
There are many ways to define an XML Schema that could be used to validate the same XML document instance. As you'll see, the design style used can impact the WSDL design and the resulting implementation classes. To better illustrate this point, consider the simple XML document in Listing 1. This might represent the kind of document submitted to a Web service for the purpose of obtaining a price quote on a list of computer parts.
As Listing 2 illustrates, a schema could be defined as one monolithic structure that closely resembles the actual XML document instance itself. While this schema will validate the document as desired, there are several potential issues in taking this approach. First, there are ambiguities in this schema that may impact the generation of helper classes on some platforms. For example, due to the fact that the complex types are unnamed, some platforms will generate the implementation helper class names as anonymous types. This can make it difficult for developers to make use of these helper classes during development.
Second, the elements of this schema are not very reusable. For example, what would happen if you wanted to define a similar schema to reflect the resulting quote response from the supplier? In this case, the "PartList" in the return document may be exactly the same. You could simply define a second document structure with "PartList" structures. However, due to the way most platforms...
|
|

Looking for additional articles?
Search our database of over 3 million articles.
Looking for more in-depth information on this industry?
Search our complete database of Industry & Market reports by text, subject, publication
name or publication date.
About Goliath
Whether you're looking for sales prospects, competitive information, company
analysis or best practices in managing your organization,
Goliath can help you meet your business needs.
Our extensive business information databases empower business
professionals with both the breadth and depth of credible,
authoritative information they need to support their business
goals. Whether it be strategic planning, sales prospecting,
company research or defining management best practices -
Goliath is your leading source for accurate information.
|
|