Sharing structured data

XML Magazine

Subscribe to XML Magazine: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get XML Magazine: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


XML Authors: Jayaram Krishnaswamy, Chris Pollach, Jason Bloomberg, Peter Silva, Mehdi Daoudi

Related Topics: XML Magazine, Java Developer Magazine

XML: Article

XMLSPY 5 Enterprise Edition

XMLSPY 5 Enterprise Edition

XMLSPY Enterprise Edition version 5 provides a powerful set of XML tools and utilities to develop and test XML-based applications and Web services. Several new features that expand on its XML tool base are available in this new version, including a WSDL editor, XSL stylesheet debugger, and Java code generator. And as before, XMLSPY continues to provide powerful utilities for developing schema, DTD, and XML documents.

WSDL Editor
The WSDL editor is a new utility available within the main XMLSPY IDE that provides a graphical editor for WSDL documents. This tool presents a WSDL structure broken into four segments: operations, port types, bindings, and services. Figure 1 shows the editor with the Google API WSDL specification loaded.

 

Operations are essentially method signatures for a particular service, complete with input, output, and fault child elements. The parameters for each element may be added and removed using the context menus available while working in the WSDL editor. Parameters may be assigned types based on namespace references to existing schema documents.

The list of bindings allows the developer to create the concrete specifications for the method signatures defined in the operations panel. Each binding is mapped through a specific port type to create the association. The services panel provides the definition of the physical location of the service and the relationship to the binding that provides the structure and protocol information for the service.

The WSDL editor also provides validation capabilities to check the resulting WSDL definition integrity. Developers may make changes to the type definitions of the WSDL elements by modifying the underlying schema. Overall, the WSDL editor is a powerful utility for creating new and working with existing WSDL specifications.

SOAP and the SOAP Debugger
XMLSPY provides a set of tools to help application developers create and debug Web services and SOAP messages. The application can be set up to act as a proxy server, intercepting SOAP requests and responses and presenting them to the user for inspection and debugging. It also has the ability to create SOAP documents from a WSDL file, useful for creating test data and messages for testing individual Web services.

SOAP documents may be created manually or from a WSDL specification. To create a request from a WSDL specification, XMLSPY reads the WSDL file from a specified URL or a WSDL document already loaded into the IDE. Figure 2 shows the resulting SOAP request from the Google Search API.

 

Processing SOAP Responses and the XSLT Debugger
XMLSPY may be used to help develop the presentation of call results to Web services through its XSL Stylesheet authoring tool. This component allows developers to create transformations with minimal knowledge of the XSL language.

The Stylesheet Designer is a separate executable included with XMLSPY Enterprise Edition. It is a simple drag-and-drop interface for developing XSLT stylesheets. To create an XSL stylesheet, open an existing XML Schema and select those elements or attributes you wish to show in the output by dragging them into the desired position inside of an editing window. The stylesheet designer also supports conversion of an existing HTML file into an XML Schema, XSLT stylesheet, and the XML contents of the page.

Anyone who has developed XSL stylesheets can identify with the struggles of debugging their results. The new XSLT debugger brings traditional debugging capabilities to the world of stylesheet development. Within the main IDE, similar to the SOAP debugger, an XSL debugging session may be started to step through the XSL transformation.

As shown in Figure 3, the developer is presented with four main panels. The top portion of the screen, from left to right, includes the XML document that is being transformed, the XSL stylesheet highlighting the current execution step, and the transformation output. The bottom portion of the screen displays in-process information including the call stack, watch list, local variables, and template definitions.

 

Once started, the debugger behaves like any standard debugging engine, allowing the developer to step into, over, and out of XSL transformation processes. This utility greatly eases the tasks of developing and debugging XSL stylesheets.

XMLSPY also supports the use of XSL Formatting Objects for creating high quality output documents, such as PDFs, from XML content, and includes a single-click preview window. It also supports the use of external XSLT processors, including Xalan and MSXML.

XML and Schemas
The true strength of XMLSPY is, of course, in its application to the design and development of XML documents, schemas, and DTDs. The construction of XML Schemas is intuitive thanks to its graphical representation of a document. The properties of each schema node are easily editable through context menus available when a node is selected. Here the type, occurrences, and attributes for each node, among other characteristics, may be set. Annotations for nodes are displayed as summary text below each node.

To create DTDs and XML documents, XMLSPY presents the definition in an outline format. When working with DTDs, which are similar to schemas, the properties of each element are editable through context menus. The individual entities within the document may be expanded or contracted for readability.

XMLSPY also provides the ability to interact with databases when working with schemas and XML data. XML Schema documents may be created based on the table structure within a database. Any database is accessible via ODBC or ADO - e.g., Oracle, SQL Server, DB2, etc. Data may be imported into the application in the same manner using a single table or a select statement. As an example application, using XMLSPY's XSL stylesheet processing capability, data imported from a database can quickly and easily be converted to an alternate database schema. The results can then be exported to a database that is mapped to the alternate schema. This provides an effective environment in which to develop, test, and debug a possible data conversion utility.

A new feature in version 5 is the ability to generate program code based on a schema definition. The process builds Java or C++ classes that represent elements and data types within a schema. The Java classes are created using the JAXP API for XML while the C++ classes implement MSXML 4.0. Code generation may be customized through template files that control mappings between schema types and language primitives, the XML API used, coding conventions, and base classes. Future versions of the code generator will include support for additional languages, such as C#.

XMLSPY also provides a utility to create a set of Schemadocs for an XML schema. The output for each element includes an image depicting the element and its immediate children, links to the definitions of the children, the annotation assigned to the element, and the source code that defines the element. Schemadocs may be created in HTML or Microsoft Word format.

Summary
XMLSPY 5 Enterprise Edition continues to deliver excellent XML tools and utilities with powerful new capabilities. Its wide range of functionality allows it to be creatively applied to a Web services development environment as well as traditional development efforts using XML data. Its support of Web services standards and its ability to debug and test services and the data used in transit makes XMLSPY 5 Enterprise Edition a valuable tool in a Web services developer's arsenal.

More Stories By Brian Barbash

Brian R. Barbash is the product review editor for Web Services Journal. He is a senior consultant and technical architect for Envision Consulting, a unit of IMS Health, providing management consulting and systems integration that focuses on contracting, pricing, and account management in the pharmaceutical industry.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.