Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress XML Binding Development Guide

5.1 Purpose and Overview

This example demonstrates how HydraExpress handles the any element and using a configuration file to resolve naming collisions between types and elements defined in the global scope. The example also demonstrates how HydraExpress generates code for more than one schema.

To demonstrate these features, the example generates C++ constructs for the SOAP schema. SOAP is an XML messaging protocol that provides an envelope for sending and receiving XML data and documents. The schema for SOAP uses the any element to allow any XML document to be contained within the body element of an envelope. From the SOAP schema, HydraExpress generates a class that represents the envelope and a class that represents the body.

Data to be stored within an element of any type must be packaged as a string (the body element in this case). You can either create the XML strings directly, or marshal the XML strings into the body class by using classes generated by HydraExpress.

Likewise, when extracting data from an element of any type, the result is a string containing XML. For simple content, the data is probably useful in this form. For complex content, however, you would probably want to parse the data into constituent elements. If the content of the element corresponds to classes generated by HydraExpress, you can use the generated classes to easily unmarshal the data. You can also parse the data directly using an XML parser.

Section 5.2 describes the SOAP document used in the example. Section 5.3 describes the use of a customized mapping identified in the provided project file.

The SOAP example includes two complete programs. The first program uses the rwsf::XmlReader class of the RWSF Core Library to parse the data directly. The code for this example is provided in soap_main.cpp. Section 5.4 describes the parsing example. The second program uses classes generated by HydraExpress to parse and process the data. The code for this example is provided in trade_main.cpp. Section 5.7 describes the generated class example.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.