The Data “main” Sample Application
HydraExpress generates a sample application that you can use if you need to manipulate the data or marshal and unmarshal your code. This application is called WeatherSummary_types_main.cpp and is located in the directory WeatherSummaryExample\app\data. Edit this file to replace the TODO items with your application logic.
 
int main()
{
// TODO: Instantiation of generated object here
 
// Use a C++ try block to handle errors that can occur when unmarshalling XML
try {
// TODO: invoke unmarshal method on generated object
} catch (const rwsf::XmlParseException &e) {
std::cerr << "Error unmashaling : " << e.what() << std::endl;
return 1;
} catch (const rwsf::Exception &e) {
std::cerr << "Error : " << e.what() << std::endl;
return 1;
} catch (...) {
std::cerr << "Unexpected Error" << std::endl;
return 1;
}
 
// TODO: manipulate tree here
 
// TODO: invoke marshal method on generated object to create XML from tree }
 
return 0;
}
 
The example WeatherSummary does not ship with an implemented sample main application, as its primary focus is to illustrate various aspects of developing Web services.
For examples that do include implemented main applications, see any example in the <installdir>\examples\xmlbinding directory.