Addressbook Documentation
1.0
address.cpp
Address book example XML data binding application.
Illustrates the gSOAP XML data binding with wsdl2h and soappcp2.
Copyright (C) 2000-2009 Robert A. van Engelen. All Rights Reserved.
Project Source Files
- address.xsd Address book
- address.cpp Address book app (reads/writes address.xml file)
- addresstypemap.dat Schema namespace prefix name preference
Generated Files
- address.h gSOAP data binding definitions from address.xsd
- addressStub.h C++ data binding definitions
- addressH.h Serializers
- addressC.cpp Serializers
- a.nsmap XML namespace mapping file (binds 'a' URI)
- address.xml Address book data generated by address
Compile:
- wsdl2h -g -t addresstypemap.dat address.xsd
- soapcpp2 -CS -I../../import -p address address.h
- g++ -I../.. address.cpp addressC.cpp -o address ../../stdsoap2.cpp
Run:
Additional notes:
- To instantiate class X in the engine's data space, we use the auto-generated soap_new_X(soap, -1). This allows easy deallocation with soap_destroy(soap). Use soap_new_X(soap, N) to allocate an array of N objects
- X::soap_default(soap) sets X members to default values. For C types use soap_default_X(soap, X*) to initialize values of type X
- To convert enum constants to string, we use the auto-generated soap_X2s(soap, enum X) function
- To convert a string to an enum constant, we use the auto-generated soap_s2X(soap, const char*, enum X*) function
- The struct soap context is initialized with the following flags: SOAP_XML_STRICT strictly validates XML (reader) SOAP_XML_INDENT produces indented XML (writer) SOAP_XML_CANONICAL improves the XML output by removing unnecessary xmlns bindings (writer)
Generated on Sat Nov 7 13:49:55 2009 for Addressbook by
1.3.8