SOAP_XML_ADD_ENUM — A macro to add the name of an enum value to the serializer.
// In header: </home/maarten/projects/libzeep/zeep/xml/serialize.hpp>
SOAP_XML_ADD_ENUM(e, v)
To be able to correctly use enum values in a WSDL file or when serializing, you have to specify the enum values.
E.g., if you have a struct name Algorithm with values 'vector', 'dice' and 'jaccard' you would write:
> enum Algorithm { vector, dice, jaccard }; > SOAP_XML_ADD_ENUM(Algorithm, vector); > SOAP_XML_ADD_ENUM(Algorithm, dice); > SOAP_XML_ADD_ENUM(Algorithm, jaccard);
An alternative (better?) way to do this is:
> zeep::xml::enum_map<Algorithm>::instance("Algorithm").add_enum() > ("vector", vector) > ("dice", dice) > ("jaccard", jaccard);