Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress XML Binding Development Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

5.1 Purpose and Overview

This example illustrates the way that HydraExpress handles the any element and demonstrates how to use a configuration file to resolve naming collisions between types and elements defined in the global scope. The example also illustrates 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. SOAP 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.

Any data that will be stored within the body must be packaged as a string. We 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 a body class, the result is a string that contains 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 Hydra 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 DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.