Using the WS-I Basic Profile 1.0 in Development
By Jim Murphy
Jim is a developer for MindReef and can be contacted at [email protected].
True or false? Web services that pass the WS-I Basic Profile 1.0 are guaranteed to be interoperable. If you've been working with web services using SOAP toolkits, you no doubt correctly answered "false." But if interoperability is not guaranteed, what's the point of the WS-I and its Basic Profile?
Well, the point is that even though interoperability is the primary goal of XML Web Services, it's hard to do it in practice. (In the words of computer scientist Jan L.A. Van De Snepscheut: "In theory, there is no difference between theory and practice. But, in practice, there is.") The WS-I Basic Profile 1.0 describes the lowest common denominator for interoperable web services. But toolkit implementers still have plenty of wiggle room, thanks to optionality built into the specifications that define web-service stacks like XML 1.0 with Namespaces, SOAP 1.1, WSDL 1.1, and XML Schema.
Web-service-specification development has been an exercise in inclusion. Software development factions that normally don't see eye-to-eye on programming language, data representation, communication, or much of anything, have found a common interest in XML, and the need to integrate their systems. In the interest of keeping as many factions as possible "on the bus" and not alienating any one group, shoulds, coulds, and mays have crept into the specifications. Covering everything from how XML is serialized on a wire, to data typing, message framing, and discovery, these specs were developed without specific recommendations on how they should be combined. This causes ambiguities when you look at web services as a whole. The WS-I Basic Profile 1.0, therefore, is a vertical slice through the layers of XML Web Services specs aimed at helping pragmatic developers.
Although testing offers no guarantee for interoperability, it can still tell you what is not interoperable. It is essential to pass interoperability guidelines like the WS-I Basic Profile after deployment, but more importantly, while developing or evaluating web services.
The WS-I Basic Profile 1.0 exists as a document, but it also has an executable form in the WS-I Testing Tools and in tools like SOAPscope 3.0 from MindReef (the company I work for; http://www.mindreef.com/). SOAPscope captures and analyzes SOAP messages and WSDL documents to verify that a web service conforms to the WS-I Basic Profile 1.0. More likely, it exposes problem areas that limit use, or highlight problems in already deployed services.
In practice, problems found early in development cost less to fix than problems found after deployment. Testing against the Basic Profile could help you learn that a cornerstone in your organization's new Service-Oriented Architecture has no chance of working with SOAP toolkits other than the one you chose for implementation. Or, that RPC/encoded-style servicesstill the simplest and most obvious starting point for many toolkitsis a dead end. This makes a strong case for running analysis tools during development, when you can still respond to potential interoperability problems.
Since SOAP toolkits are often responsible for generating WSDL and serializing messages, it's easy to fall into an "out-of-sight, out-of-mind" trap, later discovering that a particular coding practice that seemed natural in a favorite language is discouraged by the WS-I Basic Profile. Consider overloaded operation names: In Java or C#, overloaded methods are common and can clarify the intention of related methods. This practice is explicitly disallowed according to R2304 of the WS-I Basic Profile 1.0 because it introduces ambiguities in a message's wire signature, making it hard to tell if a message is invalid, or just intended for a different method. It can also foil toolkits that use the operation name to dispatch messages.
Passing the WS-I Basic Profile 1.0 is an essential quality metric for any web service, whether it's one you're developing, or one you're considering using. To achieving interoperability in a webservices development project:
- Familiarize yourself with the WS-I Basic Profile 1.0.
- Continuously test for interoperability during development.
- Include interoperability tests when regression testing.
- Since you can never guarantee interoperability, so be prepared to quickly solve interoperability issues in deployed web services.
It is important to continuously check services against the WS-I Basic Profile 1.0. With SOAPscope 3.0, select a WSDL or set of messages, and click the WS-I button. SOAPscope sets up the necessary configuration, runs the C#- or Java-based WS-I Testing Tool, and displays the resulting conformance report (Figure 4). SOAPscope also includes an analysis framework that provides more information about each problem encountered, plus an interactive view that shows you where problems are located.
DDJ