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

5.6 The Trade Parsing Example

The trade_main.cpp example demonstrates the use of classes generated by HydraExpress to process any elements. This example uses the trade.xsd schema to generate classes for the content of the SOAP body. This section describes the code in the example and presents instructions for running the code generator and compiling the example.

The trade example first creates an instance of the class that represents the SOAP envelope, unmarshals the SOAP document into this instance, then retrieves a string that contains the first element in the SOAP body, as shown below:

//1Constructs e as an empty EnvelopeElement instance.
//2Unmarshals xmlContents into e. Note that xmlContents contains the text included in the soap.xml file.
//3Retrieves the BodyElement contained within e. The SOAP body element holds the content of the SOAP message.
//4Retrieves the vector of any elements from the SOAP body element. Since a SOAP body element can contain zero or more any elements, HydraExpress represents the contents of the SOAP body as a vector.
//5Retrieves the first element of the vector. The string s is an XML element with arbitrary content.
//6Constructs an empty GetLastTradePrice instance.
//7Unmarshals the string s into tp.
//8Outputs the symbol to standard output.


Previous fileTop of DocumentContentsIndex pageNext file

©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.