#include #ifndef DEF_novaglobalapi_ns0_countryDto_H #define DEF_novaglobalapi_ns0_countryDto_H /** * @author Edward P. Legaspi @since Oct 4, 2013 */ struct novaglobalapi_ns0_countryDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *countryCode; /** * (no documentation provided) */ xmlChar *name; /** * (no documentation provided) */ xmlChar *currencyCode; /** * (no documentation provided) */ xmlChar *languageCode; }; /** * Reads a CountryDto element from XML. The element to be read is "country", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The CountryDto, or NULL in case of error. */ struct novaglobalapi_ns0_countryDto *xml_read_novaglobalapi_ns0_countryDto(xmlTextReaderPtr reader); /** * Writes a CountryDto to XML under element name "country". * * @param writer The XML writer. * @param _countryDto The CountryDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_countryDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryDto *_countryDto); /** * Frees a CountryDto. * * @param _countryDto The CountryDto to free. */ void free_novaglobalapi_ns0_countryDto(struct novaglobalapi_ns0_countryDto *_countryDto); /** * Reads a CountryDto element from XML. The element to be read is "country", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The CountryDto, or NULL in case of error. */ struct novaglobalapi_ns0_countryDto *xmlTextReaderReadNs0CountryElement(xmlTextReaderPtr reader); /** * Writes a CountryDto to XML under element name "country". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _countryDto The CountryDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CountryElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryDto *_countryDto); /** * Writes a CountryDto to XML under element name "country". * * @param writer The XML writer. * @param _countryDto The CountryDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CountryElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryDto *_countryDto, int writeNamespaces); /** * Frees the children of a CountryDto. * * @param _countryDto The CountryDto whose children are to be free. */ static void freeNs0CountryElement(struct novaglobalapi_ns0_countryDto *_countryDto); /** * Reads a CountryDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The CountryDto, or NULL in case of error. */ static struct novaglobalapi_ns0_countryDto *xmlTextReaderReadNs0CountryDtoType(xmlTextReaderPtr reader); /** * Writes a CountryDto to XML. * * @param writer The XML writer. * @param _countryDto The CountryDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CountryDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryDto *_countryDto); /** * Frees the elements of a CountryDto. * * @param _countryDto The CountryDto to free. */ static void freeNs0CountryDtoType(struct novaglobalapi_ns0_countryDto *_countryDto); #endif /* DEF_novaglobalapi_ns0_countryDto_H */ #ifndef DEF_novaglobalapi_ns0_countryTaxDto_H #define DEF_novaglobalapi_ns0_countryTaxDto_H /** * @author Edward P. Legaspi @since Oct 11, 2013 */ struct novaglobalapi_ns0_countryTaxDto { /** * (no documentation provided) */ xmlChar *countryCode; /** * (no documentation provided) */ xmlChar *taxValue; }; /** * Reads a CountryTaxDto element from XML. The element to be read is "countryTax", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The CountryTaxDto, or NULL in case of error. */ struct novaglobalapi_ns0_countryTaxDto *xml_read_novaglobalapi_ns0_countryTaxDto(xmlTextReaderPtr reader); /** * Writes a CountryTaxDto to XML under element name "countryTax". * * @param writer The XML writer. * @param _countryTaxDto The CountryTaxDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_countryTaxDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto); /** * Frees a CountryTaxDto. * * @param _countryTaxDto The CountryTaxDto to free. */ void free_novaglobalapi_ns0_countryTaxDto(struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto); /** * Reads a CountryTaxDto element from XML. The element to be read is "countryTax", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The CountryTaxDto, or NULL in case of error. */ struct novaglobalapi_ns0_countryTaxDto *xmlTextReaderReadNs0CountryTaxElement(xmlTextReaderPtr reader); /** * Writes a CountryTaxDto to XML under element name "countryTax". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _countryTaxDto The CountryTaxDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CountryTaxElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto); /** * Writes a CountryTaxDto to XML under element name "countryTax". * * @param writer The XML writer. * @param _countryTaxDto The CountryTaxDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CountryTaxElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto, int writeNamespaces); /** * Frees the children of a CountryTaxDto. * * @param _countryTaxDto The CountryTaxDto whose children are to be free. */ static void freeNs0CountryTaxElement(struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto); /** * Reads a CountryTaxDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The CountryTaxDto, or NULL in case of error. */ static struct novaglobalapi_ns0_countryTaxDto *xmlTextReaderReadNs0CountryTaxDtoType(xmlTextReaderPtr reader); /** * Writes a CountryTaxDto to XML. * * @param writer The XML writer. * @param _countryTaxDto The CountryTaxDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CountryTaxDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto); /** * Frees the elements of a CountryTaxDto. * * @param _countryTaxDto The CountryTaxDto to free. */ static void freeNs0CountryTaxDtoType(struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto); #endif /* DEF_novaglobalapi_ns0_countryTaxDto_H */ #ifndef DEF_novaglobalapi_ns0_creditLimitDto_H #define DEF_novaglobalapi_ns0_creditLimitDto_H /** * @author Edward P. Legaspi @since Nov 13, 2013 */ struct novaglobalapi_ns0_creditLimitDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *organizationId; /** * (no documentation provided) */ xmlChar *creditLimit; }; /** * Reads a CreditLimitDto element from XML. The element to be read is "creditLimit", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The CreditLimitDto, or NULL in case of error. */ struct novaglobalapi_ns0_creditLimitDto *xml_read_novaglobalapi_ns0_creditLimitDto(xmlTextReaderPtr reader); /** * Writes a CreditLimitDto to XML under element name "creditLimit". * * @param writer The XML writer. * @param _creditLimitDto The CreditLimitDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_creditLimitDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto); /** * Frees a CreditLimitDto. * * @param _creditLimitDto The CreditLimitDto to free. */ void free_novaglobalapi_ns0_creditLimitDto(struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto); /** * Reads a CreditLimitDto element from XML. The element to be read is "creditLimit", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The CreditLimitDto, or NULL in case of error. */ struct novaglobalapi_ns0_creditLimitDto *xmlTextReaderReadNs0CreditLimitElement(xmlTextReaderPtr reader); /** * Writes a CreditLimitDto to XML under element name "creditLimit". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _creditLimitDto The CreditLimitDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CreditLimitElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto); /** * Writes a CreditLimitDto to XML under element name "creditLimit". * * @param writer The XML writer. * @param _creditLimitDto The CreditLimitDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CreditLimitElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto, int writeNamespaces); /** * Frees the children of a CreditLimitDto. * * @param _creditLimitDto The CreditLimitDto whose children are to be free. */ static void freeNs0CreditLimitElement(struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto); /** * Reads a CreditLimitDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The CreditLimitDto, or NULL in case of error. */ static struct novaglobalapi_ns0_creditLimitDto *xmlTextReaderReadNs0CreditLimitDtoType(xmlTextReaderPtr reader); /** * Writes a CreditLimitDto to XML. * * @param writer The XML writer. * @param _creditLimitDto The CreditLimitDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CreditLimitDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto); /** * Frees the elements of a CreditLimitDto. * * @param _creditLimitDto The CreditLimitDto to free. */ static void freeNs0CreditLimitDtoType(struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto); #endif /* DEF_novaglobalapi_ns0_creditLimitDto_H */ #ifndef DEF_novaglobalapi_ns0_descriptionDto_H #define DEF_novaglobalapi_ns0_descriptionDto_H /** * @author Edward P. Legaspi @since Oct 16, 2013 */ struct novaglobalapi_ns0_descriptionDto { /** * (no documentation provided) */ xmlChar *languageCode; /** * (no documentation provided) */ xmlChar *description; }; /** * Reads a DescriptionDto element from XML. The element to be read is "description", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The DescriptionDto, or NULL in case of error. */ struct novaglobalapi_ns0_descriptionDto *xml_read_novaglobalapi_ns0_descriptionDto(xmlTextReaderPtr reader); /** * Writes a DescriptionDto to XML under element name "description". * * @param writer The XML writer. * @param _descriptionDto The DescriptionDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_descriptionDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_descriptionDto *_descriptionDto); /** * Frees a DescriptionDto. * * @param _descriptionDto The DescriptionDto to free. */ void free_novaglobalapi_ns0_descriptionDto(struct novaglobalapi_ns0_descriptionDto *_descriptionDto); /** * Reads a DescriptionDto element from XML. The element to be read is "description", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The DescriptionDto, or NULL in case of error. */ struct novaglobalapi_ns0_descriptionDto *xmlTextReaderReadNs0DescriptionElement(xmlTextReaderPtr reader); /** * Writes a DescriptionDto to XML under element name "description". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _descriptionDto The DescriptionDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0DescriptionElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_descriptionDto *_descriptionDto); /** * Writes a DescriptionDto to XML under element name "description". * * @param writer The XML writer. * @param _descriptionDto The DescriptionDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0DescriptionElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_descriptionDto *_descriptionDto, int writeNamespaces); /** * Frees the children of a DescriptionDto. * * @param _descriptionDto The DescriptionDto whose children are to be free. */ static void freeNs0DescriptionElement(struct novaglobalapi_ns0_descriptionDto *_descriptionDto); /** * Reads a DescriptionDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The DescriptionDto, or NULL in case of error. */ static struct novaglobalapi_ns0_descriptionDto *xmlTextReaderReadNs0DescriptionDtoType(xmlTextReaderPtr reader); /** * Writes a DescriptionDto to XML. * * @param writer The XML writer. * @param _descriptionDto The DescriptionDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0DescriptionDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_descriptionDto *_descriptionDto); /** * Frees the elements of a DescriptionDto. * * @param _descriptionDto The DescriptionDto to free. */ static void freeNs0DescriptionDtoType(struct novaglobalapi_ns0_descriptionDto *_descriptionDto); #endif /* DEF_novaglobalapi_ns0_descriptionDto_H */ #ifndef DEF_novaglobalapi_ns0_offerDto_H #define DEF_novaglobalapi_ns0_offerDto_H /** * @author Edward P. Legaspi @since Oct 11, 2013 */ struct novaglobalapi_ns0_offerDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *offerId; /** * (no documentation provided) */ struct novaglobalapi_ns0_descriptionDto *descriptions; /** * Size of the descriptions array. */ int _sizeof_descriptions; /** * (no documentation provided) */ xmlChar *services; /** * Size of the services array. */ int _sizeof_services; }; /** * Reads a OfferDto element from XML. The element to be read is "offer", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The OfferDto, or NULL in case of error. */ struct novaglobalapi_ns0_offerDto *xml_read_novaglobalapi_ns0_offerDto(xmlTextReaderPtr reader); /** * Writes a OfferDto to XML under element name "offer". * * @param writer The XML writer. * @param _offerDto The OfferDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_offerDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerDto *_offerDto); /** * Frees a OfferDto. * * @param _offerDto The OfferDto to free. */ void free_novaglobalapi_ns0_offerDto(struct novaglobalapi_ns0_offerDto *_offerDto); /** * Reads a OfferDto element from XML. The element to be read is "offer", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The OfferDto, or NULL in case of error. */ struct novaglobalapi_ns0_offerDto *xmlTextReaderReadNs0OfferElement(xmlTextReaderPtr reader); /** * Writes a OfferDto to XML under element name "offer". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _offerDto The OfferDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0OfferElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerDto *_offerDto); /** * Writes a OfferDto to XML under element name "offer". * * @param writer The XML writer. * @param _offerDto The OfferDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0OfferElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerDto *_offerDto, int writeNamespaces); /** * Frees the children of a OfferDto. * * @param _offerDto The OfferDto whose children are to be free. */ static void freeNs0OfferElement(struct novaglobalapi_ns0_offerDto *_offerDto); /** * Reads a OfferDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The OfferDto, or NULL in case of error. */ static struct novaglobalapi_ns0_offerDto *xmlTextReaderReadNs0OfferDtoType(xmlTextReaderPtr reader); /** * Writes a OfferDto to XML. * * @param writer The XML writer. * @param _offerDto The OfferDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0OfferDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerDto *_offerDto); /** * Frees the elements of a OfferDto. * * @param _offerDto The OfferDto to free. */ static void freeNs0OfferDtoType(struct novaglobalapi_ns0_offerDto *_offerDto); #endif /* DEF_novaglobalapi_ns0_offerDto_H */ #ifndef DEF_novaglobalapi_ns0_offerPricePlanDto_H #define DEF_novaglobalapi_ns0_offerPricePlanDto_H /** * @author Edward P. Legaspi @since Oct 11, 2013 */ struct novaglobalapi_ns0_offerPricePlanDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *offerId; /** * (no documentation provided) */ xmlChar *organizationId; /** * (no documentation provided) */ xmlChar *taxId; /** * (no documentation provided) */ int *subscriptionProrata; /** * (no documentation provided) */ int *terminationProrata; /** * (no documentation provided) */ int *applyInAdvance; /** * (no documentation provided) */ xmlChar *param1; /** * (no documentation provided) */ xmlChar *param2; /** * (no documentation provided) */ xmlChar *param3; /** * (no documentation provided) */ int *billingPeriod; /** * (no documentation provided) */ struct novaglobalapi_ns0_recurringChargeDto *recurringCharges; /** * Size of the recurringCharges array. */ int _sizeof_recurringCharges; /** * (no documentation provided) */ xmlChar *usageUnit; /** * (no documentation provided) */ struct novaglobalapi_ns0_usageChargeDto *usageCharges; /** * Size of the usageCharges array. */ int _sizeof_usageCharges; /** * (no documentation provided) */ struct novaglobalapi_ns0_subscriptionFeeDto *subscriptionFees; /** * Size of the subscriptionFees array. */ int _sizeof_subscriptionFees; /** * (no documentation provided) */ struct novaglobalapi_ns0_terminationFeeDto *terminationFees; /** * Size of the terminationFees array. */ int _sizeof_terminationFees; }; /** * Reads a OfferPricePlanDto element from XML. The element to be read is "offerPricePlan", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The OfferPricePlanDto, or NULL in case of error. */ struct novaglobalapi_ns0_offerPricePlanDto *xml_read_novaglobalapi_ns0_offerPricePlanDto(xmlTextReaderPtr reader); /** * Writes a OfferPricePlanDto to XML under element name "offerPricePlan". * * @param writer The XML writer. * @param _offerPricePlanDto The OfferPricePlanDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_offerPricePlanDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto); /** * Frees a OfferPricePlanDto. * * @param _offerPricePlanDto The OfferPricePlanDto to free. */ void free_novaglobalapi_ns0_offerPricePlanDto(struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto); /** * Reads a OfferPricePlanDto element from XML. The element to be read is "offerPricePlan", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The OfferPricePlanDto, or NULL in case of error. */ struct novaglobalapi_ns0_offerPricePlanDto *xmlTextReaderReadNs0OfferPricePlanElement(xmlTextReaderPtr reader); /** * Writes a OfferPricePlanDto to XML under element name "offerPricePlan". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _offerPricePlanDto The OfferPricePlanDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0OfferPricePlanElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto); /** * Writes a OfferPricePlanDto to XML under element name "offerPricePlan". * * @param writer The XML writer. * @param _offerPricePlanDto The OfferPricePlanDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0OfferPricePlanElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto, int writeNamespaces); /** * Frees the children of a OfferPricePlanDto. * * @param _offerPricePlanDto The OfferPricePlanDto whose children are to be free. */ static void freeNs0OfferPricePlanElement(struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto); /** * Reads a OfferPricePlanDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The OfferPricePlanDto, or NULL in case of error. */ static struct novaglobalapi_ns0_offerPricePlanDto *xmlTextReaderReadNs0OfferPricePlanDtoType(xmlTextReaderPtr reader); /** * Writes a OfferPricePlanDto to XML. * * @param writer The XML writer. * @param _offerPricePlanDto The OfferPricePlanDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0OfferPricePlanDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto); /** * Frees the elements of a OfferPricePlanDto. * * @param _offerPricePlanDto The OfferPricePlanDto to free. */ static void freeNs0OfferPricePlanDtoType(struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto); #endif /* DEF_novaglobalapi_ns0_offerPricePlanDto_H */ #ifndef DEF_novaglobalapi_ns0_organizationDto_H #define DEF_novaglobalapi_ns0_organizationDto_H /** * @author Edward P. Legaspi @since Oct 11, 2013 */ struct novaglobalapi_ns0_organizationDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *organizationId; /** * (no documentation provided) */ xmlChar *name; /** * (no documentation provided) */ xmlChar *parentId; /** * (no documentation provided) */ xmlChar *countryCode; /** * (no documentation provided) */ xmlChar *defaultCurrencyCode; }; /** * Reads a OrganizationDto element from XML. The element to be read is "organization", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The OrganizationDto, or NULL in case of error. */ struct novaglobalapi_ns0_organizationDto *xml_read_novaglobalapi_ns0_organizationDto(xmlTextReaderPtr reader); /** * Writes a OrganizationDto to XML under element name "organization". * * @param writer The XML writer. * @param _organizationDto The OrganizationDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_organizationDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_organizationDto *_organizationDto); /** * Frees a OrganizationDto. * * @param _organizationDto The OrganizationDto to free. */ void free_novaglobalapi_ns0_organizationDto(struct novaglobalapi_ns0_organizationDto *_organizationDto); /** * Reads a OrganizationDto element from XML. The element to be read is "organization", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The OrganizationDto, or NULL in case of error. */ struct novaglobalapi_ns0_organizationDto *xmlTextReaderReadNs0OrganizationElement(xmlTextReaderPtr reader); /** * Writes a OrganizationDto to XML under element name "organization". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _organizationDto The OrganizationDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0OrganizationElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_organizationDto *_organizationDto); /** * Writes a OrganizationDto to XML under element name "organization". * * @param writer The XML writer. * @param _organizationDto The OrganizationDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0OrganizationElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_organizationDto *_organizationDto, int writeNamespaces); /** * Frees the children of a OrganizationDto. * * @param _organizationDto The OrganizationDto whose children are to be free. */ static void freeNs0OrganizationElement(struct novaglobalapi_ns0_organizationDto *_organizationDto); /** * Reads a OrganizationDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The OrganizationDto, or NULL in case of error. */ static struct novaglobalapi_ns0_organizationDto *xmlTextReaderReadNs0OrganizationDtoType(xmlTextReaderPtr reader); /** * Writes a OrganizationDto to XML. * * @param writer The XML writer. * @param _organizationDto The OrganizationDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0OrganizationDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_organizationDto *_organizationDto); /** * Frees the elements of a OrganizationDto. * * @param _organizationDto The OrganizationDto to free. */ static void freeNs0OrganizationDtoType(struct novaglobalapi_ns0_organizationDto *_organizationDto); #endif /* DEF_novaglobalapi_ns0_organizationDto_H */ #ifndef DEF_novaglobalapi_ns0_recurringChargeDto_H #define DEF_novaglobalapi_ns0_recurringChargeDto_H /** * @author Edward P. Legaspi @since Nov 4, 2013 */ struct novaglobalapi_ns0_recurringChargeDto { /** * (no documentation provided) */ xmlChar *currencyCode; /** * (no documentation provided) */ struct tm *startDate; /** * (no documentation provided) */ struct tm *endDate; /** * (no documentation provided) */ int *minAge; /** * (no documentation provided) */ int *maxAge; /** * (no documentation provided) */ xmlChar *price; /** * (no documentation provided) */ xmlChar *recommendedPrice; }; /** * Reads a RecurringChargeDto element from XML. The element to be read is "recurringCharge", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The RecurringChargeDto, or NULL in case of error. */ struct novaglobalapi_ns0_recurringChargeDto *xml_read_novaglobalapi_ns0_recurringChargeDto(xmlTextReaderPtr reader); /** * Writes a RecurringChargeDto to XML under element name "recurringCharge". * * @param writer The XML writer. * @param _recurringChargeDto The RecurringChargeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_recurringChargeDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto); /** * Frees a RecurringChargeDto. * * @param _recurringChargeDto The RecurringChargeDto to free. */ void free_novaglobalapi_ns0_recurringChargeDto(struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto); /** * Reads a RecurringChargeDto element from XML. The element to be read is "recurringCharge", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The RecurringChargeDto, or NULL in case of error. */ struct novaglobalapi_ns0_recurringChargeDto *xmlTextReaderReadNs0RecurringChargeElement(xmlTextReaderPtr reader); /** * Writes a RecurringChargeDto to XML under element name "recurringCharge". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _recurringChargeDto The RecurringChargeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0RecurringChargeElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto); /** * Writes a RecurringChargeDto to XML under element name "recurringCharge". * * @param writer The XML writer. * @param _recurringChargeDto The RecurringChargeDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0RecurringChargeElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto, int writeNamespaces); /** * Frees the children of a RecurringChargeDto. * * @param _recurringChargeDto The RecurringChargeDto whose children are to be free. */ static void freeNs0RecurringChargeElement(struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto); /** * Reads a RecurringChargeDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The RecurringChargeDto, or NULL in case of error. */ static struct novaglobalapi_ns0_recurringChargeDto *xmlTextReaderReadNs0RecurringChargeDtoType(xmlTextReaderPtr reader); /** * Writes a RecurringChargeDto to XML. * * @param writer The XML writer. * @param _recurringChargeDto The RecurringChargeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0RecurringChargeDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto); /** * Frees the elements of a RecurringChargeDto. * * @param _recurringChargeDto The RecurringChargeDto to free. */ static void freeNs0RecurringChargeDtoType(struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto); #endif /* DEF_novaglobalapi_ns0_recurringChargeDto_H */ #ifndef DEF_novaglobalapi_ns0_serviceDto_H #define DEF_novaglobalapi_ns0_serviceDto_H /** * @author Edward P. Legaspi @since Oct 11, 2013 */ struct novaglobalapi_ns0_serviceDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *serviceId; /** * (no documentation provided) */ struct novaglobalapi_ns0_descriptionDto *descriptions; /** * Size of the descriptions array. */ int _sizeof_descriptions; }; /** * Reads a ServiceDto element from XML. The element to be read is "service", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ServiceDto, or NULL in case of error. */ struct novaglobalapi_ns0_serviceDto *xml_read_novaglobalapi_ns0_serviceDto(xmlTextReaderPtr reader); /** * Writes a ServiceDto to XML under element name "service". * * @param writer The XML writer. * @param _serviceDto The ServiceDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_serviceDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceDto *_serviceDto); /** * Frees a ServiceDto. * * @param _serviceDto The ServiceDto to free. */ void free_novaglobalapi_ns0_serviceDto(struct novaglobalapi_ns0_serviceDto *_serviceDto); /** * Reads a ServiceDto element from XML. The element to be read is "service", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The ServiceDto, or NULL in case of error. */ struct novaglobalapi_ns0_serviceDto *xmlTextReaderReadNs0ServiceElement(xmlTextReaderPtr reader); /** * Writes a ServiceDto to XML under element name "service". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _serviceDto The ServiceDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ServiceElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceDto *_serviceDto); /** * Writes a ServiceDto to XML under element name "service". * * @param writer The XML writer. * @param _serviceDto The ServiceDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ServiceElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceDto *_serviceDto, int writeNamespaces); /** * Frees the children of a ServiceDto. * * @param _serviceDto The ServiceDto whose children are to be free. */ static void freeNs0ServiceElement(struct novaglobalapi_ns0_serviceDto *_serviceDto); /** * Reads a ServiceDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The ServiceDto, or NULL in case of error. */ static struct novaglobalapi_ns0_serviceDto *xmlTextReaderReadNs0ServiceDtoType(xmlTextReaderPtr reader); /** * Writes a ServiceDto to XML. * * @param writer The XML writer. * @param _serviceDto The ServiceDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ServiceDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceDto *_serviceDto); /** * Frees the elements of a ServiceDto. * * @param _serviceDto The ServiceDto to free. */ static void freeNs0ServiceDtoType(struct novaglobalapi_ns0_serviceDto *_serviceDto); #endif /* DEF_novaglobalapi_ns0_serviceDto_H */ #ifndef DEF_novaglobalapi_ns0_servicePricePlanDto_H #define DEF_novaglobalapi_ns0_servicePricePlanDto_H /** * @author Edward P. Legaspi @since Oct 11, 2013 */ struct novaglobalapi_ns0_servicePricePlanDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *serviceId; /** * (no documentation provided) */ xmlChar *organizationId; /** * (no documentation provided) */ xmlChar *taxId; /** * (no documentation provided) */ int *subscriptionProrata; /** * (no documentation provided) */ int *terminationProrata; /** * (no documentation provided) */ int *applyInAdvance; /** * (no documentation provided) */ xmlChar *param1; /** * (no documentation provided) */ xmlChar *param2; /** * (no documentation provided) */ xmlChar *param3; /** * (no documentation provided) */ int *billingPeriod; /** * (no documentation provided) */ struct novaglobalapi_ns0_recurringChargeDto *recurringCharges; /** * Size of the recurringCharges array. */ int _sizeof_recurringCharges; /** * (no documentation provided) */ xmlChar *usageUnit; /** * (no documentation provided) */ struct novaglobalapi_ns0_usageChargeDto *usageCharges; /** * Size of the usageCharges array. */ int _sizeof_usageCharges; /** * (no documentation provided) */ struct novaglobalapi_ns0_subscriptionFeeDto *subscriptionFees; /** * Size of the subscriptionFees array. */ int _sizeof_subscriptionFees; /** * (no documentation provided) */ struct novaglobalapi_ns0_terminationFeeDto *terminationFees; /** * Size of the terminationFees array. */ int _sizeof_terminationFees; }; /** * Reads a ServicePricePlanDto element from XML. The element to be read is "servicePlan", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ServicePricePlanDto, or NULL in case of error. */ struct novaglobalapi_ns0_servicePricePlanDto *xml_read_novaglobalapi_ns0_servicePricePlanDto(xmlTextReaderPtr reader); /** * Writes a ServicePricePlanDto to XML under element name "servicePlan". * * @param writer The XML writer. * @param _servicePricePlanDto The ServicePricePlanDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_servicePricePlanDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto); /** * Frees a ServicePricePlanDto. * * @param _servicePricePlanDto The ServicePricePlanDto to free. */ void free_novaglobalapi_ns0_servicePricePlanDto(struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto); /** * Reads a ServicePricePlanDto element from XML. The element to be read is "servicePlan", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The ServicePricePlanDto, or NULL in case of error. */ struct novaglobalapi_ns0_servicePricePlanDto *xmlTextReaderReadNs0ServicePlanElement(xmlTextReaderPtr reader); /** * Writes a ServicePricePlanDto to XML under element name "servicePlan". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _servicePricePlanDto The ServicePricePlanDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ServicePlanElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto); /** * Writes a ServicePricePlanDto to XML under element name "servicePlan". * * @param writer The XML writer. * @param _servicePricePlanDto The ServicePricePlanDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ServicePlanElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto, int writeNamespaces); /** * Frees the children of a ServicePricePlanDto. * * @param _servicePricePlanDto The ServicePricePlanDto whose children are to be free. */ static void freeNs0ServicePlanElement(struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto); /** * Reads a ServicePricePlanDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The ServicePricePlanDto, or NULL in case of error. */ static struct novaglobalapi_ns0_servicePricePlanDto *xmlTextReaderReadNs0ServicePricePlanDtoType(xmlTextReaderPtr reader); /** * Writes a ServicePricePlanDto to XML. * * @param writer The XML writer. * @param _servicePricePlanDto The ServicePricePlanDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ServicePricePlanDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto); /** * Frees the elements of a ServicePricePlanDto. * * @param _servicePricePlanDto The ServicePricePlanDto to free. */ static void freeNs0ServicePricePlanDtoType(struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto); #endif /* DEF_novaglobalapi_ns0_servicePricePlanDto_H */ #ifndef DEF_novaglobalapi_ns0_serviceToAddDto_H #define DEF_novaglobalapi_ns0_serviceToAddDto_H /** * @author Edward P. Legaspi @since Nov 13, 2013 */ struct novaglobalapi_ns0_serviceToAddDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *serviceId; /** * (no documentation provided) */ struct tm *subscriptionDate; /** * (no documentation provided) */ xmlChar *param1; /** * (no documentation provided) */ xmlChar *param2; /** * (no documentation provided) */ xmlChar *param3; }; /** * Reads a ServiceToAddDto element from XML. The element to be read is "serviceToAdd", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ServiceToAddDto, or NULL in case of error. */ struct novaglobalapi_ns0_serviceToAddDto *xml_read_novaglobalapi_ns0_serviceToAddDto(xmlTextReaderPtr reader); /** * Writes a ServiceToAddDto to XML under element name "serviceToAdd". * * @param writer The XML writer. * @param _serviceToAddDto The ServiceToAddDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_serviceToAddDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto); /** * Frees a ServiceToAddDto. * * @param _serviceToAddDto The ServiceToAddDto to free. */ void free_novaglobalapi_ns0_serviceToAddDto(struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto); /** * Reads a ServiceToAddDto element from XML. The element to be read is "serviceToAdd", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The ServiceToAddDto, or NULL in case of error. */ struct novaglobalapi_ns0_serviceToAddDto *xmlTextReaderReadNs0ServiceToAddElement(xmlTextReaderPtr reader); /** * Writes a ServiceToAddDto to XML under element name "serviceToAdd". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _serviceToAddDto The ServiceToAddDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ServiceToAddElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto); /** * Writes a ServiceToAddDto to XML under element name "serviceToAdd". * * @param writer The XML writer. * @param _serviceToAddDto The ServiceToAddDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ServiceToAddElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto, int writeNamespaces); /** * Frees the children of a ServiceToAddDto. * * @param _serviceToAddDto The ServiceToAddDto whose children are to be free. */ static void freeNs0ServiceToAddElement(struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto); /** * Reads a ServiceToAddDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The ServiceToAddDto, or NULL in case of error. */ static struct novaglobalapi_ns0_serviceToAddDto *xmlTextReaderReadNs0ServiceToAddDtoType(xmlTextReaderPtr reader); /** * Writes a ServiceToAddDto to XML. * * @param writer The XML writer. * @param _serviceToAddDto The ServiceToAddDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ServiceToAddDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto); /** * Frees the elements of a ServiceToAddDto. * * @param _serviceToAddDto The ServiceToAddDto to free. */ static void freeNs0ServiceToAddDtoType(struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto); #endif /* DEF_novaglobalapi_ns0_serviceToAddDto_H */ #ifndef DEF_novaglobalapi_ns0_subscriptionFeeDto_H #define DEF_novaglobalapi_ns0_subscriptionFeeDto_H /** * @author Edward P. Legaspi @since Nov 4, 2013 */ struct novaglobalapi_ns0_subscriptionFeeDto { /** * (no documentation provided) */ xmlChar *currencyCode; /** * (no documentation provided) */ struct tm *startDate; /** * (no documentation provided) */ struct tm *endDate; /** * (no documentation provided) */ xmlChar *price; /** * (no documentation provided) */ xmlChar *recommendedPrice; }; /** * Reads a SubscriptionFeeDto element from XML. The element to be read is "subscriptionFee", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The SubscriptionFeeDto, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionFeeDto *xml_read_novaglobalapi_ns0_subscriptionFeeDto(xmlTextReaderPtr reader); /** * Writes a SubscriptionFeeDto to XML under element name "subscriptionFee". * * @param writer The XML writer. * @param _subscriptionFeeDto The SubscriptionFeeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_subscriptionFeeDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto); /** * Frees a SubscriptionFeeDto. * * @param _subscriptionFeeDto The SubscriptionFeeDto to free. */ void free_novaglobalapi_ns0_subscriptionFeeDto(struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto); /** * Reads a SubscriptionFeeDto element from XML. The element to be read is "subscriptionFee", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The SubscriptionFeeDto, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionFeeDto *xmlTextReaderReadNs0SubscriptionFeeElement(xmlTextReaderPtr reader); /** * Writes a SubscriptionFeeDto to XML under element name "subscriptionFee". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _subscriptionFeeDto The SubscriptionFeeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0SubscriptionFeeElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto); /** * Writes a SubscriptionFeeDto to XML under element name "subscriptionFee". * * @param writer The XML writer. * @param _subscriptionFeeDto The SubscriptionFeeDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0SubscriptionFeeElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto, int writeNamespaces); /** * Frees the children of a SubscriptionFeeDto. * * @param _subscriptionFeeDto The SubscriptionFeeDto whose children are to be free. */ static void freeNs0SubscriptionFeeElement(struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto); /** * Reads a SubscriptionFeeDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The SubscriptionFeeDto, or NULL in case of error. */ static struct novaglobalapi_ns0_subscriptionFeeDto *xmlTextReaderReadNs0SubscriptionFeeDtoType(xmlTextReaderPtr reader); /** * Writes a SubscriptionFeeDto to XML. * * @param writer The XML writer. * @param _subscriptionFeeDto The SubscriptionFeeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0SubscriptionFeeDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto); /** * Frees the elements of a SubscriptionFeeDto. * * @param _subscriptionFeeDto The SubscriptionFeeDto to free. */ static void freeNs0SubscriptionFeeDtoType(struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto); #endif /* DEF_novaglobalapi_ns0_subscriptionFeeDto_H */ #ifndef DEF_novaglobalapi_ns0_subscriptionWithCreditLimitDto_H #define DEF_novaglobalapi_ns0_subscriptionWithCreditLimitDto_H /** * @author Edward P. Legaspi @since Nov 13, 2013 */ struct novaglobalapi_ns0_subscriptionWithCreditLimitDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *userId; /** * (no documentation provided) */ xmlChar *organizationId; /** * (no documentation provided) */ xmlChar *offerId; /** * (no documentation provided) */ struct novaglobalapi_ns0_serviceToAddDto *servicesToAdd; /** * Size of the servicesToAdd array. */ int _sizeof_servicesToAdd; /** * (no documentation provided) */ struct novaglobalapi_ns0_creditLimitDto *creditLimits; /** * Size of the creditLimits array. */ int _sizeof_creditLimits; /** * (no documentation provided) */ struct tm *subscriptionDate; }; /** * Reads a SubscriptionWithCreditLimitDto element from XML. The element to be read is "subscriptionWithCreditLimitDto", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitDto, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *xml_read_novaglobalapi_ns0_subscriptionWithCreditLimitDto(xmlTextReaderPtr reader); /** * Writes a SubscriptionWithCreditLimitDto to XML under element name "subscriptionWithCreditLimitDto". * * @param writer The XML writer. * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_subscriptionWithCreditLimitDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto); /** * Frees a SubscriptionWithCreditLimitDto. * * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to free. */ void free_novaglobalapi_ns0_subscriptionWithCreditLimitDto(struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto); /** * Reads a SubscriptionWithCreditLimitDto element from XML. The element to be read is "subscriptionWithCreditLimitDto", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitDto, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *xmlTextReaderReadNs0SubscriptionWithCreditLimitDtoElement(xmlTextReaderPtr reader); /** * Writes a SubscriptionWithCreditLimitDto to XML under element name "subscriptionWithCreditLimitDto". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitDtoElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto); /** * Writes a SubscriptionWithCreditLimitDto to XML under element name "subscriptionWithCreditLimitDto". * * @param writer The XML writer. * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitDtoElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto, int writeNamespaces); /** * Frees the children of a SubscriptionWithCreditLimitDto. * * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto whose children are to be free. */ static void freeNs0SubscriptionWithCreditLimitDtoElement(struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto); /** * Reads a SubscriptionWithCreditLimitDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitDto, or NULL in case of error. */ static struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *xmlTextReaderReadNs0SubscriptionWithCreditLimitDtoType(xmlTextReaderPtr reader); /** * Writes a SubscriptionWithCreditLimitDto to XML. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto); /** * Frees the elements of a SubscriptionWithCreditLimitDto. * * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to free. */ static void freeNs0SubscriptionWithCreditLimitDtoType(struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto); #endif /* DEF_novaglobalapi_ns0_subscriptionWithCreditLimitDto_H */ #ifndef DEF_novaglobalapi_ns0_taxDto_H #define DEF_novaglobalapi_ns0_taxDto_H /** * @author Edward P. Legaspi @since Oct 11, 2013 */ struct novaglobalapi_ns0_taxDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *taxId; /** * (no documentation provided) */ xmlChar *name; /** * (no documentation provided) */ struct novaglobalapi_ns0_countryTaxDto *countryTaxes; /** * Size of the countryTaxes array. */ int _sizeof_countryTaxes; }; /** * Reads a TaxDto element from XML. The element to be read is "tax", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The TaxDto, or NULL in case of error. */ struct novaglobalapi_ns0_taxDto *xml_read_novaglobalapi_ns0_taxDto(xmlTextReaderPtr reader); /** * Writes a TaxDto to XML under element name "tax". * * @param writer The XML writer. * @param _taxDto The TaxDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_taxDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_taxDto *_taxDto); /** * Frees a TaxDto. * * @param _taxDto The TaxDto to free. */ void free_novaglobalapi_ns0_taxDto(struct novaglobalapi_ns0_taxDto *_taxDto); /** * Reads a TaxDto element from XML. The element to be read is "tax", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The TaxDto, or NULL in case of error. */ struct novaglobalapi_ns0_taxDto *xmlTextReaderReadNs0TaxElement(xmlTextReaderPtr reader); /** * Writes a TaxDto to XML under element name "tax". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _taxDto The TaxDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0TaxElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_taxDto *_taxDto); /** * Writes a TaxDto to XML under element name "tax". * * @param writer The XML writer. * @param _taxDto The TaxDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0TaxElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_taxDto *_taxDto, int writeNamespaces); /** * Frees the children of a TaxDto. * * @param _taxDto The TaxDto whose children are to be free. */ static void freeNs0TaxElement(struct novaglobalapi_ns0_taxDto *_taxDto); /** * Reads a TaxDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The TaxDto, or NULL in case of error. */ static struct novaglobalapi_ns0_taxDto *xmlTextReaderReadNs0TaxDtoType(xmlTextReaderPtr reader); /** * Writes a TaxDto to XML. * * @param writer The XML writer. * @param _taxDto The TaxDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0TaxDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_taxDto *_taxDto); /** * Frees the elements of a TaxDto. * * @param _taxDto The TaxDto to free. */ static void freeNs0TaxDtoType(struct novaglobalapi_ns0_taxDto *_taxDto); #endif /* DEF_novaglobalapi_ns0_taxDto_H */ #ifndef DEF_novaglobalapi_ns0_terminationFeeDto_H #define DEF_novaglobalapi_ns0_terminationFeeDto_H /** * @author Edward P. Legaspi @since Nov 4, 2013 */ struct novaglobalapi_ns0_terminationFeeDto { /** * (no documentation provided) */ xmlChar *currencyCode; /** * (no documentation provided) */ struct tm *startDate; /** * (no documentation provided) */ struct tm *endDate; /** * (no documentation provided) */ xmlChar *price; /** * (no documentation provided) */ xmlChar *recommendedPrice; }; /** * Reads a TerminationFeeDto element from XML. The element to be read is "terminationFee", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The TerminationFeeDto, or NULL in case of error. */ struct novaglobalapi_ns0_terminationFeeDto *xml_read_novaglobalapi_ns0_terminationFeeDto(xmlTextReaderPtr reader); /** * Writes a TerminationFeeDto to XML under element name "terminationFee". * * @param writer The XML writer. * @param _terminationFeeDto The TerminationFeeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_terminationFeeDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto); /** * Frees a TerminationFeeDto. * * @param _terminationFeeDto The TerminationFeeDto to free. */ void free_novaglobalapi_ns0_terminationFeeDto(struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto); /** * Reads a TerminationFeeDto element from XML. The element to be read is "terminationFee", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The TerminationFeeDto, or NULL in case of error. */ struct novaglobalapi_ns0_terminationFeeDto *xmlTextReaderReadNs0TerminationFeeElement(xmlTextReaderPtr reader); /** * Writes a TerminationFeeDto to XML under element name "terminationFee". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _terminationFeeDto The TerminationFeeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0TerminationFeeElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto); /** * Writes a TerminationFeeDto to XML under element name "terminationFee". * * @param writer The XML writer. * @param _terminationFeeDto The TerminationFeeDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0TerminationFeeElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto, int writeNamespaces); /** * Frees the children of a TerminationFeeDto. * * @param _terminationFeeDto The TerminationFeeDto whose children are to be free. */ static void freeNs0TerminationFeeElement(struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto); /** * Reads a TerminationFeeDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The TerminationFeeDto, or NULL in case of error. */ static struct novaglobalapi_ns0_terminationFeeDto *xmlTextReaderReadNs0TerminationFeeDtoType(xmlTextReaderPtr reader); /** * Writes a TerminationFeeDto to XML. * * @param writer The XML writer. * @param _terminationFeeDto The TerminationFeeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0TerminationFeeDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto); /** * Frees the elements of a TerminationFeeDto. * * @param _terminationFeeDto The TerminationFeeDto to free. */ static void freeNs0TerminationFeeDtoType(struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto); #endif /* DEF_novaglobalapi_ns0_terminationFeeDto_H */ #ifndef DEF_novaglobalapi_ns0_usageChargeDto_H #define DEF_novaglobalapi_ns0_usageChargeDto_H /** * @author Edward P. Legaspi @since Nov 4, 2013 */ struct novaglobalapi_ns0_usageChargeDto { /** * (no documentation provided) */ int *min; /** * (no documentation provided) */ int *max; /** * (no documentation provided) */ xmlChar *currencyCode; /** * (no documentation provided) */ struct tm *startDate; /** * (no documentation provided) */ struct tm *endDate; /** * (no documentation provided) */ xmlChar *price; /** * (no documentation provided) */ xmlChar *recommendedPrice; }; /** * Reads a UsageChargeDto element from XML. The element to be read is "usageCharge", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The UsageChargeDto, or NULL in case of error. */ struct novaglobalapi_ns0_usageChargeDto *xml_read_novaglobalapi_ns0_usageChargeDto(xmlTextReaderPtr reader); /** * Writes a UsageChargeDto to XML under element name "usageCharge". * * @param writer The XML writer. * @param _usageChargeDto The UsageChargeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_usageChargeDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto); /** * Frees a UsageChargeDto. * * @param _usageChargeDto The UsageChargeDto to free. */ void free_novaglobalapi_ns0_usageChargeDto(struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto); /** * Reads a UsageChargeDto element from XML. The element to be read is "usageCharge", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The UsageChargeDto, or NULL in case of error. */ struct novaglobalapi_ns0_usageChargeDto *xmlTextReaderReadNs0UsageChargeElement(xmlTextReaderPtr reader); /** * Writes a UsageChargeDto to XML under element name "usageCharge". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _usageChargeDto The UsageChargeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0UsageChargeElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto); /** * Writes a UsageChargeDto to XML under element name "usageCharge". * * @param writer The XML writer. * @param _usageChargeDto The UsageChargeDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0UsageChargeElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto, int writeNamespaces); /** * Frees the children of a UsageChargeDto. * * @param _usageChargeDto The UsageChargeDto whose children are to be free. */ static void freeNs0UsageChargeElement(struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto); /** * Reads a UsageChargeDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The UsageChargeDto, or NULL in case of error. */ static struct novaglobalapi_ns0_usageChargeDto *xmlTextReaderReadNs0UsageChargeDtoType(xmlTextReaderPtr reader); /** * Writes a UsageChargeDto to XML. * * @param writer The XML writer. * @param _usageChargeDto The UsageChargeDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0UsageChargeDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto); /** * Frees the elements of a UsageChargeDto. * * @param _usageChargeDto The UsageChargeDto to free. */ static void freeNs0UsageChargeDtoType(struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto); #endif /* DEF_novaglobalapi_ns0_usageChargeDto_H */ #ifndef DEF_novaglobalapi_ns0_userDto_H #define DEF_novaglobalapi_ns0_userDto_H /** * @author Edward P. Legaspi @since Oct 11, 2013 */ struct novaglobalapi_ns0_userDto { /** * (no documentation provided) */ long long *providerId; /** * (no documentation provided) */ long long *currentUserId; /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ xmlChar *userId; /** * (no documentation provided) */ xmlChar *name; /** * (no documentation provided) */ xmlChar *organizationId; }; /** * Reads a UserDto element from XML. The element to be read is "user", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The UserDto, or NULL in case of error. */ struct novaglobalapi_ns0_userDto *xml_read_novaglobalapi_ns0_userDto(xmlTextReaderPtr reader); /** * Writes a UserDto to XML under element name "user". * * @param writer The XML writer. * @param _userDto The UserDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_userDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_userDto *_userDto); /** * Frees a UserDto. * * @param _userDto The UserDto to free. */ void free_novaglobalapi_ns0_userDto(struct novaglobalapi_ns0_userDto *_userDto); /** * Reads a UserDto element from XML. The element to be read is "user", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The UserDto, or NULL in case of error. */ struct novaglobalapi_ns0_userDto *xmlTextReaderReadNs0UserElement(xmlTextReaderPtr reader); /** * Writes a UserDto to XML under element name "user". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _userDto The UserDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0UserElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_userDto *_userDto); /** * Writes a UserDto to XML under element name "user". * * @param writer The XML writer. * @param _userDto The UserDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0UserElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_userDto *_userDto, int writeNamespaces); /** * Frees the children of a UserDto. * * @param _userDto The UserDto whose children are to be free. */ static void freeNs0UserElement(struct novaglobalapi_ns0_userDto *_userDto); /** * Reads a UserDto from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The UserDto, or NULL in case of error. */ static struct novaglobalapi_ns0_userDto *xmlTextReaderReadNs0UserDtoType(xmlTextReaderPtr reader); /** * Writes a UserDto to XML. * * @param writer The XML writer. * @param _userDto The UserDto to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0UserDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_userDto *_userDto); /** * Frees the elements of a UserDto. * * @param _userDto The UserDto to free. */ static void freeNs0UserDtoType(struct novaglobalapi_ns0_userDto *_userDto); #endif /* DEF_novaglobalapi_ns0_userDto_H */ #ifndef DEF_novaglobalapi_ns0_actionStatus_H #define DEF_novaglobalapi_ns0_actionStatus_H /** * @author Edward P. Legaspi @since Oct 3, 2013 */ struct novaglobalapi_ns0_actionStatus { /** * (no documentation provided) */ enum novaglobalapi_ns0_actionStatusEnum *status; /** * (no documentation provided) */ int errorCode; /** * (no documentation provided) */ xmlChar *message; }; /** * Reads a ActionStatus element from XML. The element to be read is "actionStatus", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ActionStatus, or NULL in case of error. */ struct novaglobalapi_ns0_actionStatus *xml_read_novaglobalapi_ns0_actionStatus(xmlTextReaderPtr reader); /** * Writes a ActionStatus to XML under element name "actionStatus". * * @param writer The XML writer. * @param _actionStatus The ActionStatus to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_actionStatus(xmlTextWriterPtr writer, struct novaglobalapi_ns0_actionStatus *_actionStatus); /** * Frees a ActionStatus. * * @param _actionStatus The ActionStatus to free. */ void free_novaglobalapi_ns0_actionStatus(struct novaglobalapi_ns0_actionStatus *_actionStatus); /** * Reads a ActionStatus element from XML. The element to be read is "actionStatus", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The ActionStatus, or NULL in case of error. */ struct novaglobalapi_ns0_actionStatus *xmlTextReaderReadNs0ActionStatusElement(xmlTextReaderPtr reader); /** * Writes a ActionStatus to XML under element name "actionStatus". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _actionStatus The ActionStatus to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ActionStatusElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_actionStatus *_actionStatus); /** * Writes a ActionStatus to XML under element name "actionStatus". * * @param writer The XML writer. * @param _actionStatus The ActionStatus to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ActionStatusElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_actionStatus *_actionStatus, int writeNamespaces); /** * Frees the children of a ActionStatus. * * @param _actionStatus The ActionStatus whose children are to be free. */ static void freeNs0ActionStatusElement(struct novaglobalapi_ns0_actionStatus *_actionStatus); /** * Reads a ActionStatus from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The ActionStatus, or NULL in case of error. */ static struct novaglobalapi_ns0_actionStatus *xmlTextReaderReadNs0ActionStatusType(xmlTextReaderPtr reader); /** * Writes a ActionStatus to XML. * * @param writer The XML writer. * @param _actionStatus The ActionStatus to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ActionStatusType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_actionStatus *_actionStatus); /** * Frees the elements of a ActionStatus. * * @param _actionStatus The ActionStatus to free. */ static void freeNs0ActionStatusType(struct novaglobalapi_ns0_actionStatus *_actionStatus); #endif /* DEF_novaglobalapi_ns0_actionStatus_H */ #ifndef DEF_novaglobalapi_ns0_actionStatusEnum_H #define DEF_novaglobalapi_ns0_actionStatusEnum_H /** * @author Edward P. Legaspi @since Oct 3, 2013 */ enum novaglobalapi_ns0_actionStatusEnum { /** * (no documentation provided) */ NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_SUCCESS, /** * (no documentation provided) */ NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_FAIL }; /** * Reads a ActionStatusEnum from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The ActionStatusEnum, or NULL if unable to be read. */ static enum novaglobalapi_ns0_actionStatusEnum *xmlTextReaderReadNs0ActionStatusEnumType(xmlTextReaderPtr reader); /** * Writes a ActionStatusEnum to XML. * * @param writer The XML writer. * @param _actionStatusEnum The ActionStatusEnum to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ActionStatusEnumType(xmlTextWriterPtr writer, enum novaglobalapi_ns0_actionStatusEnum *_actionStatusEnum); /** * Frees a ActionStatusEnum. * * @param _actionStatusEnum The ActionStatusEnum to free. */ static void freeNs0ActionStatusEnumType(enum novaglobalapi_ns0_actionStatusEnum *_actionStatusEnum); #endif #ifndef DEF_novaglobalapi_ns0_countryResponse_H #define DEF_novaglobalapi_ns0_countryResponse_H /** * @author Edward P. Legaspi @since Oct 7, 2013 */ struct novaglobalapi_ns0_countryResponse { /** * (no documentation provided) */ struct novaglobalapi_ns0_actionStatus *actionStatus; /** * (no documentation provided) */ struct novaglobalapi_ns0_countryDto *countryDto; }; /** * Reads a CountryResponse element from XML. The element to be read is "countryResponse", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The CountryResponse, or NULL in case of error. */ struct novaglobalapi_ns0_countryResponse *xml_read_novaglobalapi_ns0_countryResponse(xmlTextReaderPtr reader); /** * Writes a CountryResponse to XML under element name "countryResponse". * * @param writer The XML writer. * @param _countryResponse The CountryResponse to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_countryResponse(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryResponse *_countryResponse); /** * Frees a CountryResponse. * * @param _countryResponse The CountryResponse to free. */ void free_novaglobalapi_ns0_countryResponse(struct novaglobalapi_ns0_countryResponse *_countryResponse); /** * Reads a CountryResponse element from XML. The element to be read is "countryResponse", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The CountryResponse, or NULL in case of error. */ struct novaglobalapi_ns0_countryResponse *xmlTextReaderReadNs0CountryResponseElement(xmlTextReaderPtr reader); /** * Writes a CountryResponse to XML under element name "countryResponse". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _countryResponse The CountryResponse to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CountryResponseElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryResponse *_countryResponse); /** * Writes a CountryResponse to XML under element name "countryResponse". * * @param writer The XML writer. * @param _countryResponse The CountryResponse to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CountryResponseElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryResponse *_countryResponse, int writeNamespaces); /** * Frees the children of a CountryResponse. * * @param _countryResponse The CountryResponse whose children are to be free. */ static void freeNs0CountryResponseElement(struct novaglobalapi_ns0_countryResponse *_countryResponse); /** * Reads a CountryResponse from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The CountryResponse, or NULL in case of error. */ static struct novaglobalapi_ns0_countryResponse *xmlTextReaderReadNs0CountryResponseType(xmlTextReaderPtr reader); /** * Writes a CountryResponse to XML. * * @param writer The XML writer. * @param _countryResponse The CountryResponse to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0CountryResponseType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryResponse *_countryResponse); /** * Frees the elements of a CountryResponse. * * @param _countryResponse The CountryResponse to free. */ static void freeNs0CountryResponseType(struct novaglobalapi_ns0_countryResponse *_countryResponse); #endif /* DEF_novaglobalapi_ns0_countryResponse_H */ #ifndef DEF_novaglobalapi_ns0_subscriptionWithCreditLimitResponse_H #define DEF_novaglobalapi_ns0_subscriptionWithCreditLimitResponse_H /** * @author Edward P. Legaspi @since Nov 13, 2013 */ struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse { /** * (no documentation provided) */ xmlChar *requestId; /** * (no documentation provided) */ int *accepted; /** * (no documentation provided) */ xmlChar *subscriptionId; /** * (no documentation provided) */ xmlChar *status; }; /** * Reads a SubscriptionWithCreditLimitResponse element from XML. The element to be read is "subscriptionWithCreditLimitResponse", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitResponse, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *xml_read_novaglobalapi_ns0_subscriptionWithCreditLimitResponse(xmlTextReaderPtr reader); /** * Writes a SubscriptionWithCreditLimitResponse to XML under element name "subscriptionWithCreditLimitResponse". * * @param writer The XML writer. * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_novaglobalapi_ns0_subscriptionWithCreditLimitResponse(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse); /** * Frees a SubscriptionWithCreditLimitResponse. * * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to free. */ void free_novaglobalapi_ns0_subscriptionWithCreditLimitResponse(struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse); /** * Reads a SubscriptionWithCreditLimitResponse element from XML. The element to be read is "subscriptionWithCreditLimitResponse", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitResponse, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *xmlTextReaderReadNs0SubscriptionWithCreditLimitResponseElement(xmlTextReaderPtr reader); /** * Writes a SubscriptionWithCreditLimitResponse to XML under element name "subscriptionWithCreditLimitResponse". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitResponseElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse); /** * Writes a SubscriptionWithCreditLimitResponse to XML under element name "subscriptionWithCreditLimitResponse". * * @param writer The XML writer. * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitResponseElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse, int writeNamespaces); /** * Frees the children of a SubscriptionWithCreditLimitResponse. * * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse whose children are to be free. */ static void freeNs0SubscriptionWithCreditLimitResponseElement(struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse); /** * Reads a SubscriptionWithCreditLimitResponse from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitResponse, or NULL in case of error. */ static struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *xmlTextReaderReadNs0SubscriptionWithCreditLimitResponseType(xmlTextReaderPtr reader); /** * Writes a SubscriptionWithCreditLimitResponse to XML. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitResponseType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse); /** * Frees the elements of a SubscriptionWithCreditLimitResponse. * * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to free. */ static void freeNs0SubscriptionWithCreditLimitResponseType(struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse); #endif /* DEF_novaglobalapi_ns0_subscriptionWithCreditLimitResponse_H */ #ifndef DEF_novaglobalapi_ns0_countryDto_M #define DEF_novaglobalapi_ns0_countryDto_M /** * Reads a CountryDto element from XML. The element to be read is "country", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The CountryDto, or NULL in case of error. */ struct novaglobalapi_ns0_countryDto *xml_read_novaglobalapi_ns0_countryDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0CountryElement(reader); } /** * Writes a CountryDto to XML under element name "country". * * @param writer The XML writer. * @param _countryDto The CountryDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_countryDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryDto *_countryDto) { return xmlTextWriterWriteNs0CountryElementNS(writer, _countryDto, 1); } /** * Frees a CountryDto. * * @param _countryDto The CountryDto to free. */ void free_novaglobalapi_ns0_countryDto(struct novaglobalapi_ns0_countryDto *_countryDto) { freeNs0CountryDtoType(_countryDto); free(_countryDto); } /** * Reads a CountryDto element from XML. The element to be read is "country", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The CountryDto, or NULL in case of error. */ struct novaglobalapi_ns0_countryDto *xmlTextReaderReadNs0CountryElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_countryDto *_countryDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "country", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}country.\n"); #endif _countryDto = xmlTextReaderReadNs0CountryDtoType(reader); } #if DEBUG_ENUNCIATE if (_countryDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}country failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}country failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _countryDto; } /** * Writes a CountryDto to XML under element name "country". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _countryDto The CountryDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0CountryElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryDto *_countryDto) { return xmlTextWriterWriteNs0CountryElementNS(writer, _countryDto, 0); } /** * Writes a CountryDto to XML under element name "country". * * @param writer The XML writer. * @param _countryDto The CountryDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0CountryElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryDto *_countryDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "country", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}country. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}countryDto for root element {}country...\n"); #endif status = xmlTextWriterWriteNs0CountryDtoType(writer, _countryDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}country. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}country. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a CountryDto. * * @param _countryDto The CountryDto whose children are to be free. */ static void freeNs0CountryElement(struct novaglobalapi_ns0_countryDto *_countryDto) { freeNs0CountryDtoType(_countryDto); } /** * Reads a CountryDto from XML. The reader is assumed to be at the start element. * * @return the CountryDto, or NULL in case of error. */ static struct novaglobalapi_ns0_countryDto *xmlTextReaderReadNs0CountryDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_countryDto *_countryDto = calloc(1, sizeof(struct novaglobalapi_ns0_countryDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0CountryDtoType(_countryDto); free(_countryDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryDtoType(_countryDto); free(_countryDto); return NULL; } _countryDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryDtoType(_countryDto); free(_countryDto); return NULL; } _countryDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryDtoType(_countryDto); free(_countryDto); return NULL; } _countryDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryDtoType(_countryDto); free(_countryDto); return NULL; } _countryDto->countryCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryDtoType(_countryDto); free(_countryDto); return NULL; } _countryDto->name = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryDtoType(_countryDto); free(_countryDto); return NULL; } _countryDto->currencyCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "languageCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryDtoType(_countryDto); free(_countryDto); return NULL; } _countryDto->languageCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}countryDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}countryDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _countryDto; } /** * Writes a CountryDto to XML. * * @param writer The XML writer. * @param _countryDto The CountryDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0CountryDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryDto *_countryDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_countryDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_countryDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_countryDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_countryDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_countryDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_countryDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_countryDto->countryCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}countryCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}countryCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_countryDto->countryCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}countryCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}countryCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_countryDto->name != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}name. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_countryDto->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}name. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}name. status: %i\n", status); #endif return status; } totalBytes += status; } if (_countryDto->currencyCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_countryDto->currencyCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_countryDto->languageCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "languageCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}languageCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}languageCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_countryDto->languageCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}languageCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}languageCode. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a CountryDto. * * @param _countryDto The CountryDto to free. */ static void freeNs0CountryDtoType(struct novaglobalapi_ns0_countryDto *_countryDto) { int i; if (_countryDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_countryDto...\n"); #endif freeXsLongType(_countryDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_countryDto...\n"); #endif free(_countryDto->providerId); } if (_countryDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_countryDto...\n"); #endif freeXsLongType(_countryDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_countryDto...\n"); #endif free(_countryDto->currentUserId); } if (_countryDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_countryDto...\n"); #endif freeXsStringType(_countryDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_countryDto...\n"); #endif free(_countryDto->requestId); } if (_countryDto->countryCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor countryCode of type novaglobalapi_ns0_countryDto...\n"); #endif freeXsStringType(_countryDto->countryCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor countryCode of type novaglobalapi_ns0_countryDto...\n"); #endif free(_countryDto->countryCode); } if (_countryDto->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type novaglobalapi_ns0_countryDto...\n"); #endif freeXsStringType(_countryDto->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type novaglobalapi_ns0_countryDto...\n"); #endif free(_countryDto->name); } if (_countryDto->currencyCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currencyCode of type novaglobalapi_ns0_countryDto...\n"); #endif freeXsStringType(_countryDto->currencyCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currencyCode of type novaglobalapi_ns0_countryDto...\n"); #endif free(_countryDto->currencyCode); } if (_countryDto->languageCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor languageCode of type novaglobalapi_ns0_countryDto...\n"); #endif freeXsStringType(_countryDto->languageCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor languageCode of type novaglobalapi_ns0_countryDto...\n"); #endif free(_countryDto->languageCode); } } #endif /* DEF_novaglobalapi_ns0_countryDto_M */ #ifndef DEF_novaglobalapi_ns0_countryTaxDto_M #define DEF_novaglobalapi_ns0_countryTaxDto_M /** * Reads a CountryTaxDto element from XML. The element to be read is "countryTax", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The CountryTaxDto, or NULL in case of error. */ struct novaglobalapi_ns0_countryTaxDto *xml_read_novaglobalapi_ns0_countryTaxDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0CountryTaxElement(reader); } /** * Writes a CountryTaxDto to XML under element name "countryTax". * * @param writer The XML writer. * @param _countryTaxDto The CountryTaxDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_countryTaxDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto) { return xmlTextWriterWriteNs0CountryTaxElementNS(writer, _countryTaxDto, 1); } /** * Frees a CountryTaxDto. * * @param _countryTaxDto The CountryTaxDto to free. */ void free_novaglobalapi_ns0_countryTaxDto(struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto) { freeNs0CountryTaxDtoType(_countryTaxDto); free(_countryTaxDto); } /** * Reads a CountryTaxDto element from XML. The element to be read is "countryTax", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The CountryTaxDto, or NULL in case of error. */ struct novaglobalapi_ns0_countryTaxDto *xmlTextReaderReadNs0CountryTaxElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryTax", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}countryTax.\n"); #endif _countryTaxDto = xmlTextReaderReadNs0CountryTaxDtoType(reader); } #if DEBUG_ENUNCIATE if (_countryTaxDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}countryTax failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}countryTax failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _countryTaxDto; } /** * Writes a CountryTaxDto to XML under element name "countryTax". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _countryTaxDto The CountryTaxDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0CountryTaxElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto) { return xmlTextWriterWriteNs0CountryTaxElementNS(writer, _countryTaxDto, 0); } /** * Writes a CountryTaxDto to XML under element name "countryTax". * * @param writer The XML writer. * @param _countryTaxDto The CountryTaxDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0CountryTaxElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryTax", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}countryTax. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}countryTaxDto for root element {}countryTax...\n"); #endif status = xmlTextWriterWriteNs0CountryTaxDtoType(writer, _countryTaxDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}countryTax. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}countryTax. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a CountryTaxDto. * * @param _countryTaxDto The CountryTaxDto whose children are to be free. */ static void freeNs0CountryTaxElement(struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto) { freeNs0CountryTaxDtoType(_countryTaxDto); } /** * Reads a CountryTaxDto from XML. The reader is assumed to be at the start element. * * @return the CountryTaxDto, or NULL in case of error. */ static struct novaglobalapi_ns0_countryTaxDto *xmlTextReaderReadNs0CountryTaxDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto = calloc(1, sizeof(struct novaglobalapi_ns0_countryTaxDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0CountryTaxDtoType(_countryTaxDto); free(_countryTaxDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryTaxDtoType(_countryTaxDto); free(_countryTaxDto); return NULL; } _countryTaxDto->countryCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "taxValue", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}taxValue of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}taxValue of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryTaxDtoType(_countryTaxDto); free(_countryTaxDto); return NULL; } _countryTaxDto->taxValue = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}countryTaxDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}countryTaxDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _countryTaxDto; } /** * Writes a CountryTaxDto to XML. * * @param writer The XML writer. * @param _countryTaxDto The CountryTaxDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0CountryTaxDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_countryTaxDto->countryCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}countryCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}countryCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_countryTaxDto->countryCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}countryCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}countryCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_countryTaxDto->taxValue != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "taxValue", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}taxValue. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}taxValue...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_countryTaxDto->taxValue)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}taxValue. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}taxValue. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a CountryTaxDto. * * @param _countryTaxDto The CountryTaxDto to free. */ static void freeNs0CountryTaxDtoType(struct novaglobalapi_ns0_countryTaxDto *_countryTaxDto) { int i; if (_countryTaxDto->countryCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor countryCode of type novaglobalapi_ns0_countryTaxDto...\n"); #endif freeXsStringType(_countryTaxDto->countryCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor countryCode of type novaglobalapi_ns0_countryTaxDto...\n"); #endif free(_countryTaxDto->countryCode); } if (_countryTaxDto->taxValue != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor taxValue of type novaglobalapi_ns0_countryTaxDto...\n"); #endif freeXsDecimalType(_countryTaxDto->taxValue); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor taxValue of type novaglobalapi_ns0_countryTaxDto...\n"); #endif free(_countryTaxDto->taxValue); } } #endif /* DEF_novaglobalapi_ns0_countryTaxDto_M */ #ifndef DEF_novaglobalapi_ns0_creditLimitDto_M #define DEF_novaglobalapi_ns0_creditLimitDto_M /** * Reads a CreditLimitDto element from XML. The element to be read is "creditLimit", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The CreditLimitDto, or NULL in case of error. */ struct novaglobalapi_ns0_creditLimitDto *xml_read_novaglobalapi_ns0_creditLimitDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0CreditLimitElement(reader); } /** * Writes a CreditLimitDto to XML under element name "creditLimit". * * @param writer The XML writer. * @param _creditLimitDto The CreditLimitDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_creditLimitDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto) { return xmlTextWriterWriteNs0CreditLimitElementNS(writer, _creditLimitDto, 1); } /** * Frees a CreditLimitDto. * * @param _creditLimitDto The CreditLimitDto to free. */ void free_novaglobalapi_ns0_creditLimitDto(struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto) { freeNs0CreditLimitDtoType(_creditLimitDto); free(_creditLimitDto); } /** * Reads a CreditLimitDto element from XML. The element to be read is "creditLimit", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The CreditLimitDto, or NULL in case of error. */ struct novaglobalapi_ns0_creditLimitDto *xmlTextReaderReadNs0CreditLimitElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "creditLimit", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}creditLimit.\n"); #endif _creditLimitDto = xmlTextReaderReadNs0CreditLimitDtoType(reader); } #if DEBUG_ENUNCIATE if (_creditLimitDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}creditLimit failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}creditLimit failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _creditLimitDto; } /** * Writes a CreditLimitDto to XML under element name "creditLimit". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _creditLimitDto The CreditLimitDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0CreditLimitElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto) { return xmlTextWriterWriteNs0CreditLimitElementNS(writer, _creditLimitDto, 0); } /** * Writes a CreditLimitDto to XML under element name "creditLimit". * * @param writer The XML writer. * @param _creditLimitDto The CreditLimitDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0CreditLimitElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "creditLimit", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}creditLimit. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}creditLimitDto for root element {}creditLimit...\n"); #endif status = xmlTextWriterWriteNs0CreditLimitDtoType(writer, _creditLimitDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}creditLimit. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}creditLimit. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a CreditLimitDto. * * @param _creditLimitDto The CreditLimitDto whose children are to be free. */ static void freeNs0CreditLimitElement(struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto) { freeNs0CreditLimitDtoType(_creditLimitDto); } /** * Reads a CreditLimitDto from XML. The reader is assumed to be at the start element. * * @return the CreditLimitDto, or NULL in case of error. */ static struct novaglobalapi_ns0_creditLimitDto *xmlTextReaderReadNs0CreditLimitDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto = calloc(1, sizeof(struct novaglobalapi_ns0_creditLimitDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0CreditLimitDtoType(_creditLimitDto); free(_creditLimitDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CreditLimitDtoType(_creditLimitDto); free(_creditLimitDto); return NULL; } _creditLimitDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CreditLimitDtoType(_creditLimitDto); free(_creditLimitDto); return NULL; } _creditLimitDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CreditLimitDtoType(_creditLimitDto); free(_creditLimitDto); return NULL; } _creditLimitDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CreditLimitDtoType(_creditLimitDto); free(_creditLimitDto); return NULL; } _creditLimitDto->organizationId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "creditLimit", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}creditLimit of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}creditLimit of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CreditLimitDtoType(_creditLimitDto); free(_creditLimitDto); return NULL; } _creditLimitDto->creditLimit = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}creditLimitDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}creditLimitDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _creditLimitDto; } /** * Writes a CreditLimitDto to XML. * * @param writer The XML writer. * @param _creditLimitDto The CreditLimitDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0CreditLimitDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_creditLimitDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_creditLimitDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_creditLimitDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_creditLimitDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_creditLimitDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_creditLimitDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_creditLimitDto->organizationId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_creditLimitDto->organizationId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_creditLimitDto->creditLimit != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "creditLimit", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}creditLimit. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}creditLimit...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_creditLimitDto->creditLimit)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}creditLimit. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}creditLimit. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a CreditLimitDto. * * @param _creditLimitDto The CreditLimitDto to free. */ static void freeNs0CreditLimitDtoType(struct novaglobalapi_ns0_creditLimitDto *_creditLimitDto) { int i; if (_creditLimitDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_creditLimitDto...\n"); #endif freeXsLongType(_creditLimitDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_creditLimitDto...\n"); #endif free(_creditLimitDto->providerId); } if (_creditLimitDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_creditLimitDto...\n"); #endif freeXsLongType(_creditLimitDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_creditLimitDto...\n"); #endif free(_creditLimitDto->currentUserId); } if (_creditLimitDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_creditLimitDto...\n"); #endif freeXsStringType(_creditLimitDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_creditLimitDto...\n"); #endif free(_creditLimitDto->requestId); } if (_creditLimitDto->organizationId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor organizationId of type novaglobalapi_ns0_creditLimitDto...\n"); #endif freeXsStringType(_creditLimitDto->organizationId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor organizationId of type novaglobalapi_ns0_creditLimitDto...\n"); #endif free(_creditLimitDto->organizationId); } if (_creditLimitDto->creditLimit != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor creditLimit of type novaglobalapi_ns0_creditLimitDto...\n"); #endif freeXsDecimalType(_creditLimitDto->creditLimit); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor creditLimit of type novaglobalapi_ns0_creditLimitDto...\n"); #endif free(_creditLimitDto->creditLimit); } } #endif /* DEF_novaglobalapi_ns0_creditLimitDto_M */ #ifndef DEF_novaglobalapi_ns0_descriptionDto_M #define DEF_novaglobalapi_ns0_descriptionDto_M /** * Reads a DescriptionDto element from XML. The element to be read is "description", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The DescriptionDto, or NULL in case of error. */ struct novaglobalapi_ns0_descriptionDto *xml_read_novaglobalapi_ns0_descriptionDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0DescriptionElement(reader); } /** * Writes a DescriptionDto to XML under element name "description". * * @param writer The XML writer. * @param _descriptionDto The DescriptionDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_descriptionDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_descriptionDto *_descriptionDto) { return xmlTextWriterWriteNs0DescriptionElementNS(writer, _descriptionDto, 1); } /** * Frees a DescriptionDto. * * @param _descriptionDto The DescriptionDto to free. */ void free_novaglobalapi_ns0_descriptionDto(struct novaglobalapi_ns0_descriptionDto *_descriptionDto) { freeNs0DescriptionDtoType(_descriptionDto); free(_descriptionDto); } /** * Reads a DescriptionDto element from XML. The element to be read is "description", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The DescriptionDto, or NULL in case of error. */ struct novaglobalapi_ns0_descriptionDto *xmlTextReaderReadNs0DescriptionElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_descriptionDto *_descriptionDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "description", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}description.\n"); #endif _descriptionDto = xmlTextReaderReadNs0DescriptionDtoType(reader); } #if DEBUG_ENUNCIATE if (_descriptionDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}description failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}description failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _descriptionDto; } /** * Writes a DescriptionDto to XML under element name "description". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _descriptionDto The DescriptionDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0DescriptionElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_descriptionDto *_descriptionDto) { return xmlTextWriterWriteNs0DescriptionElementNS(writer, _descriptionDto, 0); } /** * Writes a DescriptionDto to XML under element name "description". * * @param writer The XML writer. * @param _descriptionDto The DescriptionDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0DescriptionElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_descriptionDto *_descriptionDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "description", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}description. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}descriptionDto for root element {}description...\n"); #endif status = xmlTextWriterWriteNs0DescriptionDtoType(writer, _descriptionDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}description. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}description. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a DescriptionDto. * * @param _descriptionDto The DescriptionDto whose children are to be free. */ static void freeNs0DescriptionElement(struct novaglobalapi_ns0_descriptionDto *_descriptionDto) { freeNs0DescriptionDtoType(_descriptionDto); } /** * Reads a DescriptionDto from XML. The reader is assumed to be at the start element. * * @return the DescriptionDto, or NULL in case of error. */ static struct novaglobalapi_ns0_descriptionDto *xmlTextReaderReadNs0DescriptionDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_descriptionDto *_descriptionDto = calloc(1, sizeof(struct novaglobalapi_ns0_descriptionDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0DescriptionDtoType(_descriptionDto); free(_descriptionDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "languageCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0DescriptionDtoType(_descriptionDto); free(_descriptionDto); return NULL; } _descriptionDto->languageCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "description", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}description of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}description of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0DescriptionDtoType(_descriptionDto); free(_descriptionDto); return NULL; } _descriptionDto->description = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}descriptionDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}descriptionDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _descriptionDto; } /** * Writes a DescriptionDto to XML. * * @param writer The XML writer. * @param _descriptionDto The DescriptionDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0DescriptionDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_descriptionDto *_descriptionDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_descriptionDto->languageCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "languageCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}languageCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}languageCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_descriptionDto->languageCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}languageCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}languageCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_descriptionDto->description != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "description", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}description. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}description...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_descriptionDto->description)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}description. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}description. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a DescriptionDto. * * @param _descriptionDto The DescriptionDto to free. */ static void freeNs0DescriptionDtoType(struct novaglobalapi_ns0_descriptionDto *_descriptionDto) { int i; if (_descriptionDto->languageCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor languageCode of type novaglobalapi_ns0_descriptionDto...\n"); #endif freeXsStringType(_descriptionDto->languageCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor languageCode of type novaglobalapi_ns0_descriptionDto...\n"); #endif free(_descriptionDto->languageCode); } if (_descriptionDto->description != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor description of type novaglobalapi_ns0_descriptionDto...\n"); #endif freeXsStringType(_descriptionDto->description); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor description of type novaglobalapi_ns0_descriptionDto...\n"); #endif free(_descriptionDto->description); } } #endif /* DEF_novaglobalapi_ns0_descriptionDto_M */ #ifndef DEF_novaglobalapi_ns0_offerDto_M #define DEF_novaglobalapi_ns0_offerDto_M /** * Reads a OfferDto element from XML. The element to be read is "offer", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The OfferDto, or NULL in case of error. */ struct novaglobalapi_ns0_offerDto *xml_read_novaglobalapi_ns0_offerDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0OfferElement(reader); } /** * Writes a OfferDto to XML under element name "offer". * * @param writer The XML writer. * @param _offerDto The OfferDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_offerDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerDto *_offerDto) { return xmlTextWriterWriteNs0OfferElementNS(writer, _offerDto, 1); } /** * Frees a OfferDto. * * @param _offerDto The OfferDto to free. */ void free_novaglobalapi_ns0_offerDto(struct novaglobalapi_ns0_offerDto *_offerDto) { freeNs0OfferDtoType(_offerDto); free(_offerDto); } /** * Reads a OfferDto element from XML. The element to be read is "offer", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The OfferDto, or NULL in case of error. */ struct novaglobalapi_ns0_offerDto *xmlTextReaderReadNs0OfferElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_offerDto *_offerDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "offer", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}offer.\n"); #endif _offerDto = xmlTextReaderReadNs0OfferDtoType(reader); } #if DEBUG_ENUNCIATE if (_offerDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}offer failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}offer failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _offerDto; } /** * Writes a OfferDto to XML under element name "offer". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _offerDto The OfferDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0OfferElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerDto *_offerDto) { return xmlTextWriterWriteNs0OfferElementNS(writer, _offerDto, 0); } /** * Writes a OfferDto to XML under element name "offer". * * @param writer The XML writer. * @param _offerDto The OfferDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0OfferElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerDto *_offerDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "offer", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}offer. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}offerDto for root element {}offer...\n"); #endif status = xmlTextWriterWriteNs0OfferDtoType(writer, _offerDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}offer. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}offer. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a OfferDto. * * @param _offerDto The OfferDto whose children are to be free. */ static void freeNs0OfferElement(struct novaglobalapi_ns0_offerDto *_offerDto) { freeNs0OfferDtoType(_offerDto); } /** * Reads a OfferDto from XML. The reader is assumed to be at the start element. * * @return the OfferDto, or NULL in case of error. */ static struct novaglobalapi_ns0_offerDto *xmlTextReaderReadNs0OfferDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_offerDto *_offerDto = calloc(1, sizeof(struct novaglobalapi_ns0_offerDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0OfferDtoType(_offerDto); free(_offerDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferDtoType(_offerDto); free(_offerDto); return NULL; } _offerDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferDtoType(_offerDto); free(_offerDto); return NULL; } _offerDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferDtoType(_offerDto); free(_offerDto); return NULL; } _offerDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "offerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferDtoType(_offerDto); free(_offerDto); return NULL; } _offerDto->offerId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "descriptions", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}descriptions of type {}descriptionDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0DescriptionDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}descriptions of type {}descriptionDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferDtoType(_offerDto); free(_offerDto); return NULL; } _offerDto->descriptions = realloc(_offerDto->descriptions, (_offerDto->_sizeof_descriptions + 1) * sizeof(struct novaglobalapi_ns0_descriptionDto)); memcpy(&(_offerDto->descriptions[_offerDto->_sizeof_descriptions++]), _child_accessor, sizeof(struct novaglobalapi_ns0_descriptionDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "services", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}services of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}services of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferDtoType(_offerDto); free(_offerDto); return NULL; } _offerDto->services = realloc(_offerDto->services, (_offerDto->_sizeof_services + 1) * sizeof(xmlChar)); memcpy(&(_offerDto->services[_offerDto->_sizeof_services++]), _child_accessor, sizeof(xmlChar)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}offerDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}offerDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _offerDto; } /** * Writes a OfferDto to XML. * * @param writer The XML writer. * @param _offerDto The OfferDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0OfferDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerDto *_offerDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_offerDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_offerDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_offerDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerDto->offerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "offerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}offerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}offerId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerDto->offerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}offerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}offerId. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _offerDto->_sizeof_descriptions; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "descriptions", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}descriptions. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}descriptionDto for element {}descriptions...\n"); #endif status = xmlTextWriterWriteNs0DescriptionDtoType(writer, &(_offerDto->descriptions[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}descriptionDto for element {}descriptions. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}descriptions. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _offerDto->_sizeof_services; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "services", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}services. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}services...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, &(_offerDto->services[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}services. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}services. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a OfferDto. * * @param _offerDto The OfferDto to free. */ static void freeNs0OfferDtoType(struct novaglobalapi_ns0_offerDto *_offerDto) { int i; if (_offerDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_offerDto...\n"); #endif freeXsLongType(_offerDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_offerDto...\n"); #endif free(_offerDto->providerId); } if (_offerDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_offerDto...\n"); #endif freeXsLongType(_offerDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_offerDto...\n"); #endif free(_offerDto->currentUserId); } if (_offerDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_offerDto...\n"); #endif freeXsStringType(_offerDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_offerDto...\n"); #endif free(_offerDto->requestId); } if (_offerDto->offerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor offerId of type novaglobalapi_ns0_offerDto...\n"); #endif freeXsStringType(_offerDto->offerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor offerId of type novaglobalapi_ns0_offerDto...\n"); #endif free(_offerDto->offerId); } if (_offerDto->descriptions != NULL) { for (i = 0; i < _offerDto->_sizeof_descriptions; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor descriptions[%i] of type novaglobalapi_ns0_offerDto...\n", i); #endif freeNs0DescriptionDtoType(&(_offerDto->descriptions[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor descriptions of type novaglobalapi_ns0_offerDto...\n"); #endif free(_offerDto->descriptions); } if (_offerDto->services != NULL) { for (i = 0; i < _offerDto->_sizeof_services; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor services[%i] of type novaglobalapi_ns0_offerDto...\n", i); #endif freeXsStringType(&(_offerDto->services[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor services of type novaglobalapi_ns0_offerDto...\n"); #endif free(_offerDto->services); } } #endif /* DEF_novaglobalapi_ns0_offerDto_M */ #ifndef DEF_novaglobalapi_ns0_offerPricePlanDto_M #define DEF_novaglobalapi_ns0_offerPricePlanDto_M /** * Reads a OfferPricePlanDto element from XML. The element to be read is "offerPricePlan", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The OfferPricePlanDto, or NULL in case of error. */ struct novaglobalapi_ns0_offerPricePlanDto *xml_read_novaglobalapi_ns0_offerPricePlanDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0OfferPricePlanElement(reader); } /** * Writes a OfferPricePlanDto to XML under element name "offerPricePlan". * * @param writer The XML writer. * @param _offerPricePlanDto The OfferPricePlanDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_offerPricePlanDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto) { return xmlTextWriterWriteNs0OfferPricePlanElementNS(writer, _offerPricePlanDto, 1); } /** * Frees a OfferPricePlanDto. * * @param _offerPricePlanDto The OfferPricePlanDto to free. */ void free_novaglobalapi_ns0_offerPricePlanDto(struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto) { freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); } /** * Reads a OfferPricePlanDto element from XML. The element to be read is "offerPricePlan", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The OfferPricePlanDto, or NULL in case of error. */ struct novaglobalapi_ns0_offerPricePlanDto *xmlTextReaderReadNs0OfferPricePlanElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "offerPricePlan", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}offerPricePlan.\n"); #endif _offerPricePlanDto = xmlTextReaderReadNs0OfferPricePlanDtoType(reader); } #if DEBUG_ENUNCIATE if (_offerPricePlanDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}offerPricePlan failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}offerPricePlan failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _offerPricePlanDto; } /** * Writes a OfferPricePlanDto to XML under element name "offerPricePlan". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _offerPricePlanDto The OfferPricePlanDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0OfferPricePlanElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto) { return xmlTextWriterWriteNs0OfferPricePlanElementNS(writer, _offerPricePlanDto, 0); } /** * Writes a OfferPricePlanDto to XML under element name "offerPricePlan". * * @param writer The XML writer. * @param _offerPricePlanDto The OfferPricePlanDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0OfferPricePlanElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "offerPricePlan", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}offerPricePlan. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}offerPricePlanDto for root element {}offerPricePlan...\n"); #endif status = xmlTextWriterWriteNs0OfferPricePlanDtoType(writer, _offerPricePlanDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}offerPricePlan. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}offerPricePlan. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a OfferPricePlanDto. * * @param _offerPricePlanDto The OfferPricePlanDto whose children are to be free. */ static void freeNs0OfferPricePlanElement(struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto) { freeNs0OfferPricePlanDtoType(_offerPricePlanDto); } /** * Reads a OfferPricePlanDto from XML. The reader is assumed to be at the start element. * * @return the OfferPricePlanDto, or NULL in case of error. */ static struct novaglobalapi_ns0_offerPricePlanDto *xmlTextReaderReadNs0OfferPricePlanDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto = calloc(1, sizeof(struct novaglobalapi_ns0_offerPricePlanDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "offerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->offerId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->organizationId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "taxId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->taxId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionProrata", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}subscriptionProrata of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}subscriptionProrata of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->subscriptionProrata = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationProrata", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}terminationProrata of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}terminationProrata of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->terminationProrata = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "applyInAdvance", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}applyInAdvance of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}applyInAdvance of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->applyInAdvance = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param1", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->param1 = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param2", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->param2 = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param3", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->param3 = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "billingPeriod", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}billingPeriod of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif _child_accessor = xmlTextReaderReadXsIntType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}billingPeriod of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->billingPeriod = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recurringCharges", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}recurringCharges of type {}recurringChargeDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0RecurringChargeDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}recurringCharges of type {}recurringChargeDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->recurringCharges = realloc(_offerPricePlanDto->recurringCharges, (_offerPricePlanDto->_sizeof_recurringCharges + 1) * sizeof(struct novaglobalapi_ns0_recurringChargeDto)); memcpy(&(_offerPricePlanDto->recurringCharges[_offerPricePlanDto->_sizeof_recurringCharges++]), _child_accessor, sizeof(struct novaglobalapi_ns0_recurringChargeDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "usageUnit", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}usageUnit of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}usageUnit of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->usageUnit = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "usageCharges", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}usageCharges of type {}usageChargeDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0UsageChargeDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}usageCharges of type {}usageChargeDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->usageCharges = realloc(_offerPricePlanDto->usageCharges, (_offerPricePlanDto->_sizeof_usageCharges + 1) * sizeof(struct novaglobalapi_ns0_usageChargeDto)); memcpy(&(_offerPricePlanDto->usageCharges[_offerPricePlanDto->_sizeof_usageCharges++]), _child_accessor, sizeof(struct novaglobalapi_ns0_usageChargeDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionFees", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}subscriptionFees of type {}subscriptionFeeDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0SubscriptionFeeDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}subscriptionFees of type {}subscriptionFeeDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->subscriptionFees = realloc(_offerPricePlanDto->subscriptionFees, (_offerPricePlanDto->_sizeof_subscriptionFees + 1) * sizeof(struct novaglobalapi_ns0_subscriptionFeeDto)); memcpy(&(_offerPricePlanDto->subscriptionFees[_offerPricePlanDto->_sizeof_subscriptionFees++]), _child_accessor, sizeof(struct novaglobalapi_ns0_subscriptionFeeDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationFees", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}terminationFees of type {}terminationFeeDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0TerminationFeeDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}terminationFees of type {}terminationFeeDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OfferPricePlanDtoType(_offerPricePlanDto); free(_offerPricePlanDto); return NULL; } _offerPricePlanDto->terminationFees = realloc(_offerPricePlanDto->terminationFees, (_offerPricePlanDto->_sizeof_terminationFees + 1) * sizeof(struct novaglobalapi_ns0_terminationFeeDto)); memcpy(&(_offerPricePlanDto->terminationFees[_offerPricePlanDto->_sizeof_terminationFees++]), _child_accessor, sizeof(struct novaglobalapi_ns0_terminationFeeDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}offerPricePlanDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}offerPricePlanDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _offerPricePlanDto; } /** * Writes a OfferPricePlanDto to XML. * * @param writer The XML writer. * @param _offerPricePlanDto The OfferPricePlanDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0OfferPricePlanDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_offerPricePlanDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_offerPricePlanDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_offerPricePlanDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerPricePlanDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->offerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "offerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}offerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}offerId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerPricePlanDto->offerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}offerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}offerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->organizationId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerPricePlanDto->organizationId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->taxId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "taxId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}taxId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}taxId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerPricePlanDto->taxId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}taxId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}taxId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->subscriptionProrata != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionProrata", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}subscriptionProrata. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for element {}subscriptionProrata...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, (_offerPricePlanDto->subscriptionProrata)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for element {}subscriptionProrata. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}subscriptionProrata. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->terminationProrata != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationProrata", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}terminationProrata. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for element {}terminationProrata...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, (_offerPricePlanDto->terminationProrata)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for element {}terminationProrata. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}terminationProrata. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->applyInAdvance != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "applyInAdvance", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}applyInAdvance. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for element {}applyInAdvance...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, (_offerPricePlanDto->applyInAdvance)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for element {}applyInAdvance. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}applyInAdvance. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->param1 != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param1", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}param1. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}param1...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerPricePlanDto->param1)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}param1. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}param1. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->param2 != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param2", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}param2. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}param2...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerPricePlanDto->param2)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}param2. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}param2. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->param3 != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param3", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}param3. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}param3...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerPricePlanDto->param3)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}param3. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}param3. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->billingPeriod != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "billingPeriod", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}billingPeriod. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}billingPeriod...\n"); #endif status = xmlTextWriterWriteXsIntType(writer, (_offerPricePlanDto->billingPeriod)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}billingPeriod. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}billingPeriod. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _offerPricePlanDto->_sizeof_recurringCharges; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recurringCharges", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}recurringCharges. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}recurringChargeDto for element {}recurringCharges...\n"); #endif status = xmlTextWriterWriteNs0RecurringChargeDtoType(writer, &(_offerPricePlanDto->recurringCharges[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}recurringChargeDto for element {}recurringCharges. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}recurringCharges. status: %i\n", status); #endif return status; } totalBytes += status; } if (_offerPricePlanDto->usageUnit != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "usageUnit", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}usageUnit. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}usageUnit...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_offerPricePlanDto->usageUnit)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}usageUnit. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}usageUnit. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _offerPricePlanDto->_sizeof_usageCharges; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "usageCharges", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}usageCharges. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}usageChargeDto for element {}usageCharges...\n"); #endif status = xmlTextWriterWriteNs0UsageChargeDtoType(writer, &(_offerPricePlanDto->usageCharges[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}usageChargeDto for element {}usageCharges. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}usageCharges. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _offerPricePlanDto->_sizeof_subscriptionFees; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionFees", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}subscriptionFees. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}subscriptionFeeDto for element {}subscriptionFees...\n"); #endif status = xmlTextWriterWriteNs0SubscriptionFeeDtoType(writer, &(_offerPricePlanDto->subscriptionFees[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}subscriptionFeeDto for element {}subscriptionFees. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}subscriptionFees. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _offerPricePlanDto->_sizeof_terminationFees; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationFees", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}terminationFees. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}terminationFeeDto for element {}terminationFees...\n"); #endif status = xmlTextWriterWriteNs0TerminationFeeDtoType(writer, &(_offerPricePlanDto->terminationFees[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}terminationFeeDto for element {}terminationFees. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}terminationFees. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a OfferPricePlanDto. * * @param _offerPricePlanDto The OfferPricePlanDto to free. */ static void freeNs0OfferPricePlanDtoType(struct novaglobalapi_ns0_offerPricePlanDto *_offerPricePlanDto) { int i; if (_offerPricePlanDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsLongType(_offerPricePlanDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->providerId); } if (_offerPricePlanDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsLongType(_offerPricePlanDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->currentUserId); } if (_offerPricePlanDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsStringType(_offerPricePlanDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->requestId); } if (_offerPricePlanDto->offerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor offerId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsStringType(_offerPricePlanDto->offerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor offerId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->offerId); } if (_offerPricePlanDto->organizationId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor organizationId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsStringType(_offerPricePlanDto->organizationId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor organizationId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->organizationId); } if (_offerPricePlanDto->taxId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor taxId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsStringType(_offerPricePlanDto->taxId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor taxId of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->taxId); } if (_offerPricePlanDto->subscriptionProrata != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor subscriptionProrata of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsBooleanType(_offerPricePlanDto->subscriptionProrata); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor subscriptionProrata of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->subscriptionProrata); } if (_offerPricePlanDto->terminationProrata != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor terminationProrata of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsBooleanType(_offerPricePlanDto->terminationProrata); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor terminationProrata of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->terminationProrata); } if (_offerPricePlanDto->applyInAdvance != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor applyInAdvance of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsBooleanType(_offerPricePlanDto->applyInAdvance); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor applyInAdvance of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->applyInAdvance); } if (_offerPricePlanDto->param1 != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor param1 of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsStringType(_offerPricePlanDto->param1); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor param1 of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->param1); } if (_offerPricePlanDto->param2 != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor param2 of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsStringType(_offerPricePlanDto->param2); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor param2 of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->param2); } if (_offerPricePlanDto->param3 != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor param3 of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsStringType(_offerPricePlanDto->param3); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor param3 of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->param3); } if (_offerPricePlanDto->billingPeriod != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor billingPeriod of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsIntType(_offerPricePlanDto->billingPeriod); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor billingPeriod of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->billingPeriod); } if (_offerPricePlanDto->recurringCharges != NULL) { for (i = 0; i < _offerPricePlanDto->_sizeof_recurringCharges; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor recurringCharges[%i] of type novaglobalapi_ns0_offerPricePlanDto...\n", i); #endif freeNs0RecurringChargeDtoType(&(_offerPricePlanDto->recurringCharges[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor recurringCharges of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->recurringCharges); } if (_offerPricePlanDto->usageUnit != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor usageUnit of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif freeXsStringType(_offerPricePlanDto->usageUnit); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor usageUnit of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->usageUnit); } if (_offerPricePlanDto->usageCharges != NULL) { for (i = 0; i < _offerPricePlanDto->_sizeof_usageCharges; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor usageCharges[%i] of type novaglobalapi_ns0_offerPricePlanDto...\n", i); #endif freeNs0UsageChargeDtoType(&(_offerPricePlanDto->usageCharges[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor usageCharges of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->usageCharges); } if (_offerPricePlanDto->subscriptionFees != NULL) { for (i = 0; i < _offerPricePlanDto->_sizeof_subscriptionFees; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor subscriptionFees[%i] of type novaglobalapi_ns0_offerPricePlanDto...\n", i); #endif freeNs0SubscriptionFeeDtoType(&(_offerPricePlanDto->subscriptionFees[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor subscriptionFees of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->subscriptionFees); } if (_offerPricePlanDto->terminationFees != NULL) { for (i = 0; i < _offerPricePlanDto->_sizeof_terminationFees; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor terminationFees[%i] of type novaglobalapi_ns0_offerPricePlanDto...\n", i); #endif freeNs0TerminationFeeDtoType(&(_offerPricePlanDto->terminationFees[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor terminationFees of type novaglobalapi_ns0_offerPricePlanDto...\n"); #endif free(_offerPricePlanDto->terminationFees); } } #endif /* DEF_novaglobalapi_ns0_offerPricePlanDto_M */ #ifndef DEF_novaglobalapi_ns0_organizationDto_M #define DEF_novaglobalapi_ns0_organizationDto_M /** * Reads a OrganizationDto element from XML. The element to be read is "organization", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The OrganizationDto, or NULL in case of error. */ struct novaglobalapi_ns0_organizationDto *xml_read_novaglobalapi_ns0_organizationDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0OrganizationElement(reader); } /** * Writes a OrganizationDto to XML under element name "organization". * * @param writer The XML writer. * @param _organizationDto The OrganizationDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_organizationDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_organizationDto *_organizationDto) { return xmlTextWriterWriteNs0OrganizationElementNS(writer, _organizationDto, 1); } /** * Frees a OrganizationDto. * * @param _organizationDto The OrganizationDto to free. */ void free_novaglobalapi_ns0_organizationDto(struct novaglobalapi_ns0_organizationDto *_organizationDto) { freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); } /** * Reads a OrganizationDto element from XML. The element to be read is "organization", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The OrganizationDto, or NULL in case of error. */ struct novaglobalapi_ns0_organizationDto *xmlTextReaderReadNs0OrganizationElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_organizationDto *_organizationDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organization", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}organization.\n"); #endif _organizationDto = xmlTextReaderReadNs0OrganizationDtoType(reader); } #if DEBUG_ENUNCIATE if (_organizationDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}organization failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}organization failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _organizationDto; } /** * Writes a OrganizationDto to XML under element name "organization". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _organizationDto The OrganizationDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0OrganizationElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_organizationDto *_organizationDto) { return xmlTextWriterWriteNs0OrganizationElementNS(writer, _organizationDto, 0); } /** * Writes a OrganizationDto to XML under element name "organization". * * @param writer The XML writer. * @param _organizationDto The OrganizationDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0OrganizationElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_organizationDto *_organizationDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organization", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}organization. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}organizationDto for root element {}organization...\n"); #endif status = xmlTextWriterWriteNs0OrganizationDtoType(writer, _organizationDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}organization. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}organization. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a OrganizationDto. * * @param _organizationDto The OrganizationDto whose children are to be free. */ static void freeNs0OrganizationElement(struct novaglobalapi_ns0_organizationDto *_organizationDto) { freeNs0OrganizationDtoType(_organizationDto); } /** * Reads a OrganizationDto from XML. The reader is assumed to be at the start element. * * @return the OrganizationDto, or NULL in case of error. */ static struct novaglobalapi_ns0_organizationDto *xmlTextReaderReadNs0OrganizationDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_organizationDto *_organizationDto = calloc(1, sizeof(struct novaglobalapi_ns0_organizationDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); return NULL; } _organizationDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); return NULL; } _organizationDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); return NULL; } _organizationDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); return NULL; } _organizationDto->organizationId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); return NULL; } _organizationDto->name = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "parentId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}parentId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}parentId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); return NULL; } _organizationDto->parentId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); return NULL; } _organizationDto->countryCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "defaultCurrencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}defaultCurrencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}defaultCurrencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0OrganizationDtoType(_organizationDto); free(_organizationDto); return NULL; } _organizationDto->defaultCurrencyCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}organizationDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}organizationDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _organizationDto; } /** * Writes a OrganizationDto to XML. * * @param writer The XML writer. * @param _organizationDto The OrganizationDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0OrganizationDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_organizationDto *_organizationDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_organizationDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_organizationDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_organizationDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_organizationDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_organizationDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_organizationDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_organizationDto->organizationId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_organizationDto->organizationId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_organizationDto->name != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}name. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_organizationDto->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}name. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}name. status: %i\n", status); #endif return status; } totalBytes += status; } if (_organizationDto->parentId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "parentId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}parentId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}parentId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_organizationDto->parentId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}parentId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}parentId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_organizationDto->countryCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}countryCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}countryCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_organizationDto->countryCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}countryCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}countryCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_organizationDto->defaultCurrencyCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "defaultCurrencyCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}defaultCurrencyCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}defaultCurrencyCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_organizationDto->defaultCurrencyCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}defaultCurrencyCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}defaultCurrencyCode. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a OrganizationDto. * * @param _organizationDto The OrganizationDto to free. */ static void freeNs0OrganizationDtoType(struct novaglobalapi_ns0_organizationDto *_organizationDto) { int i; if (_organizationDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_organizationDto...\n"); #endif freeXsLongType(_organizationDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_organizationDto...\n"); #endif free(_organizationDto->providerId); } if (_organizationDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_organizationDto...\n"); #endif freeXsLongType(_organizationDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_organizationDto...\n"); #endif free(_organizationDto->currentUserId); } if (_organizationDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_organizationDto...\n"); #endif freeXsStringType(_organizationDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_organizationDto...\n"); #endif free(_organizationDto->requestId); } if (_organizationDto->organizationId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor organizationId of type novaglobalapi_ns0_organizationDto...\n"); #endif freeXsStringType(_organizationDto->organizationId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor organizationId of type novaglobalapi_ns0_organizationDto...\n"); #endif free(_organizationDto->organizationId); } if (_organizationDto->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type novaglobalapi_ns0_organizationDto...\n"); #endif freeXsStringType(_organizationDto->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type novaglobalapi_ns0_organizationDto...\n"); #endif free(_organizationDto->name); } if (_organizationDto->parentId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor parentId of type novaglobalapi_ns0_organizationDto...\n"); #endif freeXsStringType(_organizationDto->parentId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor parentId of type novaglobalapi_ns0_organizationDto...\n"); #endif free(_organizationDto->parentId); } if (_organizationDto->countryCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor countryCode of type novaglobalapi_ns0_organizationDto...\n"); #endif freeXsStringType(_organizationDto->countryCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor countryCode of type novaglobalapi_ns0_organizationDto...\n"); #endif free(_organizationDto->countryCode); } if (_organizationDto->defaultCurrencyCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor defaultCurrencyCode of type novaglobalapi_ns0_organizationDto...\n"); #endif freeXsStringType(_organizationDto->defaultCurrencyCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor defaultCurrencyCode of type novaglobalapi_ns0_organizationDto...\n"); #endif free(_organizationDto->defaultCurrencyCode); } } #endif /* DEF_novaglobalapi_ns0_organizationDto_M */ #ifndef DEF_novaglobalapi_ns0_recurringChargeDto_M #define DEF_novaglobalapi_ns0_recurringChargeDto_M /** * Reads a RecurringChargeDto element from XML. The element to be read is "recurringCharge", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The RecurringChargeDto, or NULL in case of error. */ struct novaglobalapi_ns0_recurringChargeDto *xml_read_novaglobalapi_ns0_recurringChargeDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0RecurringChargeElement(reader); } /** * Writes a RecurringChargeDto to XML under element name "recurringCharge". * * @param writer The XML writer. * @param _recurringChargeDto The RecurringChargeDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_recurringChargeDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto) { return xmlTextWriterWriteNs0RecurringChargeElementNS(writer, _recurringChargeDto, 1); } /** * Frees a RecurringChargeDto. * * @param _recurringChargeDto The RecurringChargeDto to free. */ void free_novaglobalapi_ns0_recurringChargeDto(struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto) { freeNs0RecurringChargeDtoType(_recurringChargeDto); free(_recurringChargeDto); } /** * Reads a RecurringChargeDto element from XML. The element to be read is "recurringCharge", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The RecurringChargeDto, or NULL in case of error. */ struct novaglobalapi_ns0_recurringChargeDto *xmlTextReaderReadNs0RecurringChargeElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recurringCharge", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}recurringCharge.\n"); #endif _recurringChargeDto = xmlTextReaderReadNs0RecurringChargeDtoType(reader); } #if DEBUG_ENUNCIATE if (_recurringChargeDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}recurringCharge failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}recurringCharge failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _recurringChargeDto; } /** * Writes a RecurringChargeDto to XML under element name "recurringCharge". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _recurringChargeDto The RecurringChargeDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0RecurringChargeElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto) { return xmlTextWriterWriteNs0RecurringChargeElementNS(writer, _recurringChargeDto, 0); } /** * Writes a RecurringChargeDto to XML under element name "recurringCharge". * * @param writer The XML writer. * @param _recurringChargeDto The RecurringChargeDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0RecurringChargeElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recurringCharge", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}recurringCharge. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}recurringChargeDto for root element {}recurringCharge...\n"); #endif status = xmlTextWriterWriteNs0RecurringChargeDtoType(writer, _recurringChargeDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}recurringCharge. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}recurringCharge. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a RecurringChargeDto. * * @param _recurringChargeDto The RecurringChargeDto whose children are to be free. */ static void freeNs0RecurringChargeElement(struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto) { freeNs0RecurringChargeDtoType(_recurringChargeDto); } /** * Reads a RecurringChargeDto from XML. The reader is assumed to be at the start element. * * @return the RecurringChargeDto, or NULL in case of error. */ static struct novaglobalapi_ns0_recurringChargeDto *xmlTextReaderReadNs0RecurringChargeDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto = calloc(1, sizeof(struct novaglobalapi_ns0_recurringChargeDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0RecurringChargeDtoType(_recurringChargeDto); free(_recurringChargeDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0RecurringChargeDtoType(_recurringChargeDto); free(_recurringChargeDto); return NULL; } _recurringChargeDto->currencyCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "startDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0RecurringChargeDtoType(_recurringChargeDto); free(_recurringChargeDto); return NULL; } _recurringChargeDto->startDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "endDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0RecurringChargeDtoType(_recurringChargeDto); free(_recurringChargeDto); return NULL; } _recurringChargeDto->endDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "minAge", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}minAge of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif _child_accessor = xmlTextReaderReadXsIntType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}minAge of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif //panic: unable to read the child element for some reason. freeNs0RecurringChargeDtoType(_recurringChargeDto); free(_recurringChargeDto); return NULL; } _recurringChargeDto->minAge = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "maxAge", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}maxAge of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif _child_accessor = xmlTextReaderReadXsIntType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}maxAge of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif //panic: unable to read the child element for some reason. freeNs0RecurringChargeDtoType(_recurringChargeDto); free(_recurringChargeDto); return NULL; } _recurringChargeDto->maxAge = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0RecurringChargeDtoType(_recurringChargeDto); free(_recurringChargeDto); return NULL; } _recurringChargeDto->price = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recommendedPrice", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0RecurringChargeDtoType(_recurringChargeDto); free(_recurringChargeDto); return NULL; } _recurringChargeDto->recommendedPrice = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}recurringChargeDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}recurringChargeDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _recurringChargeDto; } /** * Writes a RecurringChargeDto to XML. * * @param writer The XML writer. * @param _recurringChargeDto The RecurringChargeDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0RecurringChargeDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_recurringChargeDto->currencyCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_recurringChargeDto->currencyCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_recurringChargeDto->startDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "startDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}startDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_recurringChargeDto->startDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; } if (_recurringChargeDto->endDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "endDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}endDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_recurringChargeDto->endDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; } if (_recurringChargeDto->minAge != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "minAge", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}minAge. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}minAge...\n"); #endif status = xmlTextWriterWriteXsIntType(writer, (_recurringChargeDto->minAge)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}minAge. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}minAge. status: %i\n", status); #endif return status; } totalBytes += status; } if (_recurringChargeDto->maxAge != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "maxAge", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}maxAge. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}maxAge...\n"); #endif status = xmlTextWriterWriteXsIntType(writer, (_recurringChargeDto->maxAge)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}maxAge. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}maxAge. status: %i\n", status); #endif return status; } totalBytes += status; } if (_recurringChargeDto->price != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "price", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}price. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}price...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_recurringChargeDto->price)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}price. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}price. status: %i\n", status); #endif return status; } totalBytes += status; } if (_recurringChargeDto->recommendedPrice != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recommendedPrice", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}recommendedPrice...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_recurringChargeDto->recommendedPrice)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a RecurringChargeDto. * * @param _recurringChargeDto The RecurringChargeDto to free. */ static void freeNs0RecurringChargeDtoType(struct novaglobalapi_ns0_recurringChargeDto *_recurringChargeDto) { int i; if (_recurringChargeDto->currencyCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currencyCode of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif freeXsStringType(_recurringChargeDto->currencyCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currencyCode of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif free(_recurringChargeDto->currencyCode); } if (_recurringChargeDto->startDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor startDate of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif freeXsDateTimeType(_recurringChargeDto->startDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor startDate of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif free(_recurringChargeDto->startDate); } if (_recurringChargeDto->endDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor endDate of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif freeXsDateTimeType(_recurringChargeDto->endDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor endDate of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif free(_recurringChargeDto->endDate); } if (_recurringChargeDto->minAge != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor minAge of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif freeXsIntType(_recurringChargeDto->minAge); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor minAge of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif free(_recurringChargeDto->minAge); } if (_recurringChargeDto->maxAge != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor maxAge of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif freeXsIntType(_recurringChargeDto->maxAge); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor maxAge of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif free(_recurringChargeDto->maxAge); } if (_recurringChargeDto->price != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor price of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif freeXsDecimalType(_recurringChargeDto->price); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor price of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif free(_recurringChargeDto->price); } if (_recurringChargeDto->recommendedPrice != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor recommendedPrice of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif freeXsDecimalType(_recurringChargeDto->recommendedPrice); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor recommendedPrice of type novaglobalapi_ns0_recurringChargeDto...\n"); #endif free(_recurringChargeDto->recommendedPrice); } } #endif /* DEF_novaglobalapi_ns0_recurringChargeDto_M */ #ifndef DEF_novaglobalapi_ns0_serviceDto_M #define DEF_novaglobalapi_ns0_serviceDto_M /** * Reads a ServiceDto element from XML. The element to be read is "service", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ServiceDto, or NULL in case of error. */ struct novaglobalapi_ns0_serviceDto *xml_read_novaglobalapi_ns0_serviceDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0ServiceElement(reader); } /** * Writes a ServiceDto to XML under element name "service". * * @param writer The XML writer. * @param _serviceDto The ServiceDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_serviceDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceDto *_serviceDto) { return xmlTextWriterWriteNs0ServiceElementNS(writer, _serviceDto, 1); } /** * Frees a ServiceDto. * * @param _serviceDto The ServiceDto to free. */ void free_novaglobalapi_ns0_serviceDto(struct novaglobalapi_ns0_serviceDto *_serviceDto) { freeNs0ServiceDtoType(_serviceDto); free(_serviceDto); } /** * Reads a ServiceDto element from XML. The element to be read is "service", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The ServiceDto, or NULL in case of error. */ struct novaglobalapi_ns0_serviceDto *xmlTextReaderReadNs0ServiceElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_serviceDto *_serviceDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "service", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}service.\n"); #endif _serviceDto = xmlTextReaderReadNs0ServiceDtoType(reader); } #if DEBUG_ENUNCIATE if (_serviceDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}service failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}service failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _serviceDto; } /** * Writes a ServiceDto to XML under element name "service". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _serviceDto The ServiceDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0ServiceElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceDto *_serviceDto) { return xmlTextWriterWriteNs0ServiceElementNS(writer, _serviceDto, 0); } /** * Writes a ServiceDto to XML under element name "service". * * @param writer The XML writer. * @param _serviceDto The ServiceDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0ServiceElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceDto *_serviceDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "service", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}service. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}serviceDto for root element {}service...\n"); #endif status = xmlTextWriterWriteNs0ServiceDtoType(writer, _serviceDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}service. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}service. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a ServiceDto. * * @param _serviceDto The ServiceDto whose children are to be free. */ static void freeNs0ServiceElement(struct novaglobalapi_ns0_serviceDto *_serviceDto) { freeNs0ServiceDtoType(_serviceDto); } /** * Reads a ServiceDto from XML. The reader is assumed to be at the start element. * * @return the ServiceDto, or NULL in case of error. */ static struct novaglobalapi_ns0_serviceDto *xmlTextReaderReadNs0ServiceDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_serviceDto *_serviceDto = calloc(1, sizeof(struct novaglobalapi_ns0_serviceDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0ServiceDtoType(_serviceDto); free(_serviceDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceDtoType(_serviceDto); free(_serviceDto); return NULL; } _serviceDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceDtoType(_serviceDto); free(_serviceDto); return NULL; } _serviceDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceDtoType(_serviceDto); free(_serviceDto); return NULL; } _serviceDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "serviceId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceDtoType(_serviceDto); free(_serviceDto); return NULL; } _serviceDto->serviceId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "descriptions", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}descriptions of type {}descriptionDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0DescriptionDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}descriptions of type {}descriptionDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceDtoType(_serviceDto); free(_serviceDto); return NULL; } _serviceDto->descriptions = realloc(_serviceDto->descriptions, (_serviceDto->_sizeof_descriptions + 1) * sizeof(struct novaglobalapi_ns0_descriptionDto)); memcpy(&(_serviceDto->descriptions[_serviceDto->_sizeof_descriptions++]), _child_accessor, sizeof(struct novaglobalapi_ns0_descriptionDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}serviceDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}serviceDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _serviceDto; } /** * Writes a ServiceDto to XML. * * @param writer The XML writer. * @param _serviceDto The ServiceDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0ServiceDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceDto *_serviceDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_serviceDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_serviceDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_serviceDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_serviceDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceDto->serviceId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "serviceId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}serviceId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}serviceId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_serviceDto->serviceId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}serviceId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}serviceId. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _serviceDto->_sizeof_descriptions; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "descriptions", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}descriptions. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}descriptionDto for element {}descriptions...\n"); #endif status = xmlTextWriterWriteNs0DescriptionDtoType(writer, &(_serviceDto->descriptions[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}descriptionDto for element {}descriptions. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}descriptions. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a ServiceDto. * * @param _serviceDto The ServiceDto to free. */ static void freeNs0ServiceDtoType(struct novaglobalapi_ns0_serviceDto *_serviceDto) { int i; if (_serviceDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_serviceDto...\n"); #endif freeXsLongType(_serviceDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_serviceDto...\n"); #endif free(_serviceDto->providerId); } if (_serviceDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_serviceDto...\n"); #endif freeXsLongType(_serviceDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_serviceDto...\n"); #endif free(_serviceDto->currentUserId); } if (_serviceDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_serviceDto...\n"); #endif freeXsStringType(_serviceDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_serviceDto...\n"); #endif free(_serviceDto->requestId); } if (_serviceDto->serviceId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor serviceId of type novaglobalapi_ns0_serviceDto...\n"); #endif freeXsStringType(_serviceDto->serviceId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor serviceId of type novaglobalapi_ns0_serviceDto...\n"); #endif free(_serviceDto->serviceId); } if (_serviceDto->descriptions != NULL) { for (i = 0; i < _serviceDto->_sizeof_descriptions; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor descriptions[%i] of type novaglobalapi_ns0_serviceDto...\n", i); #endif freeNs0DescriptionDtoType(&(_serviceDto->descriptions[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor descriptions of type novaglobalapi_ns0_serviceDto...\n"); #endif free(_serviceDto->descriptions); } } #endif /* DEF_novaglobalapi_ns0_serviceDto_M */ #ifndef DEF_novaglobalapi_ns0_servicePricePlanDto_M #define DEF_novaglobalapi_ns0_servicePricePlanDto_M /** * Reads a ServicePricePlanDto element from XML. The element to be read is "servicePlan", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ServicePricePlanDto, or NULL in case of error. */ struct novaglobalapi_ns0_servicePricePlanDto *xml_read_novaglobalapi_ns0_servicePricePlanDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0ServicePlanElement(reader); } /** * Writes a ServicePricePlanDto to XML under element name "servicePlan". * * @param writer The XML writer. * @param _servicePricePlanDto The ServicePricePlanDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_servicePricePlanDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto) { return xmlTextWriterWriteNs0ServicePlanElementNS(writer, _servicePricePlanDto, 1); } /** * Frees a ServicePricePlanDto. * * @param _servicePricePlanDto The ServicePricePlanDto to free. */ void free_novaglobalapi_ns0_servicePricePlanDto(struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto) { freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); } /** * Reads a ServicePricePlanDto element from XML. The element to be read is "servicePlan", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The ServicePricePlanDto, or NULL in case of error. */ struct novaglobalapi_ns0_servicePricePlanDto *xmlTextReaderReadNs0ServicePlanElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "servicePlan", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}servicePlan.\n"); #endif _servicePricePlanDto = xmlTextReaderReadNs0ServicePricePlanDtoType(reader); } #if DEBUG_ENUNCIATE if (_servicePricePlanDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}servicePlan failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}servicePlan failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _servicePricePlanDto; } /** * Writes a ServicePricePlanDto to XML under element name "servicePlan". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _servicePricePlanDto The ServicePricePlanDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0ServicePlanElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto) { return xmlTextWriterWriteNs0ServicePlanElementNS(writer, _servicePricePlanDto, 0); } /** * Writes a ServicePricePlanDto to XML under element name "servicePlan". * * @param writer The XML writer. * @param _servicePricePlanDto The ServicePricePlanDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0ServicePlanElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "servicePlan", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}servicePlan. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}servicePricePlanDto for root element {}servicePlan...\n"); #endif status = xmlTextWriterWriteNs0ServicePricePlanDtoType(writer, _servicePricePlanDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}servicePlan. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}servicePlan. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a ServicePricePlanDto. * * @param _servicePricePlanDto The ServicePricePlanDto whose children are to be free. */ static void freeNs0ServicePlanElement(struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto) { freeNs0ServicePricePlanDtoType(_servicePricePlanDto); } /** * Reads a ServicePricePlanDto from XML. The reader is assumed to be at the start element. * * @return the ServicePricePlanDto, or NULL in case of error. */ static struct novaglobalapi_ns0_servicePricePlanDto *xmlTextReaderReadNs0ServicePricePlanDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto = calloc(1, sizeof(struct novaglobalapi_ns0_servicePricePlanDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "serviceId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->serviceId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->organizationId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "taxId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->taxId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionProrata", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}subscriptionProrata of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}subscriptionProrata of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->subscriptionProrata = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationProrata", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}terminationProrata of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}terminationProrata of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->terminationProrata = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "applyInAdvance", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}applyInAdvance of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}applyInAdvance of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->applyInAdvance = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param1", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->param1 = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param2", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->param2 = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param3", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->param3 = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "billingPeriod", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}billingPeriod of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif _child_accessor = xmlTextReaderReadXsIntType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}billingPeriod of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->billingPeriod = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recurringCharges", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}recurringCharges of type {}recurringChargeDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0RecurringChargeDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}recurringCharges of type {}recurringChargeDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->recurringCharges = realloc(_servicePricePlanDto->recurringCharges, (_servicePricePlanDto->_sizeof_recurringCharges + 1) * sizeof(struct novaglobalapi_ns0_recurringChargeDto)); memcpy(&(_servicePricePlanDto->recurringCharges[_servicePricePlanDto->_sizeof_recurringCharges++]), _child_accessor, sizeof(struct novaglobalapi_ns0_recurringChargeDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "usageUnit", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}usageUnit of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}usageUnit of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->usageUnit = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "usageCharges", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}usageCharges of type {}usageChargeDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0UsageChargeDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}usageCharges of type {}usageChargeDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->usageCharges = realloc(_servicePricePlanDto->usageCharges, (_servicePricePlanDto->_sizeof_usageCharges + 1) * sizeof(struct novaglobalapi_ns0_usageChargeDto)); memcpy(&(_servicePricePlanDto->usageCharges[_servicePricePlanDto->_sizeof_usageCharges++]), _child_accessor, sizeof(struct novaglobalapi_ns0_usageChargeDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionFees", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}subscriptionFees of type {}subscriptionFeeDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0SubscriptionFeeDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}subscriptionFees of type {}subscriptionFeeDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->subscriptionFees = realloc(_servicePricePlanDto->subscriptionFees, (_servicePricePlanDto->_sizeof_subscriptionFees + 1) * sizeof(struct novaglobalapi_ns0_subscriptionFeeDto)); memcpy(&(_servicePricePlanDto->subscriptionFees[_servicePricePlanDto->_sizeof_subscriptionFees++]), _child_accessor, sizeof(struct novaglobalapi_ns0_subscriptionFeeDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationFees", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}terminationFees of type {}terminationFeeDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0TerminationFeeDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}terminationFees of type {}terminationFeeDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServicePricePlanDtoType(_servicePricePlanDto); free(_servicePricePlanDto); return NULL; } _servicePricePlanDto->terminationFees = realloc(_servicePricePlanDto->terminationFees, (_servicePricePlanDto->_sizeof_terminationFees + 1) * sizeof(struct novaglobalapi_ns0_terminationFeeDto)); memcpy(&(_servicePricePlanDto->terminationFees[_servicePricePlanDto->_sizeof_terminationFees++]), _child_accessor, sizeof(struct novaglobalapi_ns0_terminationFeeDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}servicePricePlanDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}servicePricePlanDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _servicePricePlanDto; } /** * Writes a ServicePricePlanDto to XML. * * @param writer The XML writer. * @param _servicePricePlanDto The ServicePricePlanDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0ServicePricePlanDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_servicePricePlanDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_servicePricePlanDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_servicePricePlanDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_servicePricePlanDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->serviceId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "serviceId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}serviceId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}serviceId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_servicePricePlanDto->serviceId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}serviceId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}serviceId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->organizationId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_servicePricePlanDto->organizationId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->taxId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "taxId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}taxId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}taxId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_servicePricePlanDto->taxId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}taxId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}taxId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->subscriptionProrata != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionProrata", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}subscriptionProrata. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for element {}subscriptionProrata...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, (_servicePricePlanDto->subscriptionProrata)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for element {}subscriptionProrata. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}subscriptionProrata. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->terminationProrata != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationProrata", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}terminationProrata. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for element {}terminationProrata...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, (_servicePricePlanDto->terminationProrata)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for element {}terminationProrata. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}terminationProrata. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->applyInAdvance != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "applyInAdvance", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}applyInAdvance. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for element {}applyInAdvance...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, (_servicePricePlanDto->applyInAdvance)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for element {}applyInAdvance. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}applyInAdvance. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->param1 != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param1", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}param1. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}param1...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_servicePricePlanDto->param1)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}param1. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}param1. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->param2 != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param2", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}param2. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}param2...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_servicePricePlanDto->param2)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}param2. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}param2. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->param3 != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param3", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}param3. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}param3...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_servicePricePlanDto->param3)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}param3. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}param3. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->billingPeriod != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "billingPeriod", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}billingPeriod. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}billingPeriod...\n"); #endif status = xmlTextWriterWriteXsIntType(writer, (_servicePricePlanDto->billingPeriod)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}billingPeriod. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}billingPeriod. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _servicePricePlanDto->_sizeof_recurringCharges; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recurringCharges", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}recurringCharges. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}recurringChargeDto for element {}recurringCharges...\n"); #endif status = xmlTextWriterWriteNs0RecurringChargeDtoType(writer, &(_servicePricePlanDto->recurringCharges[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}recurringChargeDto for element {}recurringCharges. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}recurringCharges. status: %i\n", status); #endif return status; } totalBytes += status; } if (_servicePricePlanDto->usageUnit != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "usageUnit", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}usageUnit. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}usageUnit...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_servicePricePlanDto->usageUnit)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}usageUnit. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}usageUnit. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _servicePricePlanDto->_sizeof_usageCharges; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "usageCharges", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}usageCharges. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}usageChargeDto for element {}usageCharges...\n"); #endif status = xmlTextWriterWriteNs0UsageChargeDtoType(writer, &(_servicePricePlanDto->usageCharges[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}usageChargeDto for element {}usageCharges. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}usageCharges. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _servicePricePlanDto->_sizeof_subscriptionFees; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionFees", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}subscriptionFees. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}subscriptionFeeDto for element {}subscriptionFees...\n"); #endif status = xmlTextWriterWriteNs0SubscriptionFeeDtoType(writer, &(_servicePricePlanDto->subscriptionFees[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}subscriptionFeeDto for element {}subscriptionFees. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}subscriptionFees. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _servicePricePlanDto->_sizeof_terminationFees; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationFees", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}terminationFees. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}terminationFeeDto for element {}terminationFees...\n"); #endif status = xmlTextWriterWriteNs0TerminationFeeDtoType(writer, &(_servicePricePlanDto->terminationFees[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}terminationFeeDto for element {}terminationFees. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}terminationFees. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a ServicePricePlanDto. * * @param _servicePricePlanDto The ServicePricePlanDto to free. */ static void freeNs0ServicePricePlanDtoType(struct novaglobalapi_ns0_servicePricePlanDto *_servicePricePlanDto) { int i; if (_servicePricePlanDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsLongType(_servicePricePlanDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->providerId); } if (_servicePricePlanDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsLongType(_servicePricePlanDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->currentUserId); } if (_servicePricePlanDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsStringType(_servicePricePlanDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->requestId); } if (_servicePricePlanDto->serviceId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor serviceId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsStringType(_servicePricePlanDto->serviceId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor serviceId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->serviceId); } if (_servicePricePlanDto->organizationId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor organizationId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsStringType(_servicePricePlanDto->organizationId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor organizationId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->organizationId); } if (_servicePricePlanDto->taxId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor taxId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsStringType(_servicePricePlanDto->taxId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor taxId of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->taxId); } if (_servicePricePlanDto->subscriptionProrata != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor subscriptionProrata of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsBooleanType(_servicePricePlanDto->subscriptionProrata); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor subscriptionProrata of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->subscriptionProrata); } if (_servicePricePlanDto->terminationProrata != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor terminationProrata of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsBooleanType(_servicePricePlanDto->terminationProrata); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor terminationProrata of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->terminationProrata); } if (_servicePricePlanDto->applyInAdvance != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor applyInAdvance of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsBooleanType(_servicePricePlanDto->applyInAdvance); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor applyInAdvance of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->applyInAdvance); } if (_servicePricePlanDto->param1 != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor param1 of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsStringType(_servicePricePlanDto->param1); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor param1 of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->param1); } if (_servicePricePlanDto->param2 != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor param2 of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsStringType(_servicePricePlanDto->param2); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor param2 of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->param2); } if (_servicePricePlanDto->param3 != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor param3 of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsStringType(_servicePricePlanDto->param3); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor param3 of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->param3); } if (_servicePricePlanDto->billingPeriod != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor billingPeriod of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsIntType(_servicePricePlanDto->billingPeriod); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor billingPeriod of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->billingPeriod); } if (_servicePricePlanDto->recurringCharges != NULL) { for (i = 0; i < _servicePricePlanDto->_sizeof_recurringCharges; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor recurringCharges[%i] of type novaglobalapi_ns0_servicePricePlanDto...\n", i); #endif freeNs0RecurringChargeDtoType(&(_servicePricePlanDto->recurringCharges[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor recurringCharges of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->recurringCharges); } if (_servicePricePlanDto->usageUnit != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor usageUnit of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif freeXsStringType(_servicePricePlanDto->usageUnit); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor usageUnit of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->usageUnit); } if (_servicePricePlanDto->usageCharges != NULL) { for (i = 0; i < _servicePricePlanDto->_sizeof_usageCharges; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor usageCharges[%i] of type novaglobalapi_ns0_servicePricePlanDto...\n", i); #endif freeNs0UsageChargeDtoType(&(_servicePricePlanDto->usageCharges[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor usageCharges of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->usageCharges); } if (_servicePricePlanDto->subscriptionFees != NULL) { for (i = 0; i < _servicePricePlanDto->_sizeof_subscriptionFees; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor subscriptionFees[%i] of type novaglobalapi_ns0_servicePricePlanDto...\n", i); #endif freeNs0SubscriptionFeeDtoType(&(_servicePricePlanDto->subscriptionFees[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor subscriptionFees of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->subscriptionFees); } if (_servicePricePlanDto->terminationFees != NULL) { for (i = 0; i < _servicePricePlanDto->_sizeof_terminationFees; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor terminationFees[%i] of type novaglobalapi_ns0_servicePricePlanDto...\n", i); #endif freeNs0TerminationFeeDtoType(&(_servicePricePlanDto->terminationFees[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor terminationFees of type novaglobalapi_ns0_servicePricePlanDto...\n"); #endif free(_servicePricePlanDto->terminationFees); } } #endif /* DEF_novaglobalapi_ns0_servicePricePlanDto_M */ #ifndef DEF_novaglobalapi_ns0_serviceToAddDto_M #define DEF_novaglobalapi_ns0_serviceToAddDto_M /** * Reads a ServiceToAddDto element from XML. The element to be read is "serviceToAdd", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ServiceToAddDto, or NULL in case of error. */ struct novaglobalapi_ns0_serviceToAddDto *xml_read_novaglobalapi_ns0_serviceToAddDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0ServiceToAddElement(reader); } /** * Writes a ServiceToAddDto to XML under element name "serviceToAdd". * * @param writer The XML writer. * @param _serviceToAddDto The ServiceToAddDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_serviceToAddDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto) { return xmlTextWriterWriteNs0ServiceToAddElementNS(writer, _serviceToAddDto, 1); } /** * Frees a ServiceToAddDto. * * @param _serviceToAddDto The ServiceToAddDto to free. */ void free_novaglobalapi_ns0_serviceToAddDto(struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto) { freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); } /** * Reads a ServiceToAddDto element from XML. The element to be read is "serviceToAdd", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The ServiceToAddDto, or NULL in case of error. */ struct novaglobalapi_ns0_serviceToAddDto *xmlTextReaderReadNs0ServiceToAddElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "serviceToAdd", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}serviceToAdd.\n"); #endif _serviceToAddDto = xmlTextReaderReadNs0ServiceToAddDtoType(reader); } #if DEBUG_ENUNCIATE if (_serviceToAddDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}serviceToAdd failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}serviceToAdd failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _serviceToAddDto; } /** * Writes a ServiceToAddDto to XML under element name "serviceToAdd". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _serviceToAddDto The ServiceToAddDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0ServiceToAddElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto) { return xmlTextWriterWriteNs0ServiceToAddElementNS(writer, _serviceToAddDto, 0); } /** * Writes a ServiceToAddDto to XML under element name "serviceToAdd". * * @param writer The XML writer. * @param _serviceToAddDto The ServiceToAddDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0ServiceToAddElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "serviceToAdd", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}serviceToAdd. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}serviceToAddDto for root element {}serviceToAdd...\n"); #endif status = xmlTextWriterWriteNs0ServiceToAddDtoType(writer, _serviceToAddDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}serviceToAdd. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}serviceToAdd. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a ServiceToAddDto. * * @param _serviceToAddDto The ServiceToAddDto whose children are to be free. */ static void freeNs0ServiceToAddElement(struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto) { freeNs0ServiceToAddDtoType(_serviceToAddDto); } /** * Reads a ServiceToAddDto from XML. The reader is assumed to be at the start element. * * @return the ServiceToAddDto, or NULL in case of error. */ static struct novaglobalapi_ns0_serviceToAddDto *xmlTextReaderReadNs0ServiceToAddDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto = calloc(1, sizeof(struct novaglobalapi_ns0_serviceToAddDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); return NULL; } _serviceToAddDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); return NULL; } _serviceToAddDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); return NULL; } _serviceToAddDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "serviceId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); return NULL; } _serviceToAddDto->serviceId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}subscriptionDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}subscriptionDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); return NULL; } _serviceToAddDto->subscriptionDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param1", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); return NULL; } _serviceToAddDto->param1 = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param2", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); return NULL; } _serviceToAddDto->param2 = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param3", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ServiceToAddDtoType(_serviceToAddDto); free(_serviceToAddDto); return NULL; } _serviceToAddDto->param3 = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}serviceToAddDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}serviceToAddDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _serviceToAddDto; } /** * Writes a ServiceToAddDto to XML. * * @param writer The XML writer. * @param _serviceToAddDto The ServiceToAddDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0ServiceToAddDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_serviceToAddDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_serviceToAddDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceToAddDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_serviceToAddDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceToAddDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_serviceToAddDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceToAddDto->serviceId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "serviceId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}serviceId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}serviceId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_serviceToAddDto->serviceId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}serviceId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}serviceId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceToAddDto->subscriptionDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}subscriptionDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}subscriptionDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_serviceToAddDto->subscriptionDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}subscriptionDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}subscriptionDate. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceToAddDto->param1 != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param1", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}param1. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}param1...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_serviceToAddDto->param1)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}param1. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}param1. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceToAddDto->param2 != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param2", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}param2. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}param2...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_serviceToAddDto->param2)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}param2. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}param2. status: %i\n", status); #endif return status; } totalBytes += status; } if (_serviceToAddDto->param3 != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param3", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}param3. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}param3...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_serviceToAddDto->param3)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}param3. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}param3. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a ServiceToAddDto. * * @param _serviceToAddDto The ServiceToAddDto to free. */ static void freeNs0ServiceToAddDtoType(struct novaglobalapi_ns0_serviceToAddDto *_serviceToAddDto) { int i; if (_serviceToAddDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif freeXsLongType(_serviceToAddDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif free(_serviceToAddDto->providerId); } if (_serviceToAddDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif freeXsLongType(_serviceToAddDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif free(_serviceToAddDto->currentUserId); } if (_serviceToAddDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif freeXsStringType(_serviceToAddDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif free(_serviceToAddDto->requestId); } if (_serviceToAddDto->serviceId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor serviceId of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif freeXsStringType(_serviceToAddDto->serviceId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor serviceId of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif free(_serviceToAddDto->serviceId); } if (_serviceToAddDto->subscriptionDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor subscriptionDate of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif freeXsDateTimeType(_serviceToAddDto->subscriptionDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor subscriptionDate of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif free(_serviceToAddDto->subscriptionDate); } if (_serviceToAddDto->param1 != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor param1 of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif freeXsStringType(_serviceToAddDto->param1); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor param1 of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif free(_serviceToAddDto->param1); } if (_serviceToAddDto->param2 != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor param2 of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif freeXsStringType(_serviceToAddDto->param2); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor param2 of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif free(_serviceToAddDto->param2); } if (_serviceToAddDto->param3 != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor param3 of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif freeXsStringType(_serviceToAddDto->param3); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor param3 of type novaglobalapi_ns0_serviceToAddDto...\n"); #endif free(_serviceToAddDto->param3); } } #endif /* DEF_novaglobalapi_ns0_serviceToAddDto_M */ #ifndef DEF_novaglobalapi_ns0_subscriptionFeeDto_M #define DEF_novaglobalapi_ns0_subscriptionFeeDto_M /** * Reads a SubscriptionFeeDto element from XML. The element to be read is "subscriptionFee", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The SubscriptionFeeDto, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionFeeDto *xml_read_novaglobalapi_ns0_subscriptionFeeDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0SubscriptionFeeElement(reader); } /** * Writes a SubscriptionFeeDto to XML under element name "subscriptionFee". * * @param writer The XML writer. * @param _subscriptionFeeDto The SubscriptionFeeDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_subscriptionFeeDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto) { return xmlTextWriterWriteNs0SubscriptionFeeElementNS(writer, _subscriptionFeeDto, 1); } /** * Frees a SubscriptionFeeDto. * * @param _subscriptionFeeDto The SubscriptionFeeDto to free. */ void free_novaglobalapi_ns0_subscriptionFeeDto(struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto) { freeNs0SubscriptionFeeDtoType(_subscriptionFeeDto); free(_subscriptionFeeDto); } /** * Reads a SubscriptionFeeDto element from XML. The element to be read is "subscriptionFee", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The SubscriptionFeeDto, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionFeeDto *xmlTextReaderReadNs0SubscriptionFeeElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionFee", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}subscriptionFee.\n"); #endif _subscriptionFeeDto = xmlTextReaderReadNs0SubscriptionFeeDtoType(reader); } #if DEBUG_ENUNCIATE if (_subscriptionFeeDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}subscriptionFee failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}subscriptionFee failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _subscriptionFeeDto; } /** * Writes a SubscriptionFeeDto to XML under element name "subscriptionFee". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _subscriptionFeeDto The SubscriptionFeeDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0SubscriptionFeeElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto) { return xmlTextWriterWriteNs0SubscriptionFeeElementNS(writer, _subscriptionFeeDto, 0); } /** * Writes a SubscriptionFeeDto to XML under element name "subscriptionFee". * * @param writer The XML writer. * @param _subscriptionFeeDto The SubscriptionFeeDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0SubscriptionFeeElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionFee", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}subscriptionFee. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}subscriptionFeeDto for root element {}subscriptionFee...\n"); #endif status = xmlTextWriterWriteNs0SubscriptionFeeDtoType(writer, _subscriptionFeeDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}subscriptionFee. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}subscriptionFee. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a SubscriptionFeeDto. * * @param _subscriptionFeeDto The SubscriptionFeeDto whose children are to be free. */ static void freeNs0SubscriptionFeeElement(struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto) { freeNs0SubscriptionFeeDtoType(_subscriptionFeeDto); } /** * Reads a SubscriptionFeeDto from XML. The reader is assumed to be at the start element. * * @return the SubscriptionFeeDto, or NULL in case of error. */ static struct novaglobalapi_ns0_subscriptionFeeDto *xmlTextReaderReadNs0SubscriptionFeeDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto = calloc(1, sizeof(struct novaglobalapi_ns0_subscriptionFeeDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0SubscriptionFeeDtoType(_subscriptionFeeDto); free(_subscriptionFeeDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionFeeDtoType(_subscriptionFeeDto); free(_subscriptionFeeDto); return NULL; } _subscriptionFeeDto->currencyCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "startDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionFeeDtoType(_subscriptionFeeDto); free(_subscriptionFeeDto); return NULL; } _subscriptionFeeDto->startDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "endDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionFeeDtoType(_subscriptionFeeDto); free(_subscriptionFeeDto); return NULL; } _subscriptionFeeDto->endDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionFeeDtoType(_subscriptionFeeDto); free(_subscriptionFeeDto); return NULL; } _subscriptionFeeDto->price = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recommendedPrice", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionFeeDtoType(_subscriptionFeeDto); free(_subscriptionFeeDto); return NULL; } _subscriptionFeeDto->recommendedPrice = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}subscriptionFeeDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}subscriptionFeeDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _subscriptionFeeDto; } /** * Writes a SubscriptionFeeDto to XML. * * @param writer The XML writer. * @param _subscriptionFeeDto The SubscriptionFeeDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0SubscriptionFeeDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_subscriptionFeeDto->currencyCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_subscriptionFeeDto->currencyCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionFeeDto->startDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "startDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}startDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_subscriptionFeeDto->startDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionFeeDto->endDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "endDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}endDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_subscriptionFeeDto->endDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionFeeDto->price != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "price", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}price. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}price...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_subscriptionFeeDto->price)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}price. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}price. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionFeeDto->recommendedPrice != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recommendedPrice", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}recommendedPrice...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_subscriptionFeeDto->recommendedPrice)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a SubscriptionFeeDto. * * @param _subscriptionFeeDto The SubscriptionFeeDto to free. */ static void freeNs0SubscriptionFeeDtoType(struct novaglobalapi_ns0_subscriptionFeeDto *_subscriptionFeeDto) { int i; if (_subscriptionFeeDto->currencyCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currencyCode of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif freeXsStringType(_subscriptionFeeDto->currencyCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currencyCode of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif free(_subscriptionFeeDto->currencyCode); } if (_subscriptionFeeDto->startDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor startDate of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif freeXsDateTimeType(_subscriptionFeeDto->startDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor startDate of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif free(_subscriptionFeeDto->startDate); } if (_subscriptionFeeDto->endDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor endDate of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif freeXsDateTimeType(_subscriptionFeeDto->endDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor endDate of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif free(_subscriptionFeeDto->endDate); } if (_subscriptionFeeDto->price != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor price of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif freeXsDecimalType(_subscriptionFeeDto->price); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor price of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif free(_subscriptionFeeDto->price); } if (_subscriptionFeeDto->recommendedPrice != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor recommendedPrice of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif freeXsDecimalType(_subscriptionFeeDto->recommendedPrice); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor recommendedPrice of type novaglobalapi_ns0_subscriptionFeeDto...\n"); #endif free(_subscriptionFeeDto->recommendedPrice); } } #endif /* DEF_novaglobalapi_ns0_subscriptionFeeDto_M */ #ifndef DEF_novaglobalapi_ns0_subscriptionWithCreditLimitDto_M #define DEF_novaglobalapi_ns0_subscriptionWithCreditLimitDto_M /** * Reads a SubscriptionWithCreditLimitDto element from XML. The element to be read is "subscriptionWithCreditLimitDto", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitDto, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *xml_read_novaglobalapi_ns0_subscriptionWithCreditLimitDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0SubscriptionWithCreditLimitDtoElement(reader); } /** * Writes a SubscriptionWithCreditLimitDto to XML under element name "subscriptionWithCreditLimitDto". * * @param writer The XML writer. * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_subscriptionWithCreditLimitDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto) { return xmlTextWriterWriteNs0SubscriptionWithCreditLimitDtoElementNS(writer, _subscriptionWithCreditLimitDto, 1); } /** * Frees a SubscriptionWithCreditLimitDto. * * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to free. */ void free_novaglobalapi_ns0_subscriptionWithCreditLimitDto(struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto) { freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); } /** * Reads a SubscriptionWithCreditLimitDto element from XML. The element to be read is "subscriptionWithCreditLimitDto", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitDto, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *xmlTextReaderReadNs0SubscriptionWithCreditLimitDtoElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionWithCreditLimitDto", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}subscriptionWithCreditLimitDto.\n"); #endif _subscriptionWithCreditLimitDto = xmlTextReaderReadNs0SubscriptionWithCreditLimitDtoType(reader); } #if DEBUG_ENUNCIATE if (_subscriptionWithCreditLimitDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}subscriptionWithCreditLimitDto failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}subscriptionWithCreditLimitDto failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _subscriptionWithCreditLimitDto; } /** * Writes a SubscriptionWithCreditLimitDto to XML under element name "subscriptionWithCreditLimitDto". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitDtoElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto) { return xmlTextWriterWriteNs0SubscriptionWithCreditLimitDtoElementNS(writer, _subscriptionWithCreditLimitDto, 0); } /** * Writes a SubscriptionWithCreditLimitDto to XML under element name "subscriptionWithCreditLimitDto". * * @param writer The XML writer. * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitDtoElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionWithCreditLimitDto", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}subscriptionWithCreditLimitDto. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}subscriptionWithCreditLimitDto for root element {}subscriptionWithCreditLimitDto...\n"); #endif status = xmlTextWriterWriteNs0SubscriptionWithCreditLimitDtoType(writer, _subscriptionWithCreditLimitDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}subscriptionWithCreditLimitDto. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}subscriptionWithCreditLimitDto. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a SubscriptionWithCreditLimitDto. * * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto whose children are to be free. */ static void freeNs0SubscriptionWithCreditLimitDtoElement(struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto) { freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); } /** * Reads a SubscriptionWithCreditLimitDto from XML. The reader is assumed to be at the start element. * * @return the SubscriptionWithCreditLimitDto, or NULL in case of error. */ static struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *xmlTextReaderReadNs0SubscriptionWithCreditLimitDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto = calloc(1, sizeof(struct novaglobalapi_ns0_subscriptionWithCreditLimitDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } _subscriptionWithCreditLimitDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } _subscriptionWithCreditLimitDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } _subscriptionWithCreditLimitDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "userId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}userId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}userId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } _subscriptionWithCreditLimitDto->userId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } _subscriptionWithCreditLimitDto->organizationId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "offerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } _subscriptionWithCreditLimitDto->offerId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "servicesToAdd", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}servicesToAdd of type {}serviceToAddDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0ServiceToAddDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}servicesToAdd of type {}serviceToAddDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } _subscriptionWithCreditLimitDto->servicesToAdd = realloc(_subscriptionWithCreditLimitDto->servicesToAdd, (_subscriptionWithCreditLimitDto->_sizeof_servicesToAdd + 1) * sizeof(struct novaglobalapi_ns0_serviceToAddDto)); memcpy(&(_subscriptionWithCreditLimitDto->servicesToAdd[_subscriptionWithCreditLimitDto->_sizeof_servicesToAdd++]), _child_accessor, sizeof(struct novaglobalapi_ns0_serviceToAddDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "creditLimits", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}creditLimits of type {}creditLimitDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0CreditLimitDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}creditLimits of type {}creditLimitDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } _subscriptionWithCreditLimitDto->creditLimits = realloc(_subscriptionWithCreditLimitDto->creditLimits, (_subscriptionWithCreditLimitDto->_sizeof_creditLimits + 1) * sizeof(struct novaglobalapi_ns0_creditLimitDto)); memcpy(&(_subscriptionWithCreditLimitDto->creditLimits[_subscriptionWithCreditLimitDto->_sizeof_creditLimits++]), _child_accessor, sizeof(struct novaglobalapi_ns0_creditLimitDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}subscriptionDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}subscriptionDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitDtoType(_subscriptionWithCreditLimitDto); free(_subscriptionWithCreditLimitDto); return NULL; } _subscriptionWithCreditLimitDto->subscriptionDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}subscriptionWithCreditLimitDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}subscriptionWithCreditLimitDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _subscriptionWithCreditLimitDto; } /** * Writes a SubscriptionWithCreditLimitDto to XML. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_subscriptionWithCreditLimitDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_subscriptionWithCreditLimitDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionWithCreditLimitDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_subscriptionWithCreditLimitDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionWithCreditLimitDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_subscriptionWithCreditLimitDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionWithCreditLimitDto->userId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "userId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}userId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}userId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_subscriptionWithCreditLimitDto->userId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}userId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}userId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionWithCreditLimitDto->organizationId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_subscriptionWithCreditLimitDto->organizationId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionWithCreditLimitDto->offerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "offerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}offerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}offerId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_subscriptionWithCreditLimitDto->offerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}offerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}offerId. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _subscriptionWithCreditLimitDto->_sizeof_servicesToAdd; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "servicesToAdd", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}servicesToAdd. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}serviceToAddDto for element {}servicesToAdd...\n"); #endif status = xmlTextWriterWriteNs0ServiceToAddDtoType(writer, &(_subscriptionWithCreditLimitDto->servicesToAdd[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}serviceToAddDto for element {}servicesToAdd. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}servicesToAdd. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _subscriptionWithCreditLimitDto->_sizeof_creditLimits; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "creditLimits", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}creditLimits. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}creditLimitDto for element {}creditLimits...\n"); #endif status = xmlTextWriterWriteNs0CreditLimitDtoType(writer, &(_subscriptionWithCreditLimitDto->creditLimits[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}creditLimitDto for element {}creditLimits. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}creditLimits. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionWithCreditLimitDto->subscriptionDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}subscriptionDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}subscriptionDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_subscriptionWithCreditLimitDto->subscriptionDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}subscriptionDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}subscriptionDate. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a SubscriptionWithCreditLimitDto. * * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to free. */ static void freeNs0SubscriptionWithCreditLimitDtoType(struct novaglobalapi_ns0_subscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto) { int i; if (_subscriptionWithCreditLimitDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif freeXsLongType(_subscriptionWithCreditLimitDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif free(_subscriptionWithCreditLimitDto->providerId); } if (_subscriptionWithCreditLimitDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif freeXsLongType(_subscriptionWithCreditLimitDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif free(_subscriptionWithCreditLimitDto->currentUserId); } if (_subscriptionWithCreditLimitDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif freeXsStringType(_subscriptionWithCreditLimitDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif free(_subscriptionWithCreditLimitDto->requestId); } if (_subscriptionWithCreditLimitDto->userId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor userId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif freeXsStringType(_subscriptionWithCreditLimitDto->userId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor userId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif free(_subscriptionWithCreditLimitDto->userId); } if (_subscriptionWithCreditLimitDto->organizationId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor organizationId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif freeXsStringType(_subscriptionWithCreditLimitDto->organizationId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor organizationId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif free(_subscriptionWithCreditLimitDto->organizationId); } if (_subscriptionWithCreditLimitDto->offerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor offerId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif freeXsStringType(_subscriptionWithCreditLimitDto->offerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor offerId of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif free(_subscriptionWithCreditLimitDto->offerId); } if (_subscriptionWithCreditLimitDto->servicesToAdd != NULL) { for (i = 0; i < _subscriptionWithCreditLimitDto->_sizeof_servicesToAdd; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor servicesToAdd[%i] of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n", i); #endif freeNs0ServiceToAddDtoType(&(_subscriptionWithCreditLimitDto->servicesToAdd[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor servicesToAdd of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif free(_subscriptionWithCreditLimitDto->servicesToAdd); } if (_subscriptionWithCreditLimitDto->creditLimits != NULL) { for (i = 0; i < _subscriptionWithCreditLimitDto->_sizeof_creditLimits; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor creditLimits[%i] of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n", i); #endif freeNs0CreditLimitDtoType(&(_subscriptionWithCreditLimitDto->creditLimits[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor creditLimits of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif free(_subscriptionWithCreditLimitDto->creditLimits); } if (_subscriptionWithCreditLimitDto->subscriptionDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor subscriptionDate of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif freeXsDateTimeType(_subscriptionWithCreditLimitDto->subscriptionDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor subscriptionDate of type novaglobalapi_ns0_subscriptionWithCreditLimitDto...\n"); #endif free(_subscriptionWithCreditLimitDto->subscriptionDate); } } #endif /* DEF_novaglobalapi_ns0_subscriptionWithCreditLimitDto_M */ #ifndef DEF_novaglobalapi_ns0_taxDto_M #define DEF_novaglobalapi_ns0_taxDto_M /** * Reads a TaxDto element from XML. The element to be read is "tax", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The TaxDto, or NULL in case of error. */ struct novaglobalapi_ns0_taxDto *xml_read_novaglobalapi_ns0_taxDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0TaxElement(reader); } /** * Writes a TaxDto to XML under element name "tax". * * @param writer The XML writer. * @param _taxDto The TaxDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_taxDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_taxDto *_taxDto) { return xmlTextWriterWriteNs0TaxElementNS(writer, _taxDto, 1); } /** * Frees a TaxDto. * * @param _taxDto The TaxDto to free. */ void free_novaglobalapi_ns0_taxDto(struct novaglobalapi_ns0_taxDto *_taxDto) { freeNs0TaxDtoType(_taxDto); free(_taxDto); } /** * Reads a TaxDto element from XML. The element to be read is "tax", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The TaxDto, or NULL in case of error. */ struct novaglobalapi_ns0_taxDto *xmlTextReaderReadNs0TaxElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_taxDto *_taxDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "tax", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}tax.\n"); #endif _taxDto = xmlTextReaderReadNs0TaxDtoType(reader); } #if DEBUG_ENUNCIATE if (_taxDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}tax failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}tax failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _taxDto; } /** * Writes a TaxDto to XML under element name "tax". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _taxDto The TaxDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0TaxElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_taxDto *_taxDto) { return xmlTextWriterWriteNs0TaxElementNS(writer, _taxDto, 0); } /** * Writes a TaxDto to XML under element name "tax". * * @param writer The XML writer. * @param _taxDto The TaxDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0TaxElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_taxDto *_taxDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "tax", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}tax. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}taxDto for root element {}tax...\n"); #endif status = xmlTextWriterWriteNs0TaxDtoType(writer, _taxDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}tax. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}tax. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a TaxDto. * * @param _taxDto The TaxDto whose children are to be free. */ static void freeNs0TaxElement(struct novaglobalapi_ns0_taxDto *_taxDto) { freeNs0TaxDtoType(_taxDto); } /** * Reads a TaxDto from XML. The reader is assumed to be at the start element. * * @return the TaxDto, or NULL in case of error. */ static struct novaglobalapi_ns0_taxDto *xmlTextReaderReadNs0TaxDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_taxDto *_taxDto = calloc(1, sizeof(struct novaglobalapi_ns0_taxDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0TaxDtoType(_taxDto); free(_taxDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TaxDtoType(_taxDto); free(_taxDto); return NULL; } _taxDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TaxDtoType(_taxDto); free(_taxDto); return NULL; } _taxDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TaxDtoType(_taxDto); free(_taxDto); return NULL; } _taxDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "taxId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TaxDtoType(_taxDto); free(_taxDto); return NULL; } _taxDto->taxId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TaxDtoType(_taxDto); free(_taxDto); return NULL; } _taxDto->name = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryTaxes", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}countryTaxes of type {}countryTaxDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0CountryTaxDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}countryTaxes of type {}countryTaxDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TaxDtoType(_taxDto); free(_taxDto); return NULL; } _taxDto->countryTaxes = realloc(_taxDto->countryTaxes, (_taxDto->_sizeof_countryTaxes + 1) * sizeof(struct novaglobalapi_ns0_countryTaxDto)); memcpy(&(_taxDto->countryTaxes[_taxDto->_sizeof_countryTaxes++]), _child_accessor, sizeof(struct novaglobalapi_ns0_countryTaxDto)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}taxDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}taxDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _taxDto; } /** * Writes a TaxDto to XML. * * @param writer The XML writer. * @param _taxDto The TaxDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0TaxDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_taxDto *_taxDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_taxDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_taxDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_taxDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_taxDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_taxDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_taxDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_taxDto->taxId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "taxId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}taxId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}taxId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_taxDto->taxId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}taxId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}taxId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_taxDto->name != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}name. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_taxDto->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}name. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}name. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _taxDto->_sizeof_countryTaxes; i++) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryTaxes", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}countryTaxes. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}countryTaxDto for element {}countryTaxes...\n"); #endif status = xmlTextWriterWriteNs0CountryTaxDtoType(writer, &(_taxDto->countryTaxes[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}countryTaxDto for element {}countryTaxes. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}countryTaxes. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a TaxDto. * * @param _taxDto The TaxDto to free. */ static void freeNs0TaxDtoType(struct novaglobalapi_ns0_taxDto *_taxDto) { int i; if (_taxDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_taxDto...\n"); #endif freeXsLongType(_taxDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_taxDto...\n"); #endif free(_taxDto->providerId); } if (_taxDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_taxDto...\n"); #endif freeXsLongType(_taxDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_taxDto...\n"); #endif free(_taxDto->currentUserId); } if (_taxDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_taxDto...\n"); #endif freeXsStringType(_taxDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_taxDto...\n"); #endif free(_taxDto->requestId); } if (_taxDto->taxId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor taxId of type novaglobalapi_ns0_taxDto...\n"); #endif freeXsStringType(_taxDto->taxId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor taxId of type novaglobalapi_ns0_taxDto...\n"); #endif free(_taxDto->taxId); } if (_taxDto->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type novaglobalapi_ns0_taxDto...\n"); #endif freeXsStringType(_taxDto->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type novaglobalapi_ns0_taxDto...\n"); #endif free(_taxDto->name); } if (_taxDto->countryTaxes != NULL) { for (i = 0; i < _taxDto->_sizeof_countryTaxes; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor countryTaxes[%i] of type novaglobalapi_ns0_taxDto...\n", i); #endif freeNs0CountryTaxDtoType(&(_taxDto->countryTaxes[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor countryTaxes of type novaglobalapi_ns0_taxDto...\n"); #endif free(_taxDto->countryTaxes); } } #endif /* DEF_novaglobalapi_ns0_taxDto_M */ #ifndef DEF_novaglobalapi_ns0_terminationFeeDto_M #define DEF_novaglobalapi_ns0_terminationFeeDto_M /** * Reads a TerminationFeeDto element from XML. The element to be read is "terminationFee", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The TerminationFeeDto, or NULL in case of error. */ struct novaglobalapi_ns0_terminationFeeDto *xml_read_novaglobalapi_ns0_terminationFeeDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0TerminationFeeElement(reader); } /** * Writes a TerminationFeeDto to XML under element name "terminationFee". * * @param writer The XML writer. * @param _terminationFeeDto The TerminationFeeDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_terminationFeeDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto) { return xmlTextWriterWriteNs0TerminationFeeElementNS(writer, _terminationFeeDto, 1); } /** * Frees a TerminationFeeDto. * * @param _terminationFeeDto The TerminationFeeDto to free. */ void free_novaglobalapi_ns0_terminationFeeDto(struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto) { freeNs0TerminationFeeDtoType(_terminationFeeDto); free(_terminationFeeDto); } /** * Reads a TerminationFeeDto element from XML. The element to be read is "terminationFee", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The TerminationFeeDto, or NULL in case of error. */ struct novaglobalapi_ns0_terminationFeeDto *xmlTextReaderReadNs0TerminationFeeElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationFee", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}terminationFee.\n"); #endif _terminationFeeDto = xmlTextReaderReadNs0TerminationFeeDtoType(reader); } #if DEBUG_ENUNCIATE if (_terminationFeeDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}terminationFee failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}terminationFee failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _terminationFeeDto; } /** * Writes a TerminationFeeDto to XML under element name "terminationFee". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _terminationFeeDto The TerminationFeeDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0TerminationFeeElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto) { return xmlTextWriterWriteNs0TerminationFeeElementNS(writer, _terminationFeeDto, 0); } /** * Writes a TerminationFeeDto to XML under element name "terminationFee". * * @param writer The XML writer. * @param _terminationFeeDto The TerminationFeeDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0TerminationFeeElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationFee", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}terminationFee. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}terminationFeeDto for root element {}terminationFee...\n"); #endif status = xmlTextWriterWriteNs0TerminationFeeDtoType(writer, _terminationFeeDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}terminationFee. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}terminationFee. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a TerminationFeeDto. * * @param _terminationFeeDto The TerminationFeeDto whose children are to be free. */ static void freeNs0TerminationFeeElement(struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto) { freeNs0TerminationFeeDtoType(_terminationFeeDto); } /** * Reads a TerminationFeeDto from XML. The reader is assumed to be at the start element. * * @return the TerminationFeeDto, or NULL in case of error. */ static struct novaglobalapi_ns0_terminationFeeDto *xmlTextReaderReadNs0TerminationFeeDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto = calloc(1, sizeof(struct novaglobalapi_ns0_terminationFeeDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0TerminationFeeDtoType(_terminationFeeDto); free(_terminationFeeDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TerminationFeeDtoType(_terminationFeeDto); free(_terminationFeeDto); return NULL; } _terminationFeeDto->currencyCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "startDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TerminationFeeDtoType(_terminationFeeDto); free(_terminationFeeDto); return NULL; } _terminationFeeDto->startDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "endDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TerminationFeeDtoType(_terminationFeeDto); free(_terminationFeeDto); return NULL; } _terminationFeeDto->endDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TerminationFeeDtoType(_terminationFeeDto); free(_terminationFeeDto); return NULL; } _terminationFeeDto->price = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recommendedPrice", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0TerminationFeeDtoType(_terminationFeeDto); free(_terminationFeeDto); return NULL; } _terminationFeeDto->recommendedPrice = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}terminationFeeDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}terminationFeeDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _terminationFeeDto; } /** * Writes a TerminationFeeDto to XML. * * @param writer The XML writer. * @param _terminationFeeDto The TerminationFeeDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0TerminationFeeDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_terminationFeeDto->currencyCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_terminationFeeDto->currencyCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_terminationFeeDto->startDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "startDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}startDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_terminationFeeDto->startDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; } if (_terminationFeeDto->endDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "endDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}endDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_terminationFeeDto->endDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; } if (_terminationFeeDto->price != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "price", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}price. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}price...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_terminationFeeDto->price)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}price. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}price. status: %i\n", status); #endif return status; } totalBytes += status; } if (_terminationFeeDto->recommendedPrice != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recommendedPrice", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}recommendedPrice...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_terminationFeeDto->recommendedPrice)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a TerminationFeeDto. * * @param _terminationFeeDto The TerminationFeeDto to free. */ static void freeNs0TerminationFeeDtoType(struct novaglobalapi_ns0_terminationFeeDto *_terminationFeeDto) { int i; if (_terminationFeeDto->currencyCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currencyCode of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif freeXsStringType(_terminationFeeDto->currencyCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currencyCode of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif free(_terminationFeeDto->currencyCode); } if (_terminationFeeDto->startDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor startDate of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif freeXsDateTimeType(_terminationFeeDto->startDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor startDate of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif free(_terminationFeeDto->startDate); } if (_terminationFeeDto->endDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor endDate of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif freeXsDateTimeType(_terminationFeeDto->endDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor endDate of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif free(_terminationFeeDto->endDate); } if (_terminationFeeDto->price != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor price of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif freeXsDecimalType(_terminationFeeDto->price); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor price of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif free(_terminationFeeDto->price); } if (_terminationFeeDto->recommendedPrice != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor recommendedPrice of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif freeXsDecimalType(_terminationFeeDto->recommendedPrice); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor recommendedPrice of type novaglobalapi_ns0_terminationFeeDto...\n"); #endif free(_terminationFeeDto->recommendedPrice); } } #endif /* DEF_novaglobalapi_ns0_terminationFeeDto_M */ #ifndef DEF_novaglobalapi_ns0_usageChargeDto_M #define DEF_novaglobalapi_ns0_usageChargeDto_M /** * Reads a UsageChargeDto element from XML. The element to be read is "usageCharge", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The UsageChargeDto, or NULL in case of error. */ struct novaglobalapi_ns0_usageChargeDto *xml_read_novaglobalapi_ns0_usageChargeDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0UsageChargeElement(reader); } /** * Writes a UsageChargeDto to XML under element name "usageCharge". * * @param writer The XML writer. * @param _usageChargeDto The UsageChargeDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_usageChargeDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto) { return xmlTextWriterWriteNs0UsageChargeElementNS(writer, _usageChargeDto, 1); } /** * Frees a UsageChargeDto. * * @param _usageChargeDto The UsageChargeDto to free. */ void free_novaglobalapi_ns0_usageChargeDto(struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto) { freeNs0UsageChargeDtoType(_usageChargeDto); free(_usageChargeDto); } /** * Reads a UsageChargeDto element from XML. The element to be read is "usageCharge", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The UsageChargeDto, or NULL in case of error. */ struct novaglobalapi_ns0_usageChargeDto *xmlTextReaderReadNs0UsageChargeElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "usageCharge", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}usageCharge.\n"); #endif _usageChargeDto = xmlTextReaderReadNs0UsageChargeDtoType(reader); } #if DEBUG_ENUNCIATE if (_usageChargeDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}usageCharge failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}usageCharge failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _usageChargeDto; } /** * Writes a UsageChargeDto to XML under element name "usageCharge". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _usageChargeDto The UsageChargeDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0UsageChargeElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto) { return xmlTextWriterWriteNs0UsageChargeElementNS(writer, _usageChargeDto, 0); } /** * Writes a UsageChargeDto to XML under element name "usageCharge". * * @param writer The XML writer. * @param _usageChargeDto The UsageChargeDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0UsageChargeElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "usageCharge", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}usageCharge. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}usageChargeDto for root element {}usageCharge...\n"); #endif status = xmlTextWriterWriteNs0UsageChargeDtoType(writer, _usageChargeDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}usageCharge. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}usageCharge. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a UsageChargeDto. * * @param _usageChargeDto The UsageChargeDto whose children are to be free. */ static void freeNs0UsageChargeElement(struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto) { freeNs0UsageChargeDtoType(_usageChargeDto); } /** * Reads a UsageChargeDto from XML. The reader is assumed to be at the start element. * * @return the UsageChargeDto, or NULL in case of error. */ static struct novaglobalapi_ns0_usageChargeDto *xmlTextReaderReadNs0UsageChargeDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto = calloc(1, sizeof(struct novaglobalapi_ns0_usageChargeDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0UsageChargeDtoType(_usageChargeDto); free(_usageChargeDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "min", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}min of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif _child_accessor = xmlTextReaderReadXsIntType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}min of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UsageChargeDtoType(_usageChargeDto); free(_usageChargeDto); return NULL; } _usageChargeDto->min = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "max", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}max of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif _child_accessor = xmlTextReaderReadXsIntType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}max of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UsageChargeDtoType(_usageChargeDto); free(_usageChargeDto); return NULL; } _usageChargeDto->max = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UsageChargeDtoType(_usageChargeDto); free(_usageChargeDto); return NULL; } _usageChargeDto->currencyCode = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "startDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UsageChargeDtoType(_usageChargeDto); free(_usageChargeDto); return NULL; } _usageChargeDto->startDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "endDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UsageChargeDtoType(_usageChargeDto); free(_usageChargeDto); return NULL; } _usageChargeDto->endDate = ((struct tm*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UsageChargeDtoType(_usageChargeDto); free(_usageChargeDto); return NULL; } _usageChargeDto->price = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recommendedPrice", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif _child_accessor = xmlTextReaderReadXsDecimalType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UsageChargeDtoType(_usageChargeDto); free(_usageChargeDto); return NULL; } _usageChargeDto->recommendedPrice = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}usageChargeDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}usageChargeDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _usageChargeDto; } /** * Writes a UsageChargeDto to XML. * * @param writer The XML writer. * @param _usageChargeDto The UsageChargeDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0UsageChargeDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_usageChargeDto->min != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "min", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}min. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}min...\n"); #endif status = xmlTextWriterWriteXsIntType(writer, (_usageChargeDto->min)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}min. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}min. status: %i\n", status); #endif return status; } totalBytes += status; } if (_usageChargeDto->max != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "max", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}max. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}max...\n"); #endif status = xmlTextWriterWriteXsIntType(writer, (_usageChargeDto->max)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}max. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}max. status: %i\n", status); #endif return status; } totalBytes += status; } if (_usageChargeDto->currencyCode != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_usageChargeDto->currencyCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currencyCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_usageChargeDto->startDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "startDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}startDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_usageChargeDto->startDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}startDate. status: %i\n", status); #endif return status; } totalBytes += status; } if (_usageChargeDto->endDate != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "endDate", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}endDate...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_usageChargeDto->endDate)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}endDate. status: %i\n", status); #endif return status; } totalBytes += status; } if (_usageChargeDto->price != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "price", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}price. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}price...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_usageChargeDto->price)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}price. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}price. status: %i\n", status); #endif return status; } totalBytes += status; } if (_usageChargeDto->recommendedPrice != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recommendedPrice", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}recommendedPrice...\n"); #endif status = xmlTextWriterWriteXsDecimalType(writer, (_usageChargeDto->recommendedPrice)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}recommendedPrice. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a UsageChargeDto. * * @param _usageChargeDto The UsageChargeDto to free. */ static void freeNs0UsageChargeDtoType(struct novaglobalapi_ns0_usageChargeDto *_usageChargeDto) { int i; if (_usageChargeDto->min != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor min of type novaglobalapi_ns0_usageChargeDto...\n"); #endif freeXsIntType(_usageChargeDto->min); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor min of type novaglobalapi_ns0_usageChargeDto...\n"); #endif free(_usageChargeDto->min); } if (_usageChargeDto->max != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor max of type novaglobalapi_ns0_usageChargeDto...\n"); #endif freeXsIntType(_usageChargeDto->max); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor max of type novaglobalapi_ns0_usageChargeDto...\n"); #endif free(_usageChargeDto->max); } if (_usageChargeDto->currencyCode != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currencyCode of type novaglobalapi_ns0_usageChargeDto...\n"); #endif freeXsStringType(_usageChargeDto->currencyCode); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currencyCode of type novaglobalapi_ns0_usageChargeDto...\n"); #endif free(_usageChargeDto->currencyCode); } if (_usageChargeDto->startDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor startDate of type novaglobalapi_ns0_usageChargeDto...\n"); #endif freeXsDateTimeType(_usageChargeDto->startDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor startDate of type novaglobalapi_ns0_usageChargeDto...\n"); #endif free(_usageChargeDto->startDate); } if (_usageChargeDto->endDate != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor endDate of type novaglobalapi_ns0_usageChargeDto...\n"); #endif freeXsDateTimeType(_usageChargeDto->endDate); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor endDate of type novaglobalapi_ns0_usageChargeDto...\n"); #endif free(_usageChargeDto->endDate); } if (_usageChargeDto->price != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor price of type novaglobalapi_ns0_usageChargeDto...\n"); #endif freeXsDecimalType(_usageChargeDto->price); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor price of type novaglobalapi_ns0_usageChargeDto...\n"); #endif free(_usageChargeDto->price); } if (_usageChargeDto->recommendedPrice != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor recommendedPrice of type novaglobalapi_ns0_usageChargeDto...\n"); #endif freeXsDecimalType(_usageChargeDto->recommendedPrice); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor recommendedPrice of type novaglobalapi_ns0_usageChargeDto...\n"); #endif free(_usageChargeDto->recommendedPrice); } } #endif /* DEF_novaglobalapi_ns0_usageChargeDto_M */ #ifndef DEF_novaglobalapi_ns0_userDto_M #define DEF_novaglobalapi_ns0_userDto_M /** * Reads a UserDto element from XML. The element to be read is "user", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The UserDto, or NULL in case of error. */ struct novaglobalapi_ns0_userDto *xml_read_novaglobalapi_ns0_userDto(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0UserElement(reader); } /** * Writes a UserDto to XML under element name "user". * * @param writer The XML writer. * @param _userDto The UserDto to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_userDto(xmlTextWriterPtr writer, struct novaglobalapi_ns0_userDto *_userDto) { return xmlTextWriterWriteNs0UserElementNS(writer, _userDto, 1); } /** * Frees a UserDto. * * @param _userDto The UserDto to free. */ void free_novaglobalapi_ns0_userDto(struct novaglobalapi_ns0_userDto *_userDto) { freeNs0UserDtoType(_userDto); free(_userDto); } /** * Reads a UserDto element from XML. The element to be read is "user", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The UserDto, or NULL in case of error. */ struct novaglobalapi_ns0_userDto *xmlTextReaderReadNs0UserElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_userDto *_userDto = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "user", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}user.\n"); #endif _userDto = xmlTextReaderReadNs0UserDtoType(reader); } #if DEBUG_ENUNCIATE if (_userDto == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}user failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}user failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _userDto; } /** * Writes a UserDto to XML under element name "user". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _userDto The UserDto to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0UserElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_userDto *_userDto) { return xmlTextWriterWriteNs0UserElementNS(writer, _userDto, 0); } /** * Writes a UserDto to XML under element name "user". * * @param writer The XML writer. * @param _userDto The UserDto to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0UserElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_userDto *_userDto, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "user", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}user. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}userDto for root element {}user...\n"); #endif status = xmlTextWriterWriteNs0UserDtoType(writer, _userDto); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}user. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}user. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a UserDto. * * @param _userDto The UserDto whose children are to be free. */ static void freeNs0UserElement(struct novaglobalapi_ns0_userDto *_userDto) { freeNs0UserDtoType(_userDto); } /** * Reads a UserDto from XML. The reader is assumed to be at the start element. * * @return the UserDto, or NULL in case of error. */ static struct novaglobalapi_ns0_userDto *xmlTextReaderReadNs0UserDtoType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_userDto *_userDto = calloc(1, sizeof(struct novaglobalapi_ns0_userDto)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0UserDtoType(_userDto); free(_userDto); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}providerId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UserDtoType(_userDto); free(_userDto); return NULL; } _userDto->providerId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}currentUserId of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UserDtoType(_userDto); free(_userDto); return NULL; } _userDto->currentUserId = ((long long*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UserDtoType(_userDto); free(_userDto); return NULL; } _userDto->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "userId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}userId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}userId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UserDtoType(_userDto); free(_userDto); return NULL; } _userDto->userId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UserDtoType(_userDto); free(_userDto); return NULL; } _userDto->name = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0UserDtoType(_userDto); free(_userDto); return NULL; } _userDto->organizationId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}userDto. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}userDto. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _userDto; } /** * Writes a UserDto to XML. * * @param writer The XML writer. * @param _userDto The UserDto to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0UserDtoType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_userDto *_userDto) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_userDto->providerId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}providerId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_userDto->providerId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}providerId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_userDto->currentUserId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, (_userDto->currentUserId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}currentUserId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_userDto->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_userDto->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_userDto->userId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "userId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}userId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}userId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_userDto->userId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}userId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}userId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_userDto->name != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}name. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_userDto->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}name. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}name. status: %i\n", status); #endif return status; } totalBytes += status; } if (_userDto->organizationId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_userDto->organizationId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}organizationId. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a UserDto. * * @param _userDto The UserDto to free. */ static void freeNs0UserDtoType(struct novaglobalapi_ns0_userDto *_userDto) { int i; if (_userDto->providerId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor providerId of type novaglobalapi_ns0_userDto...\n"); #endif freeXsLongType(_userDto->providerId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor providerId of type novaglobalapi_ns0_userDto...\n"); #endif free(_userDto->providerId); } if (_userDto->currentUserId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor currentUserId of type novaglobalapi_ns0_userDto...\n"); #endif freeXsLongType(_userDto->currentUserId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor currentUserId of type novaglobalapi_ns0_userDto...\n"); #endif free(_userDto->currentUserId); } if (_userDto->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_userDto...\n"); #endif freeXsStringType(_userDto->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_userDto...\n"); #endif free(_userDto->requestId); } if (_userDto->userId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor userId of type novaglobalapi_ns0_userDto...\n"); #endif freeXsStringType(_userDto->userId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor userId of type novaglobalapi_ns0_userDto...\n"); #endif free(_userDto->userId); } if (_userDto->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type novaglobalapi_ns0_userDto...\n"); #endif freeXsStringType(_userDto->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type novaglobalapi_ns0_userDto...\n"); #endif free(_userDto->name); } if (_userDto->organizationId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor organizationId of type novaglobalapi_ns0_userDto...\n"); #endif freeXsStringType(_userDto->organizationId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor organizationId of type novaglobalapi_ns0_userDto...\n"); #endif free(_userDto->organizationId); } } #endif /* DEF_novaglobalapi_ns0_userDto_M */ #ifndef DEF_novaglobalapi_ns0_actionStatus_M #define DEF_novaglobalapi_ns0_actionStatus_M /** * Reads a ActionStatus element from XML. The element to be read is "actionStatus", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ActionStatus, or NULL in case of error. */ struct novaglobalapi_ns0_actionStatus *xml_read_novaglobalapi_ns0_actionStatus(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0ActionStatusElement(reader); } /** * Writes a ActionStatus to XML under element name "actionStatus". * * @param writer The XML writer. * @param _actionStatus The ActionStatus to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_actionStatus(xmlTextWriterPtr writer, struct novaglobalapi_ns0_actionStatus *_actionStatus) { return xmlTextWriterWriteNs0ActionStatusElementNS(writer, _actionStatus, 1); } /** * Frees a ActionStatus. * * @param _actionStatus The ActionStatus to free. */ void free_novaglobalapi_ns0_actionStatus(struct novaglobalapi_ns0_actionStatus *_actionStatus) { freeNs0ActionStatusType(_actionStatus); free(_actionStatus); } /** * Reads a ActionStatus element from XML. The element to be read is "actionStatus", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The ActionStatus, or NULL in case of error. */ struct novaglobalapi_ns0_actionStatus *xmlTextReaderReadNs0ActionStatusElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_actionStatus *_actionStatus = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "actionStatus", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}actionStatus.\n"); #endif _actionStatus = xmlTextReaderReadNs0ActionStatusType(reader); } #if DEBUG_ENUNCIATE if (_actionStatus == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}actionStatus failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}actionStatus failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _actionStatus; } /** * Writes a ActionStatus to XML under element name "actionStatus". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _actionStatus The ActionStatus to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0ActionStatusElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_actionStatus *_actionStatus) { return xmlTextWriterWriteNs0ActionStatusElementNS(writer, _actionStatus, 0); } /** * Writes a ActionStatus to XML under element name "actionStatus". * * @param writer The XML writer. * @param _actionStatus The ActionStatus to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0ActionStatusElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_actionStatus *_actionStatus, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "actionStatus", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}actionStatus. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}actionStatus for root element {}actionStatus...\n"); #endif status = xmlTextWriterWriteNs0ActionStatusType(writer, _actionStatus); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}actionStatus. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}actionStatus. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a ActionStatus. * * @param _actionStatus The ActionStatus whose children are to be free. */ static void freeNs0ActionStatusElement(struct novaglobalapi_ns0_actionStatus *_actionStatus) { freeNs0ActionStatusType(_actionStatus); } /** * Reads a ActionStatus from XML. The reader is assumed to be at the start element. * * @return the ActionStatus, or NULL in case of error. */ static struct novaglobalapi_ns0_actionStatus *xmlTextReaderReadNs0ActionStatusType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_actionStatus *_actionStatus = calloc(1, sizeof(struct novaglobalapi_ns0_actionStatus)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0ActionStatusType(_actionStatus); free(_actionStatus); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}status of type {}actionStatusEnum.\n"); #endif _child_accessor = xmlTextReaderReadNs0ActionStatusEnumType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}status of type {}actionStatusEnum.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ActionStatusType(_actionStatus); free(_actionStatus); return NULL; } _actionStatus->status = ((enum novaglobalapi_ns0_actionStatusEnum*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "errorCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}errorCode of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif _child_accessor = xmlTextReaderReadXsIntType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}errorCode of type {http://www.w3.org/2001/XMLSchema}int.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ActionStatusType(_actionStatus); free(_actionStatus); return NULL; } _actionStatus->errorCode = *((int*)_child_accessor); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "message", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}message of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}message of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0ActionStatusType(_actionStatus); free(_actionStatus); return NULL; } _actionStatus->message = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}actionStatus. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}actionStatus. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _actionStatus; } /** * Writes a ActionStatus to XML. * * @param writer The XML writer. * @param _actionStatus The ActionStatus to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0ActionStatusType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_actionStatus *_actionStatus) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_actionStatus->status != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}status. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}actionStatusEnum for element {}status...\n"); #endif status = xmlTextWriterWriteNs0ActionStatusEnumType(writer, (_actionStatus->status)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}actionStatusEnum for element {}status. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}status. status: %i\n", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive element. status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "errorCode", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}errorCode. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}errorCode...\n"); #endif status = xmlTextWriterWriteXsIntType(writer, &(_actionStatus->errorCode)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}errorCode. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}errorCode. status: %i\n", status); #endif return status; } totalBytes += status; } if (_actionStatus->message != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "message", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}message. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}message...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_actionStatus->message)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}message. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}message. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a ActionStatus. * * @param _actionStatus The ActionStatus to free. */ static void freeNs0ActionStatusType(struct novaglobalapi_ns0_actionStatus *_actionStatus) { int i; if (_actionStatus->status != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor status of type novaglobalapi_ns0_actionStatus...\n"); #endif freeNs0ActionStatusEnumType(_actionStatus->status); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor status of type novaglobalapi_ns0_actionStatus...\n"); #endif free(_actionStatus->status); } if (_actionStatus->message != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor message of type novaglobalapi_ns0_actionStatus...\n"); #endif freeXsStringType(_actionStatus->message); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor message of type novaglobalapi_ns0_actionStatus...\n"); #endif free(_actionStatus->message); } } #endif /* DEF_novaglobalapi_ns0_actionStatus_M */ #ifndef DEF_novaglobalapi_ns0_actionStatusEnum_M #define DEF_novaglobalapi_ns0_actionStatusEnum_M /** * Reads a ActionStatusEnum from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The ActionStatusEnum, or NULL if unable to be read. */ static enum novaglobalapi_ns0_actionStatusEnum *xmlTextReaderReadNs0ActionStatusEnumType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum novaglobalapi_ns0_actionStatusEnum *value = calloc(1, sizeof(enum novaglobalapi_ns0_actionStatusEnum)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "SUCCESS") == 0) { *value = NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_SUCCESS; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "FAIL") == 0) { *value = NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_FAIL; free(enumValue); return value; } #if DEBUG_ENUNCIATE printf("Attempt to read enum value failed: %s doesn't match an enum value.\n", enumValue); #endif } #if DEBUG_ENUNCIATE else { printf("Attempt to read enum value failed: NULL value.\n"); } #endif return NULL; } /** * Writes a ActionStatusEnum to XML. * * @param writer The XML writer. * @param _actionStatusEnum The ActionStatusEnum to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNs0ActionStatusEnumType(xmlTextWriterPtr writer, enum novaglobalapi_ns0_actionStatusEnum *_actionStatusEnum) { switch (*_actionStatusEnum) { case NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_SUCCESS: return xmlTextWriterWriteString(writer, BAD_CAST "SUCCESS"); case NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_FAIL: return xmlTextWriterWriteString(writer, BAD_CAST "FAIL"); } #if DEBUG_ENUNCIATE printf("Unable to write enum value (no valid value found).\n"); #endif return -1; } /** * Frees a ActionStatusEnum. * * @param _actionStatusEnum The ActionStatusEnum to free. */ static void freeNs0ActionStatusEnumType(enum novaglobalapi_ns0_actionStatusEnum *_actionStatusEnum) { //no-op } #endif /* DEF_novaglobalapi_ns0_actionStatusEnum_M */ #ifndef DEF_novaglobalapi_ns0_countryResponse_M #define DEF_novaglobalapi_ns0_countryResponse_M /** * Reads a CountryResponse element from XML. The element to be read is "countryResponse", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The CountryResponse, or NULL in case of error. */ struct novaglobalapi_ns0_countryResponse *xml_read_novaglobalapi_ns0_countryResponse(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0CountryResponseElement(reader); } /** * Writes a CountryResponse to XML under element name "countryResponse". * * @param writer The XML writer. * @param _countryResponse The CountryResponse to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_countryResponse(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryResponse *_countryResponse) { return xmlTextWriterWriteNs0CountryResponseElementNS(writer, _countryResponse, 1); } /** * Frees a CountryResponse. * * @param _countryResponse The CountryResponse to free. */ void free_novaglobalapi_ns0_countryResponse(struct novaglobalapi_ns0_countryResponse *_countryResponse) { freeNs0CountryResponseType(_countryResponse); free(_countryResponse); } /** * Reads a CountryResponse element from XML. The element to be read is "countryResponse", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The CountryResponse, or NULL in case of error. */ struct novaglobalapi_ns0_countryResponse *xmlTextReaderReadNs0CountryResponseElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_countryResponse *_countryResponse = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryResponse", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}countryResponse.\n"); #endif _countryResponse = xmlTextReaderReadNs0CountryResponseType(reader); } #if DEBUG_ENUNCIATE if (_countryResponse == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}countryResponse failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}countryResponse failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _countryResponse; } /** * Writes a CountryResponse to XML under element name "countryResponse". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _countryResponse The CountryResponse to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0CountryResponseElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryResponse *_countryResponse) { return xmlTextWriterWriteNs0CountryResponseElementNS(writer, _countryResponse, 0); } /** * Writes a CountryResponse to XML under element name "countryResponse". * * @param writer The XML writer. * @param _countryResponse The CountryResponse to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0CountryResponseElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryResponse *_countryResponse, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryResponse", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}countryResponse. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}countryResponse for root element {}countryResponse...\n"); #endif status = xmlTextWriterWriteNs0CountryResponseType(writer, _countryResponse); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}countryResponse. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}countryResponse. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a CountryResponse. * * @param _countryResponse The CountryResponse whose children are to be free. */ static void freeNs0CountryResponseElement(struct novaglobalapi_ns0_countryResponse *_countryResponse) { freeNs0CountryResponseType(_countryResponse); } /** * Reads a CountryResponse from XML. The reader is assumed to be at the start element. * * @return the CountryResponse, or NULL in case of error. */ static struct novaglobalapi_ns0_countryResponse *xmlTextReaderReadNs0CountryResponseType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_countryResponse *_countryResponse = calloc(1, sizeof(struct novaglobalapi_ns0_countryResponse)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0CountryResponseType(_countryResponse); free(_countryResponse); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "actionStatus", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}actionStatus of type {}actionStatus.\n"); #endif _child_accessor = xmlTextReaderReadNs0ActionStatusType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}actionStatus of type {}actionStatus.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryResponseType(_countryResponse); free(_countryResponse); return NULL; } _countryResponse->actionStatus = ((struct novaglobalapi_ns0_actionStatus*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryDto", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}countryDto of type {}countryDto.\n"); #endif _child_accessor = xmlTextReaderReadNs0CountryDtoType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}countryDto of type {}countryDto.\n"); #endif //panic: unable to read the child element for some reason. freeNs0CountryResponseType(_countryResponse); free(_countryResponse); return NULL; } _countryResponse->countryDto = ((struct novaglobalapi_ns0_countryDto*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}countryResponse. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}countryResponse. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _countryResponse; } /** * Writes a CountryResponse to XML. * * @param writer The XML writer. * @param _countryResponse The CountryResponse to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0CountryResponseType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_countryResponse *_countryResponse) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_countryResponse->actionStatus != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "actionStatus", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}actionStatus. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}actionStatus for element {}actionStatus...\n"); #endif status = xmlTextWriterWriteNs0ActionStatusType(writer, (_countryResponse->actionStatus)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}actionStatus for element {}actionStatus. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}actionStatus. status: %i\n", status); #endif return status; } totalBytes += status; } if (_countryResponse->countryDto != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryDto", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}countryDto. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}countryDto for element {}countryDto...\n"); #endif status = xmlTextWriterWriteNs0CountryDtoType(writer, (_countryResponse->countryDto)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {}countryDto for element {}countryDto. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}countryDto. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a CountryResponse. * * @param _countryResponse The CountryResponse to free. */ static void freeNs0CountryResponseType(struct novaglobalapi_ns0_countryResponse *_countryResponse) { int i; if (_countryResponse->actionStatus != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor actionStatus of type novaglobalapi_ns0_countryResponse...\n"); #endif freeNs0ActionStatusType(_countryResponse->actionStatus); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor actionStatus of type novaglobalapi_ns0_countryResponse...\n"); #endif free(_countryResponse->actionStatus); } if (_countryResponse->countryDto != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor countryDto of type novaglobalapi_ns0_countryResponse...\n"); #endif freeNs0CountryDtoType(_countryResponse->countryDto); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor countryDto of type novaglobalapi_ns0_countryResponse...\n"); #endif free(_countryResponse->countryDto); } } #endif /* DEF_novaglobalapi_ns0_countryResponse_M */ #ifndef DEF_novaglobalapi_ns0_subscriptionWithCreditLimitResponse_M #define DEF_novaglobalapi_ns0_subscriptionWithCreditLimitResponse_M /** * Reads a SubscriptionWithCreditLimitResponse element from XML. The element to be read is "subscriptionWithCreditLimitResponse", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitResponse, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *xml_read_novaglobalapi_ns0_subscriptionWithCreditLimitResponse(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadNs0SubscriptionWithCreditLimitResponseElement(reader); } /** * Writes a SubscriptionWithCreditLimitResponse to XML under element name "subscriptionWithCreditLimitResponse". * * @param writer The XML writer. * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to write. * @return 1 if successful, 0 otherwise. */ int xml_write_novaglobalapi_ns0_subscriptionWithCreditLimitResponse(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse) { return xmlTextWriterWriteNs0SubscriptionWithCreditLimitResponseElementNS(writer, _subscriptionWithCreditLimitResponse, 1); } /** * Frees a SubscriptionWithCreditLimitResponse. * * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to free. */ void free_novaglobalapi_ns0_subscriptionWithCreditLimitResponse(struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse) { freeNs0SubscriptionWithCreditLimitResponseType(_subscriptionWithCreditLimitResponse); free(_subscriptionWithCreditLimitResponse); } /** * Reads a SubscriptionWithCreditLimitResponse element from XML. The element to be read is "subscriptionWithCreditLimitResponse", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The SubscriptionWithCreditLimitResponse, or NULL in case of error. */ struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *xmlTextReaderReadNs0SubscriptionWithCreditLimitResponseElement(xmlTextReaderPtr reader) { struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionWithCreditLimitResponse", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {}subscriptionWithCreditLimitResponse.\n"); #endif _subscriptionWithCreditLimitResponse = xmlTextReaderReadNs0SubscriptionWithCreditLimitResponseType(reader); } #if DEBUG_ENUNCIATE if (_subscriptionWithCreditLimitResponse == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {}subscriptionWithCreditLimitResponse failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {}subscriptionWithCreditLimitResponse failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _subscriptionWithCreditLimitResponse; } /** * Writes a SubscriptionWithCreditLimitResponse to XML under element name "subscriptionWithCreditLimitResponse". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitResponseElement(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse) { return xmlTextWriterWriteNs0SubscriptionWithCreditLimitResponseElementNS(writer, _subscriptionWithCreditLimitResponse, 0); } /** * Writes a SubscriptionWithCreditLimitResponse to XML under element name "subscriptionWithCreditLimitResponse". * * @param writer The XML writer. * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitResponseElementNS(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionWithCreditLimitResponse", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {}subscriptionWithCreditLimitResponse. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {}subscriptionWithCreditLimitResponse for root element {}subscriptionWithCreditLimitResponse...\n"); #endif status = xmlTextWriterWriteNs0SubscriptionWithCreditLimitResponseType(writer, _subscriptionWithCreditLimitResponse); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {}subscriptionWithCreditLimitResponse. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {}subscriptionWithCreditLimitResponse. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a SubscriptionWithCreditLimitResponse. * * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse whose children are to be free. */ static void freeNs0SubscriptionWithCreditLimitResponseElement(struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse) { freeNs0SubscriptionWithCreditLimitResponseType(_subscriptionWithCreditLimitResponse); } /** * Reads a SubscriptionWithCreditLimitResponse from XML. The reader is assumed to be at the start element. * * @return the SubscriptionWithCreditLimitResponse, or NULL in case of error. */ static struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *xmlTextReaderReadNs0SubscriptionWithCreditLimitResponseType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse = calloc(1, sizeof(struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse)); if (xmlTextReaderIsEmptyElement(reader) == 0) { depth = xmlTextReaderDepth(reader);//track the depth. status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); while (xmlTextReaderDepth(reader) > depth) { if (status < 1) { //panic: XML read error. #if DEBUG_ENUNCIATE printf("Failure to advance to next child element.\n"); #endif freeNs0SubscriptionWithCreditLimitResponseType(_subscriptionWithCreditLimitResponse); free(_subscriptionWithCreditLimitResponse); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitResponseType(_subscriptionWithCreditLimitResponse); free(_subscriptionWithCreditLimitResponse); return NULL; } _subscriptionWithCreditLimitResponse->requestId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "accepted", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}accepted of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}accepted of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitResponseType(_subscriptionWithCreditLimitResponse); free(_subscriptionWithCreditLimitResponse); return NULL; } _subscriptionWithCreditLimitResponse->accepted = ((int*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}subscriptionId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}subscriptionId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitResponseType(_subscriptionWithCreditLimitResponse); free(_subscriptionWithCreditLimitResponse); return NULL; } _subscriptionWithCreditLimitResponse->subscriptionId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {}status of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {}status of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeNs0SubscriptionWithCreditLimitResponseType(_subscriptionWithCreditLimitResponse); free(_subscriptionWithCreditLimitResponse); return NULL; } _subscriptionWithCreditLimitResponse->status = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {}subscriptionWithCreditLimitResponse. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {}subscriptionWithCreditLimitResponse. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _subscriptionWithCreditLimitResponse; } /** * Writes a SubscriptionWithCreditLimitResponse to XML. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteNs0SubscriptionWithCreditLimitResponseType(xmlTextWriterPtr writer, struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_subscriptionWithCreditLimitResponse->requestId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}requestId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_subscriptionWithCreditLimitResponse->requestId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}requestId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionWithCreditLimitResponse->accepted != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "accepted", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}accepted. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for element {}accepted...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, (_subscriptionWithCreditLimitResponse->accepted)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for element {}accepted. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}accepted. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionWithCreditLimitResponse->subscriptionId != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}subscriptionId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}subscriptionId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_subscriptionWithCreditLimitResponse->subscriptionId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}subscriptionId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}subscriptionId. status: %i\n", status); #endif return status; } totalBytes += status; } if (_subscriptionWithCreditLimitResponse->status != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {}status. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}status...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_subscriptionWithCreditLimitResponse->status)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}status. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {}status. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a SubscriptionWithCreditLimitResponse. * * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to free. */ static void freeNs0SubscriptionWithCreditLimitResponseType(struct novaglobalapi_ns0_subscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse) { int i; if (_subscriptionWithCreditLimitResponse->requestId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor requestId of type novaglobalapi_ns0_subscriptionWithCreditLimitResponse...\n"); #endif freeXsStringType(_subscriptionWithCreditLimitResponse->requestId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor requestId of type novaglobalapi_ns0_subscriptionWithCreditLimitResponse...\n"); #endif free(_subscriptionWithCreditLimitResponse->requestId); } if (_subscriptionWithCreditLimitResponse->accepted != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor accepted of type novaglobalapi_ns0_subscriptionWithCreditLimitResponse...\n"); #endif freeXsBooleanType(_subscriptionWithCreditLimitResponse->accepted); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor accepted of type novaglobalapi_ns0_subscriptionWithCreditLimitResponse...\n"); #endif free(_subscriptionWithCreditLimitResponse->accepted); } if (_subscriptionWithCreditLimitResponse->subscriptionId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor subscriptionId of type novaglobalapi_ns0_subscriptionWithCreditLimitResponse...\n"); #endif freeXsStringType(_subscriptionWithCreditLimitResponse->subscriptionId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor subscriptionId of type novaglobalapi_ns0_subscriptionWithCreditLimitResponse...\n"); #endif free(_subscriptionWithCreditLimitResponse->subscriptionId); } if (_subscriptionWithCreditLimitResponse->status != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor status of type novaglobalapi_ns0_subscriptionWithCreditLimitResponse...\n"); #endif freeXsStringType(_subscriptionWithCreditLimitResponse->status); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor status of type novaglobalapi_ns0_subscriptionWithCreditLimitResponse...\n"); #endif free(_subscriptionWithCreditLimitResponse->status); } } #endif /* DEF_novaglobalapi_ns0_subscriptionWithCreditLimitResponse_M */