#include #ifndef DEF_rsb_rest_data_catalogType_H #define DEF_rsb_rest_data_catalogType_H /** *

Java class for catalogType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="catalogType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="directory" type="{http://rest.rsb.openanalytics.eu/types}catalogDirectory" maxOccurs="4" minOccurs="4"/>
       </sequence>
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_catalogType { /** * (no documentation provided) */ struct rsb_rest_data_catalogDirectory *directories; /** * Size of the directories array. */ int _sizeof_directories; }; /** * Reads a Catalog element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}catalog", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The Catalog, or NULL in case of error. */ struct rsb_rest_data_catalogType *xml_read_rsb_rest_data_catalogType(xmlTextReaderPtr reader); /** * Writes a Catalog to XML under element name "{http://rest.rsb.openanalytics.eu/types}catalog". * * @param writer The XML writer. * @param _catalog The Catalog to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_rest_data_catalogType(xmlTextWriterPtr writer, struct rsb_rest_data_catalogType *_catalog); /** * Frees a Catalog. * * @param _catalog The Catalog to free. */ void free_rsb_rest_data_catalogType(struct rsb_rest_data_catalogType *_catalog); /** * Reads a Catalog element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}catalog", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The Catalog, or NULL in case of error. */ struct rsb_rest_data_catalogType *xmlTextReaderReadRest_dataCatalogElement(xmlTextReaderPtr reader); /** * Writes a Catalog to XML under element name "{http://rest.rsb.openanalytics.eu/types}catalog". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _catalog The Catalog to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataCatalogElement(xmlTextWriterPtr writer, struct rsb_rest_data_catalogType *_catalog); /** * Writes a Catalog to XML under element name "{http://rest.rsb.openanalytics.eu/types}catalog". * * @param writer The XML writer. * @param _catalog The Catalog 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 xmlTextWriterWriteRest_dataCatalogElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_catalogType *_catalog, int writeNamespaces); /** * Frees the children of a Catalog. * * @param _catalog The Catalog whose children are to be free. */ static void freeRest_dataCatalogElement(struct rsb_rest_data_catalogType *_catalog); /** * Reads a Catalog from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The Catalog, or NULL in case of error. */ static struct rsb_rest_data_catalogType *xmlTextReaderReadRest_dataCatalogTypeType(xmlTextReaderPtr reader); /** * Writes a Catalog to XML. * * @param writer The XML writer. * @param _catalog The Catalog to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataCatalogTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_catalogType *_catalog); /** * Frees the elements of a Catalog. * * @param _catalog The Catalog to free. */ static void freeRest_dataCatalogTypeType(struct rsb_rest_data_catalogType *_catalog); #endif /* DEF_rsb_rest_data_catalogType_H */ #ifndef DEF_rsb_rest_data_catalogDirectory_H #define DEF_rsb_rest_data_catalogDirectory_H /** *

Java class for catalogDirectory complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="catalogDirectory">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="file" type="{http://rest.rsb.openanalytics.eu/types}catalogFileType" maxOccurs="unbounded" minOccurs="0"/>
       </sequence>
       <attribute name="type" use="required">
         <simpleType>
           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
             <enumeration value="EMAIL_REPLIES"/>
             <enumeration value="JOB_CONFIGURATIONS"/>
             <enumeration value="R_SCRIPTS"/>
             <enumeration value="SWEAVE_FILES"/>
           </restriction>
         </simpleType>
       </attribute>
       <attribute name="path" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_catalogDirectory { /** * (no documentation provided) */ xmlChar *type; /** * (no documentation provided) */ xmlChar *path; /** * (no documentation provided) */ struct rsb_rest_data_catalogFileType *files; /** * Size of the files array. */ int _sizeof_files; }; /** * Reads a CatalogDirectory from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The CatalogDirectory, or NULL in case of error. */ static struct rsb_rest_data_catalogDirectory *xmlTextReaderReadRest_dataCatalogDirectoryType(xmlTextReaderPtr reader); /** * Writes a CatalogDirectory to XML. * * @param writer The XML writer. * @param _catalogDirectory The CatalogDirectory to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataCatalogDirectoryType(xmlTextWriterPtr writer, struct rsb_rest_data_catalogDirectory *_catalogDirectory); /** * Frees the elements of a CatalogDirectory. * * @param _catalogDirectory The CatalogDirectory to free. */ static void freeRest_dataCatalogDirectoryType(struct rsb_rest_data_catalogDirectory *_catalogDirectory); #endif /* DEF_rsb_rest_data_catalogDirectory_H */ #ifndef DEF_rsb_rest_data_catalogFileType_H #define DEF_rsb_rest_data_catalogFileType_H /** *

Java class for catalogFileType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="catalogFileType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="dataUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_catalogFileType { /** * (no documentation provided) */ xmlChar *name; /** * (no documentation provided) */ xmlChar *dataUri; }; /** * Reads a CatalogFileType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The CatalogFileType, or NULL in case of error. */ static struct rsb_rest_data_catalogFileType *xmlTextReaderReadRest_dataCatalogFileTypeType(xmlTextReaderPtr reader); /** * Writes a CatalogFileType to XML. * * @param writer The XML writer. * @param _catalogFileType The CatalogFileType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataCatalogFileTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_catalogFileType *_catalogFileType); /** * Frees the elements of a CatalogFileType. * * @param _catalogFileType The CatalogFileType to free. */ static void freeRest_dataCatalogFileTypeType(struct rsb_rest_data_catalogFileType *_catalogFileType); #endif /* DEF_rsb_rest_data_catalogFileType_H */ #ifndef DEF_rsb_rest_data_directoryType_H #define DEF_rsb_rest_data_directoryType_H /** *

Java class for directoryType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="directoryType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="directory" type="{http://rest.rsb.openanalytics.eu/types}directoryType" maxOccurs="unbounded" minOccurs="0"/>
         <element name="file" type="{http://rest.rsb.openanalytics.eu/types}fileType" maxOccurs="unbounded" minOccurs="0"/>
       </sequence>
       <attribute name="path" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="uri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
       <attribute name="empty" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_directoryType { /** * (no documentation provided) */ xmlChar *path; /** * (no documentation provided) */ xmlChar *name; /** * (no documentation provided) */ xmlChar *uri; /** * (no documentation provided) */ int empty; /** * (no documentation provided) */ struct rsb_rest_data_directoryType *directories; /** * Size of the directories array. */ int _sizeof_directories; /** * (no documentation provided) */ struct rsb_rest_data_fileType *files; /** * Size of the files array. */ int _sizeof_files; }; /** * Reads a Directory element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}directory", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The Directory, or NULL in case of error. */ struct rsb_rest_data_directoryType *xml_read_rsb_rest_data_directoryType(xmlTextReaderPtr reader); /** * Writes a Directory to XML under element name "{http://rest.rsb.openanalytics.eu/types}directory". * * @param writer The XML writer. * @param _directory The Directory to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_rest_data_directoryType(xmlTextWriterPtr writer, struct rsb_rest_data_directoryType *_directory); /** * Frees a Directory. * * @param _directory The Directory to free. */ void free_rsb_rest_data_directoryType(struct rsb_rest_data_directoryType *_directory); /** * Reads a Directory element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}directory", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The Directory, or NULL in case of error. */ struct rsb_rest_data_directoryType *xmlTextReaderReadRest_dataDirectoryElement(xmlTextReaderPtr reader); /** * Writes a Directory to XML under element name "{http://rest.rsb.openanalytics.eu/types}directory". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _directory The Directory to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataDirectoryElement(xmlTextWriterPtr writer, struct rsb_rest_data_directoryType *_directory); /** * Writes a Directory to XML under element name "{http://rest.rsb.openanalytics.eu/types}directory". * * @param writer The XML writer. * @param _directory The Directory 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 xmlTextWriterWriteRest_dataDirectoryElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_directoryType *_directory, int writeNamespaces); /** * Frees the children of a Directory. * * @param _directory The Directory whose children are to be free. */ static void freeRest_dataDirectoryElement(struct rsb_rest_data_directoryType *_directory); /** * Reads a Directory from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The Directory, or NULL in case of error. */ static struct rsb_rest_data_directoryType *xmlTextReaderReadRest_dataDirectoryTypeType(xmlTextReaderPtr reader); /** * Writes a Directory to XML. * * @param writer The XML writer. * @param _directory The Directory to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataDirectoryTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_directoryType *_directory); /** * Frees the elements of a Directory. * * @param _directory The Directory to free. */ static void freeRest_dataDirectoryTypeType(struct rsb_rest_data_directoryType *_directory); #endif /* DEF_rsb_rest_data_directoryType_H */ #ifndef DEF_rsb_rest_data_errorResultType_H #define DEF_rsb_rest_data_errorResultType_H /** *

Java class for errorResultType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="errorResultType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string"/>
       </sequence>
       <attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="applicationName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="submissionTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_errorResultType { /** * (no documentation provided) */ xmlChar *jobId; /** * (no documentation provided) */ xmlChar *applicationName; /** * (no documentation provided) */ struct tm *submissionTime; /** * (no documentation provided) */ xmlChar *errorMessage; }; /** * Reads a ErrorResult element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}errorResult", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ErrorResult, or NULL in case of error. */ struct rsb_rest_data_errorResultType *xml_read_rsb_rest_data_errorResultType(xmlTextReaderPtr reader); /** * Writes a ErrorResult to XML under element name "{http://rest.rsb.openanalytics.eu/types}errorResult". * * @param writer The XML writer. * @param _errorResult The ErrorResult to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_rest_data_errorResultType(xmlTextWriterPtr writer, struct rsb_rest_data_errorResultType *_errorResult); /** * Frees a ErrorResult. * * @param _errorResult The ErrorResult to free. */ void free_rsb_rest_data_errorResultType(struct rsb_rest_data_errorResultType *_errorResult); /** * Reads a ErrorResult element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}errorResult", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The ErrorResult, or NULL in case of error. */ struct rsb_rest_data_errorResultType *xmlTextReaderReadRest_dataErrorResultElement(xmlTextReaderPtr reader); /** * Writes a ErrorResult to XML under element name "{http://rest.rsb.openanalytics.eu/types}errorResult". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _errorResult The ErrorResult to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataErrorResultElement(xmlTextWriterPtr writer, struct rsb_rest_data_errorResultType *_errorResult); /** * Writes a ErrorResult to XML under element name "{http://rest.rsb.openanalytics.eu/types}errorResult". * * @param writer The XML writer. * @param _errorResult The ErrorResult 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 xmlTextWriterWriteRest_dataErrorResultElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_errorResultType *_errorResult, int writeNamespaces); /** * Frees the children of a ErrorResult. * * @param _errorResult The ErrorResult whose children are to be free. */ static void freeRest_dataErrorResultElement(struct rsb_rest_data_errorResultType *_errorResult); /** * Reads a ErrorResult from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The ErrorResult, or NULL in case of error. */ static struct rsb_rest_data_errorResultType *xmlTextReaderReadRest_dataErrorResultTypeType(xmlTextReaderPtr reader); /** * Writes a ErrorResult to XML. * * @param writer The XML writer. * @param _errorResult The ErrorResult to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataErrorResultTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_errorResultType *_errorResult); /** * Frees the elements of a ErrorResult. * * @param _errorResult The ErrorResult to free. */ static void freeRest_dataErrorResultTypeType(struct rsb_rest_data_errorResultType *_errorResult); #endif /* DEF_rsb_rest_data_errorResultType_H */ #ifndef DEF_rsb_rest_data_fileType_H #define DEF_rsb_rest_data_fileType_H /** *

Java class for fileType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="fileType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <attribute name="path" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_fileType { /** * (no documentation provided) */ xmlChar *path; /** * (no documentation provided) */ xmlChar *name; }; /** * Reads a FileType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The FileType, or NULL in case of error. */ static struct rsb_rest_data_fileType *xmlTextReaderReadRest_dataFileTypeType(xmlTextReaderPtr reader); /** * Writes a FileType to XML. * * @param writer The XML writer. * @param _fileType The FileType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataFileTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_fileType *_fileType); /** * Frees the elements of a FileType. * * @param _fileType The FileType to free. */ static void freeRest_dataFileTypeType(struct rsb_rest_data_fileType *_fileType); #endif /* DEF_rsb_rest_data_fileType_H */ #ifndef DEF_rsb_rest_data_jobTokenType_H #define DEF_rsb_rest_data_jobTokenType_H /** *

Java class for jobTokenType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="jobTokenType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="applicationName" use="required" type="{http://rsb.openanalytics.eu/types}applicationNameType" />
       <attribute name="submissionTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
       <attribute name="applicationResultsUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
       <attribute name="resultUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_jobTokenType { /** * (no documentation provided) */ xmlChar *jobId; /** * (no documentation provided) */ xmlChar *applicationName; /** * (no documentation provided) */ struct tm *submissionTime; /** * (no documentation provided) */ xmlChar *applicationResultsUri; /** * (no documentation provided) */ xmlChar *resultUri; }; /** * Reads a JobToken element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}jobToken", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The JobToken, or NULL in case of error. */ struct rsb_rest_data_jobTokenType *xml_read_rsb_rest_data_jobTokenType(xmlTextReaderPtr reader); /** * Writes a JobToken to XML under element name "{http://rest.rsb.openanalytics.eu/types}jobToken". * * @param writer The XML writer. * @param _jobToken The JobToken to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_rest_data_jobTokenType(xmlTextWriterPtr writer, struct rsb_rest_data_jobTokenType *_jobToken); /** * Frees a JobToken. * * @param _jobToken The JobToken to free. */ void free_rsb_rest_data_jobTokenType(struct rsb_rest_data_jobTokenType *_jobToken); /** * Reads a JobToken element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}jobToken", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The JobToken, or NULL in case of error. */ struct rsb_rest_data_jobTokenType *xmlTextReaderReadRest_dataJobTokenElement(xmlTextReaderPtr reader); /** * Writes a JobToken to XML under element name "{http://rest.rsb.openanalytics.eu/types}jobToken". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _jobToken The JobToken to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataJobTokenElement(xmlTextWriterPtr writer, struct rsb_rest_data_jobTokenType *_jobToken); /** * Writes a JobToken to XML under element name "{http://rest.rsb.openanalytics.eu/types}jobToken". * * @param writer The XML writer. * @param _jobToken The JobToken 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 xmlTextWriterWriteRest_dataJobTokenElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_jobTokenType *_jobToken, int writeNamespaces); /** * Frees the children of a JobToken. * * @param _jobToken The JobToken whose children are to be free. */ static void freeRest_dataJobTokenElement(struct rsb_rest_data_jobTokenType *_jobToken); /** * Reads a JobToken from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The JobToken, or NULL in case of error. */ static struct rsb_rest_data_jobTokenType *xmlTextReaderReadRest_dataJobTokenTypeType(xmlTextReaderPtr reader); /** * Writes a JobToken to XML. * * @param writer The XML writer. * @param _jobToken The JobToken to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataJobTokenTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_jobTokenType *_jobToken); /** * Frees the elements of a JobToken. * * @param _jobToken The JobToken to free. */ static void freeRest_dataJobTokenTypeType(struct rsb_rest_data_jobTokenType *_jobToken); #endif /* DEF_rsb_rest_data_jobTokenType_H */ #ifndef DEF_rsb_rest_data_nodeInformationType_H #define DEF_rsb_rest_data_nodeInformationType_H /** *

Java class for nodeInformationType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="nodeInformationType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="healthy" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
       <attribute name="uptime" use="required" type="{http://www.w3.org/2001/XMLSchema}long" />
       <attribute name="uptimeText" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="servletContainerInfo" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="rsbVersion" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="jvmMaxMemory" use="required" type="{http://www.w3.org/2001/XMLSchema}long" />
       <attribute name="jvmFreeMemory" use="required" type="{http://www.w3.org/2001/XMLSchema}long" />
       <attribute name="osLoadAverage" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_nodeInformationType { /** * (no documentation provided) */ xmlChar *name; /** * (no documentation provided) */ int healthy; /** * (no documentation provided) */ long long uptime; /** * (no documentation provided) */ xmlChar *uptimeText; /** * (no documentation provided) */ xmlChar *servletContainerInfo; /** * (no documentation provided) */ xmlChar *rsbVersion; /** * (no documentation provided) */ long long jvmMaxMemory; /** * (no documentation provided) */ long long jvmFreeMemory; /** * (no documentation provided) */ double osLoadAverage; }; /** * Reads a NodeInformation element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}nodeInformation", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The NodeInformation, or NULL in case of error. */ struct rsb_rest_data_nodeInformationType *xml_read_rsb_rest_data_nodeInformationType(xmlTextReaderPtr reader); /** * Writes a NodeInformation to XML under element name "{http://rest.rsb.openanalytics.eu/types}nodeInformation". * * @param writer The XML writer. * @param _nodeInformation The NodeInformation to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_rest_data_nodeInformationType(xmlTextWriterPtr writer, struct rsb_rest_data_nodeInformationType *_nodeInformation); /** * Frees a NodeInformation. * * @param _nodeInformation The NodeInformation to free. */ void free_rsb_rest_data_nodeInformationType(struct rsb_rest_data_nodeInformationType *_nodeInformation); /** * Reads a NodeInformation element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}nodeInformation", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The NodeInformation, or NULL in case of error. */ struct rsb_rest_data_nodeInformationType *xmlTextReaderReadRest_dataNodeInformationElement(xmlTextReaderPtr reader); /** * Writes a NodeInformation to XML under element name "{http://rest.rsb.openanalytics.eu/types}nodeInformation". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _nodeInformation The NodeInformation to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataNodeInformationElement(xmlTextWriterPtr writer, struct rsb_rest_data_nodeInformationType *_nodeInformation); /** * Writes a NodeInformation to XML under element name "{http://rest.rsb.openanalytics.eu/types}nodeInformation". * * @param writer The XML writer. * @param _nodeInformation The NodeInformation 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 xmlTextWriterWriteRest_dataNodeInformationElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_nodeInformationType *_nodeInformation, int writeNamespaces); /** * Frees the children of a NodeInformation. * * @param _nodeInformation The NodeInformation whose children are to be free. */ static void freeRest_dataNodeInformationElement(struct rsb_rest_data_nodeInformationType *_nodeInformation); /** * Reads a NodeInformation from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The NodeInformation, or NULL in case of error. */ static struct rsb_rest_data_nodeInformationType *xmlTextReaderReadRest_dataNodeInformationTypeType(xmlTextReaderPtr reader); /** * Writes a NodeInformation to XML. * * @param writer The XML writer. * @param _nodeInformation The NodeInformation to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataNodeInformationTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_nodeInformationType *_nodeInformation); /** * Frees the elements of a NodeInformation. * * @param _nodeInformation The NodeInformation to free. */ static void freeRest_dataNodeInformationTypeType(struct rsb_rest_data_nodeInformationType *_nodeInformation); #endif /* DEF_rsb_rest_data_nodeInformationType_H */ #ifndef DEF_rsb_rest_data_rServiPoolType_H #define DEF_rsb_rest_data_rServiPoolType_H /** *

Java class for rServiPoolType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="rServiPoolType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <attribute name="poolUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
       <attribute name="applicationNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="default" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_rServiPoolType { /** * (no documentation provided) */ xmlChar *poolUri; /** * (no documentation provided) */ xmlChar *applicationNames; /** * (no documentation provided) */ int _default; }; /** * Reads a RServiPoolType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The RServiPoolType, or NULL in case of error. */ static struct rsb_rest_data_rServiPoolType *xmlTextReaderReadRest_dataRServiPoolTypeType(xmlTextReaderPtr reader); /** * Writes a RServiPoolType to XML. * * @param writer The XML writer. * @param _rServiPoolType The RServiPoolType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataRServiPoolTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolType *_rServiPoolType); /** * Frees the elements of a RServiPoolType. * * @param _rServiPoolType The RServiPoolType to free. */ static void freeRest_dataRServiPoolTypeType(struct rsb_rest_data_rServiPoolType *_rServiPoolType); #endif /* DEF_rsb_rest_data_rServiPoolType_H */ #ifndef DEF_rsb_rest_data_rServiPoolsType_H #define DEF_rsb_rest_data_rServiPoolsType_H /** *

Java class for rServiPoolsType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="rServiPoolsType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="rServiPool" type="{http://rest.rsb.openanalytics.eu/types}rServiPoolType" maxOccurs="unbounded"/>
       </sequence>
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_rServiPoolsType { /** * (no documentation provided) */ struct rsb_rest_data_rServiPoolType *contents; /** * Size of the contents array. */ int _sizeof_contents; }; /** * Reads a RServiPools element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}rServiPools", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The RServiPools, or NULL in case of error. */ struct rsb_rest_data_rServiPoolsType *xml_read_rsb_rest_data_rServiPoolsType(xmlTextReaderPtr reader); /** * Writes a RServiPools to XML under element name "{http://rest.rsb.openanalytics.eu/types}rServiPools". * * @param writer The XML writer. * @param _rServiPools The RServiPools to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_rest_data_rServiPoolsType(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolsType *_rServiPools); /** * Frees a RServiPools. * * @param _rServiPools The RServiPools to free. */ void free_rsb_rest_data_rServiPoolsType(struct rsb_rest_data_rServiPoolsType *_rServiPools); /** * Reads a RServiPools element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}rServiPools", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The RServiPools, or NULL in case of error. */ struct rsb_rest_data_rServiPoolsType *xmlTextReaderReadRest_dataRServiPoolsElement(xmlTextReaderPtr reader); /** * Writes a RServiPools to XML under element name "{http://rest.rsb.openanalytics.eu/types}rServiPools". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _rServiPools The RServiPools to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataRServiPoolsElement(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolsType *_rServiPools); /** * Writes a RServiPools to XML under element name "{http://rest.rsb.openanalytics.eu/types}rServiPools". * * @param writer The XML writer. * @param _rServiPools The RServiPools 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 xmlTextWriterWriteRest_dataRServiPoolsElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolsType *_rServiPools, int writeNamespaces); /** * Frees the children of a RServiPools. * * @param _rServiPools The RServiPools whose children are to be free. */ static void freeRest_dataRServiPoolsElement(struct rsb_rest_data_rServiPoolsType *_rServiPools); /** * Reads a RServiPools from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The RServiPools, or NULL in case of error. */ static struct rsb_rest_data_rServiPoolsType *xmlTextReaderReadRest_dataRServiPoolsTypeType(xmlTextReaderPtr reader); /** * Writes a RServiPools to XML. * * @param writer The XML writer. * @param _rServiPools The RServiPools to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataRServiPoolsTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolsType *_rServiPools); /** * Frees the elements of a RServiPools. * * @param _rServiPools The RServiPools to free. */ static void freeRest_dataRServiPoolsTypeType(struct rsb_rest_data_rServiPoolsType *_rServiPools); #endif /* DEF_rsb_rest_data_rServiPoolsType_H */ #ifndef DEF_rsb_rest_data_resultType_H #define DEF_rsb_rest_data_resultType_H /** *

Java class for resultType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="resultType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="applicationName" use="required" type="{http://rsb.openanalytics.eu/types}applicationNameType" />
       <attribute name="resultTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
       <attribute name="success" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="selfUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
       <attribute name="dataUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_resultType { /** * (no documentation provided) */ xmlChar *jobId; /** * (no documentation provided) */ xmlChar *applicationName; /** * (no documentation provided) */ struct tm *resultTime; /** * (no documentation provided) */ int success; /** * (no documentation provided) */ xmlChar *type; /** * (no documentation provided) */ xmlChar *selfUri; /** * (no documentation provided) */ xmlChar *dataUri; }; /** * Reads a Result element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}result", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The Result, or NULL in case of error. */ struct rsb_rest_data_resultType *xml_read_rsb_rest_data_resultType(xmlTextReaderPtr reader); /** * Writes a Result to XML under element name "{http://rest.rsb.openanalytics.eu/types}result". * * @param writer The XML writer. * @param _result The Result to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_rest_data_resultType(xmlTextWriterPtr writer, struct rsb_rest_data_resultType *_result); /** * Frees a Result. * * @param _result The Result to free. */ void free_rsb_rest_data_resultType(struct rsb_rest_data_resultType *_result); /** * Reads a Result element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}result", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The Result, or NULL in case of error. */ struct rsb_rest_data_resultType *xmlTextReaderReadRest_dataResultElement(xmlTextReaderPtr reader); /** * Writes a Result to XML under element name "{http://rest.rsb.openanalytics.eu/types}result". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _result The Result to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataResultElement(xmlTextWriterPtr writer, struct rsb_rest_data_resultType *_result); /** * Writes a Result to XML under element name "{http://rest.rsb.openanalytics.eu/types}result". * * @param writer The XML writer. * @param _result The Result 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 xmlTextWriterWriteRest_dataResultElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_resultType *_result, int writeNamespaces); /** * Frees the children of a Result. * * @param _result The Result whose children are to be free. */ static void freeRest_dataResultElement(struct rsb_rest_data_resultType *_result); /** * Reads a Result from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The Result, or NULL in case of error. */ static struct rsb_rest_data_resultType *xmlTextReaderReadRest_dataResultTypeType(xmlTextReaderPtr reader); /** * Writes a Result to XML. * * @param writer The XML writer. * @param _result The Result to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataResultTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_resultType *_result); /** * Frees the elements of a Result. * * @param _result The Result to free. */ static void freeRest_dataResultTypeType(struct rsb_rest_data_resultType *_result); #endif /* DEF_rsb_rest_data_resultType_H */ #ifndef DEF_rsb_rest_data_resultsType_H #define DEF_rsb_rest_data_resultsType_H /** *

Java class for resultsType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="resultsType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="result" type="{http://rest.rsb.openanalytics.eu/types}resultType" maxOccurs="unbounded" minOccurs="0"/>
       </sequence>
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_rest_data_resultsType { /** * (no documentation provided) */ struct rsb_rest_data_resultType *contents; /** * Size of the contents array. */ int _sizeof_contents; }; /** * Reads a Results element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}results", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The Results, or NULL in case of error. */ struct rsb_rest_data_resultsType *xml_read_rsb_rest_data_resultsType(xmlTextReaderPtr reader); /** * Writes a Results to XML under element name "{http://rest.rsb.openanalytics.eu/types}results". * * @param writer The XML writer. * @param _results The Results to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_rest_data_resultsType(xmlTextWriterPtr writer, struct rsb_rest_data_resultsType *_results); /** * Frees a Results. * * @param _results The Results to free. */ void free_rsb_rest_data_resultsType(struct rsb_rest_data_resultsType *_results); /** * Reads a Results element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}results", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The Results, or NULL in case of error. */ struct rsb_rest_data_resultsType *xmlTextReaderReadRest_dataResultsElement(xmlTextReaderPtr reader); /** * Writes a Results to XML under element name "{http://rest.rsb.openanalytics.eu/types}results". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _results The Results to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataResultsElement(xmlTextWriterPtr writer, struct rsb_rest_data_resultsType *_results); /** * Writes a Results to XML under element name "{http://rest.rsb.openanalytics.eu/types}results". * * @param writer The XML writer. * @param _results The Results 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 xmlTextWriterWriteRest_dataResultsElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_resultsType *_results, int writeNamespaces); /** * Frees the children of a Results. * * @param _results The Results whose children are to be free. */ static void freeRest_dataResultsElement(struct rsb_rest_data_resultsType *_results); /** * Reads a Results from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The Results, or NULL in case of error. */ static struct rsb_rest_data_resultsType *xmlTextReaderReadRest_dataResultsTypeType(xmlTextReaderPtr reader); /** * Writes a Results to XML. * * @param writer The XML writer. * @param _results The Results to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteRest_dataResultsTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_resultsType *_results); /** * Frees the elements of a Results. * * @param _results The Results to free. */ static void freeRest_dataResultsTypeType(struct rsb_rest_data_resultsType *_results); #endif /* DEF_rsb_rest_data_resultsType_H */ #ifndef DEF_rsb_soap_data_jobType_H #define DEF_rsb_soap_data_jobType_H /** *

Java class for jobType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="jobType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="applicationName" type="{http://rsb.openanalytics.eu/types}applicationNameType"/>
         <element name="parameter" maxOccurs="unbounded" minOccurs="0">
           <complexType>
             <complexContent>
               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
                 <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
               </restriction>
             </complexContent>
           </complexType>
         </element>
         <element name="payload" type="{http://soap.rsb.openanalytics.eu/types}payloadType" maxOccurs="unbounded"/>
       </sequence>
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_soap_data_jobType { /** * (no documentation provided) */ xmlChar *applicationName; /** * (no documentation provided) */ struct rsb_soap_data_anonymous_parameter *parameter; /** * Size of the parameter array. */ int _sizeof_parameter; /** * (no documentation provided) */ struct rsb_soap_data_payloadType *payload; /** * Size of the payload array. */ int _sizeof_payload; }; /** * Reads a JobType element from XML. The element to be read is "{http://soap.rsb.openanalytics.eu/types}job", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The JobType, or NULL in case of error. */ struct rsb_soap_data_jobType *xml_read_rsb_soap_data_jobType(xmlTextReaderPtr reader); /** * Writes a JobType to XML under element name "{http://soap.rsb.openanalytics.eu/types}job". * * @param writer The XML writer. * @param _jobType The JobType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_soap_data_jobType(xmlTextWriterPtr writer, struct rsb_soap_data_jobType *_jobType); /** * Frees a JobType. * * @param _jobType The JobType to free. */ void free_rsb_soap_data_jobType(struct rsb_soap_data_jobType *_jobType); /** * Reads a JobType element from XML. The element to be read is "{http://soap.rsb.openanalytics.eu/types}job", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The JobType, or NULL in case of error. */ struct rsb_soap_data_jobType *xmlTextReaderReadSoap_dataJobElement(xmlTextReaderPtr reader); /** * Writes a JobType to XML under element name "{http://soap.rsb.openanalytics.eu/types}job". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _jobType The JobType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteSoap_dataJobElement(xmlTextWriterPtr writer, struct rsb_soap_data_jobType *_jobType); /** * Writes a JobType to XML under element name "{http://soap.rsb.openanalytics.eu/types}job". * * @param writer The XML writer. * @param _jobType The JobType 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 xmlTextWriterWriteSoap_dataJobElementNS(xmlTextWriterPtr writer, struct rsb_soap_data_jobType *_jobType, int writeNamespaces); /** * Frees the children of a JobType. * * @param _jobType The JobType whose children are to be free. */ static void freeSoap_dataJobElement(struct rsb_soap_data_jobType *_jobType); /** * Reads a JobType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The JobType, or NULL in case of error. */ static struct rsb_soap_data_jobType *xmlTextReaderReadSoap_dataJobTypeType(xmlTextReaderPtr reader); /** * Writes a JobType to XML. * * @param writer The XML writer. * @param _jobType The JobType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteSoap_dataJobTypeType(xmlTextWriterPtr writer, struct rsb_soap_data_jobType *_jobType); /** * Frees the elements of a JobType. * * @param _jobType The JobType to free. */ static void freeSoap_dataJobTypeType(struct rsb_soap_data_jobType *_jobType); #endif /* DEF_rsb_soap_data_jobType_H */ #ifndef DEF_rsb_soap_data_anonymous_parameter_H #define DEF_rsb_soap_data_anonymous_parameter_H /** *

Java class for anonymous complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType>
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_soap_data_anonymous_parameter { /** * (no documentation provided) */ xmlChar *name; /** * (no documentation provided) */ xmlChar *value; }; /** * Reads a Parameter from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The Parameter, or NULL in case of error. */ static struct rsb_soap_data_anonymous_parameter *xmlTextReaderReadSoap_dataAnonymousParameterType(xmlTextReaderPtr reader); /** * Writes a Parameter to XML. * * @param writer The XML writer. * @param _parameter The Parameter to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteSoap_dataAnonymousParameterType(xmlTextWriterPtr writer, struct rsb_soap_data_anonymous_parameter *_parameter); /** * Frees the elements of a Parameter. * * @param _parameter The Parameter to free. */ static void freeSoap_dataAnonymousParameterType(struct rsb_soap_data_anonymous_parameter *_parameter); #endif /* DEF_rsb_soap_data_anonymous_parameter_H */ #ifndef DEF_rsb_soap_data_payloadType_H #define DEF_rsb_soap_data_payloadType_H /** *

Java class for payloadType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="payloadType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="data" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
       </sequence>
       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="contentType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_soap_data_payloadType { /** * (no documentation provided) */ xmlChar *name; /** * (no documentation provided) */ xmlChar *contentType; /** * (no documentation provided) */ unsigned char *data; /** * Size of the data data. */ int _sizeof_data; }; /** * Reads a PayloadType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The PayloadType, or NULL in case of error. */ static struct rsb_soap_data_payloadType *xmlTextReaderReadSoap_dataPayloadTypeType(xmlTextReaderPtr reader); /** * Writes a PayloadType to XML. * * @param writer The XML writer. * @param _payloadType The PayloadType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteSoap_dataPayloadTypeType(xmlTextWriterPtr writer, struct rsb_soap_data_payloadType *_payloadType); /** * Frees the elements of a PayloadType. * * @param _payloadType The PayloadType to free. */ static void freeSoap_dataPayloadTypeType(struct rsb_soap_data_payloadType *_payloadType); #endif /* DEF_rsb_soap_data_payloadType_H */ #ifndef DEF_rsb_soap_data_resultType_H #define DEF_rsb_soap_data_resultType_H /** *

Java class for resultType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="resultType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="applicationName" type="{http://rsb.openanalytics.eu/types}applicationNameType"/>
         <element name="jobId" type="{http://www.w3.org/2001/XMLSchema}string"/>
         <element name="success" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
         <element name="payload" type="{http://soap.rsb.openanalytics.eu/types}payloadType" maxOccurs="unbounded"/>
       </sequence>
     </restriction>
   </complexContent>
 </complexType>
 
*/ struct rsb_soap_data_resultType { /** * (no documentation provided) */ xmlChar *applicationName; /** * (no documentation provided) */ xmlChar *jobId; /** * (no documentation provided) */ int success; /** * (no documentation provided) */ struct rsb_soap_data_payloadType *payload; /** * Size of the payload array. */ int _sizeof_payload; }; /** * Reads a ResultType element from XML. The element to be read is "{http://soap.rsb.openanalytics.eu/types}result", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ResultType, or NULL in case of error. */ struct rsb_soap_data_resultType *xml_read_rsb_soap_data_resultType(xmlTextReaderPtr reader); /** * Writes a ResultType to XML under element name "{http://soap.rsb.openanalytics.eu/types}result". * * @param writer The XML writer. * @param _resultType The ResultType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ int xml_write_rsb_soap_data_resultType(xmlTextWriterPtr writer, struct rsb_soap_data_resultType *_resultType); /** * Frees a ResultType. * * @param _resultType The ResultType to free. */ void free_rsb_soap_data_resultType(struct rsb_soap_data_resultType *_resultType); /** * Reads a ResultType element from XML. The element to be read is "{http://soap.rsb.openanalytics.eu/types}result", and * it is assumed that the reader is already pointing to the element. * * @param reader The XML reader. * @return The ResultType, or NULL in case of error. */ struct rsb_soap_data_resultType *xmlTextReaderReadSoap_dataResultElement(xmlTextReaderPtr reader); /** * Writes a ResultType to XML under element name "{http://soap.rsb.openanalytics.eu/types}result". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _resultType The ResultType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteSoap_dataResultElement(xmlTextWriterPtr writer, struct rsb_soap_data_resultType *_resultType); /** * Writes a ResultType to XML under element name "{http://soap.rsb.openanalytics.eu/types}result". * * @param writer The XML writer. * @param _resultType The ResultType 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 xmlTextWriterWriteSoap_dataResultElementNS(xmlTextWriterPtr writer, struct rsb_soap_data_resultType *_resultType, int writeNamespaces); /** * Frees the children of a ResultType. * * @param _resultType The ResultType whose children are to be free. */ static void freeSoap_dataResultElement(struct rsb_soap_data_resultType *_resultType); /** * Reads a ResultType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The ResultType, or NULL in case of error. */ static struct rsb_soap_data_resultType *xmlTextReaderReadSoap_dataResultTypeType(xmlTextReaderPtr reader); /** * Writes a ResultType to XML. * * @param writer The XML writer. * @param _resultType The ResultType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteSoap_dataResultTypeType(xmlTextWriterPtr writer, struct rsb_soap_data_resultType *_resultType); /** * Frees the elements of a ResultType. * * @param _resultType The ResultType to free. */ static void freeSoap_dataResultTypeType(struct rsb_soap_data_resultType *_resultType); #endif /* DEF_rsb_soap_data_resultType_H */ #ifndef DEF_rsb_rest_data_catalogType_M #define DEF_rsb_rest_data_catalogType_M /** * Reads a Catalog element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}catalog", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The Catalog, or NULL in case of error. */ struct rsb_rest_data_catalogType *xml_read_rsb_rest_data_catalogType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadRest_dataCatalogElement(reader); } /** * Writes a Catalog to XML under element name "{http://rest.rsb.openanalytics.eu/types}catalog". * * @param writer The XML writer. * @param _catalog The Catalog to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_rest_data_catalogType(xmlTextWriterPtr writer, struct rsb_rest_data_catalogType *_catalog) { return xmlTextWriterWriteRest_dataCatalogElementNS(writer, _catalog, 1); } /** * Frees a Catalog. * * @param _catalog The Catalog to free. */ void free_rsb_rest_data_catalogType(struct rsb_rest_data_catalogType *_catalog) { freeRest_dataCatalogTypeType(_catalog); free(_catalog); } /** * Reads a Catalog element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}catalog", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The Catalog, or NULL in case of error. */ struct rsb_rest_data_catalogType *xmlTextReaderReadRest_dataCatalogElement(xmlTextReaderPtr reader) { struct rsb_rest_data_catalogType *_catalog = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "catalog", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://rest.rsb.openanalytics.eu/types}catalog.\n"); #endif _catalog = xmlTextReaderReadRest_dataCatalogTypeType(reader); } #if DEBUG_ENUNCIATE if (_catalog == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}catalog failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}catalog failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _catalog; } /** * Writes a Catalog to XML under element name "{http://rest.rsb.openanalytics.eu/types}catalog". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _catalog The Catalog to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataCatalogElement(xmlTextWriterPtr writer, struct rsb_rest_data_catalogType *_catalog) { return xmlTextWriterWriteRest_dataCatalogElementNS(writer, _catalog, 0); } /** * Writes a Catalog to XML under element name "{http://rest.rsb.openanalytics.eu/types}catalog". * * @param writer The XML writer. * @param _catalog The Catalog to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataCatalogElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_catalogType *_catalog, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "catalog", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://rest.rsb.openanalytics.eu/types}catalog. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}catalog...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:rest_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}catalogType for root element {http://rest.rsb.openanalytics.eu/types}catalog...\n"); #endif status = xmlTextWriterWriteRest_dataCatalogTypeType(writer, _catalog); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://rest.rsb.openanalytics.eu/types}catalog. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://rest.rsb.openanalytics.eu/types}catalog. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a Catalog. * * @param _catalog The Catalog whose children are to be free. */ static void freeRest_dataCatalogElement(struct rsb_rest_data_catalogType *_catalog) { freeRest_dataCatalogTypeType(_catalog); } /** * Reads a Catalog from XML. The reader is assumed to be at the start element. * * @return the Catalog, or NULL in case of error. */ static struct rsb_rest_data_catalogType *xmlTextReaderReadRest_dataCatalogTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_catalogType *_catalog = calloc(1, sizeof(struct rsb_rest_data_catalogType)); 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 freeRest_dataCatalogTypeType(_catalog); free(_catalog); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "directory", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://rest.rsb.openanalytics.eu/types}directory of type {http://rest.rsb.openanalytics.eu/types}catalogDirectory.\n"); #endif _child_accessor = xmlTextReaderReadRest_dataCatalogDirectoryType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {http://rest.rsb.openanalytics.eu/types}directory of type {http://rest.rsb.openanalytics.eu/types}catalogDirectory.\n"); #endif //panic: unable to read the child element for some reason. freeRest_dataCatalogTypeType(_catalog); free(_catalog); return NULL; } _catalog->directories = realloc(_catalog->directories, (_catalog->_sizeof_directories + 1) * sizeof(struct rsb_rest_data_catalogDirectory)); memcpy(&(_catalog->directories[_catalog->_sizeof_directories++]), _child_accessor, sizeof(struct rsb_rest_data_catalogDirectory)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {http://rest.rsb.openanalytics.eu/types}catalogType. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {http://rest.rsb.openanalytics.eu/types}catalogType. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _catalog; } /** * Writes a Catalog to XML. * * @param writer The XML writer. * @param _catalog The Catalog to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataCatalogTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_catalogType *_catalog) { int status, totalBytes = 0, i; xmlChar *binaryData; for (i = 0; i < _catalog->_sizeof_directories; i++) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "directory", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://rest.rsb.openanalytics.eu/types}directory. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}catalogDirectory for element {http://rest.rsb.openanalytics.eu/types}directory...\n"); #endif status = xmlTextWriterWriteRest_dataCatalogDirectoryType(writer, &(_catalog->directories[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://rest.rsb.openanalytics.eu/types}catalogDirectory for element {http://rest.rsb.openanalytics.eu/types}directory. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://rest.rsb.openanalytics.eu/types}directory. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a Catalog. * * @param _catalog The Catalog to free. */ static void freeRest_dataCatalogTypeType(struct rsb_rest_data_catalogType *_catalog) { int i; if (_catalog->directories != NULL) { for (i = 0; i < _catalog->_sizeof_directories; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor directories[%i] of type rsb_rest_data_catalogType...\n", i); #endif freeRest_dataCatalogDirectoryType(&(_catalog->directories[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor directories of type rsb_rest_data_catalogType...\n"); #endif free(_catalog->directories); } } #endif /* DEF_rsb_rest_data_catalogType_M */ #ifndef DEF_rsb_rest_data_catalogDirectory_M #define DEF_rsb_rest_data_catalogDirectory_M /** * Reads a CatalogDirectory from XML. The reader is assumed to be at the start element. * * @return the CatalogDirectory, or NULL in case of error. */ static struct rsb_rest_data_catalogDirectory *xmlTextReaderReadRest_dataCatalogDirectoryType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_catalogDirectory *_catalogDirectory = calloc(1, sizeof(struct rsb_rest_data_catalogDirectory)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "type", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}type...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}type of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataCatalogDirectoryType(_catalogDirectory); free(_catalogDirectory); return NULL; } _catalogDirectory->type = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "path", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}path...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}path of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataCatalogDirectoryType(_catalogDirectory); free(_catalogDirectory); return NULL; } _catalogDirectory->path = ((xmlChar*)_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeRest_dataCatalogDirectoryType(_catalogDirectory); free(_catalogDirectory); return NULL; } } 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 freeRest_dataCatalogDirectoryType(_catalogDirectory); free(_catalogDirectory); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "file", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://rest.rsb.openanalytics.eu/types}file of type {http://rest.rsb.openanalytics.eu/types}catalogFileType.\n"); #endif _child_accessor = xmlTextReaderReadRest_dataCatalogFileTypeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {http://rest.rsb.openanalytics.eu/types}file of type {http://rest.rsb.openanalytics.eu/types}catalogFileType.\n"); #endif //panic: unable to read the child element for some reason. freeRest_dataCatalogDirectoryType(_catalogDirectory); free(_catalogDirectory); return NULL; } _catalogDirectory->files = realloc(_catalogDirectory->files, (_catalogDirectory->_sizeof_files + 1) * sizeof(struct rsb_rest_data_catalogFileType)); memcpy(&(_catalogDirectory->files[_catalogDirectory->_sizeof_files++]), _child_accessor, sizeof(struct rsb_rest_data_catalogFileType)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {http://rest.rsb.openanalytics.eu/types}catalogDirectory. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {http://rest.rsb.openanalytics.eu/types}catalogDirectory. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _catalogDirectory; } /** * Writes a CatalogDirectory to XML. * * @param writer The XML writer. * @param _catalogDirectory The CatalogDirectory to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataCatalogDirectoryType(xmlTextWriterPtr writer, struct rsb_rest_data_catalogDirectory *_catalogDirectory) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_catalogDirectory->type != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "type", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}type. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}type...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_catalogDirectory->type)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}type. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}type. status: %i", status); #endif return status; } totalBytes += status; } if (_catalogDirectory->path != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "path", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}path. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}path...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_catalogDirectory->path)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}path. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}path. status: %i", status); #endif return status; } totalBytes += status; } for (i = 0; i < _catalogDirectory->_sizeof_files; i++) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "file", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://rest.rsb.openanalytics.eu/types}file. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}catalogFileType for element {http://rest.rsb.openanalytics.eu/types}file...\n"); #endif status = xmlTextWriterWriteRest_dataCatalogFileTypeType(writer, &(_catalogDirectory->files[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://rest.rsb.openanalytics.eu/types}catalogFileType for element {http://rest.rsb.openanalytics.eu/types}file. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://rest.rsb.openanalytics.eu/types}file. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a CatalogDirectory. * * @param _catalogDirectory The CatalogDirectory to free. */ static void freeRest_dataCatalogDirectoryType(struct rsb_rest_data_catalogDirectory *_catalogDirectory) { int i; if (_catalogDirectory->type != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor type of type rsb_rest_data_catalogDirectory...\n"); #endif freeXsStringType(_catalogDirectory->type); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor type of type rsb_rest_data_catalogDirectory...\n"); #endif free(_catalogDirectory->type); } if (_catalogDirectory->path != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor path of type rsb_rest_data_catalogDirectory...\n"); #endif freeXsStringType(_catalogDirectory->path); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor path of type rsb_rest_data_catalogDirectory...\n"); #endif free(_catalogDirectory->path); } if (_catalogDirectory->files != NULL) { for (i = 0; i < _catalogDirectory->_sizeof_files; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor files[%i] of type rsb_rest_data_catalogDirectory...\n", i); #endif freeRest_dataCatalogFileTypeType(&(_catalogDirectory->files[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor files of type rsb_rest_data_catalogDirectory...\n"); #endif free(_catalogDirectory->files); } } #endif /* DEF_rsb_rest_data_catalogDirectory_M */ #ifndef DEF_rsb_rest_data_catalogFileType_M #define DEF_rsb_rest_data_catalogFileType_M /** * Reads a CatalogFileType from XML. The reader is assumed to be at the start element. * * @return the CatalogFileType, or NULL in case of error. */ static struct rsb_rest_data_catalogFileType *xmlTextReaderReadRest_dataCatalogFileTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_catalogFileType *_catalogFileType = calloc(1, sizeof(struct rsb_rest_data_catalogFileType)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}name...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataCatalogFileTypeType(_catalogFileType); free(_catalogFileType); return NULL; } _catalogFileType->name = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "dataUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}anyURI from attribute {}dataUri...\n"); #endif _child_accessor = xmlTextReaderReadXsAnyURIType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}dataUri of type {http://www.w3.org/2001/XMLSchema}anyURI.\n"); #endif freeRest_dataCatalogFileTypeType(_catalogFileType); free(_catalogFileType); return NULL; } _catalogFileType->dataUri = ((xmlChar*)_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeRest_dataCatalogFileTypeType(_catalogFileType); free(_catalogFileType); return NULL; } } return _catalogFileType; } /** * Writes a CatalogFileType to XML. * * @param writer The XML writer. * @param _catalogFileType The CatalogFileType to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataCatalogFileTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_catalogFileType *_catalogFileType) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_catalogFileType->name != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}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 attribute {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_catalogFileType->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}name. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}name. status: %i", status); #endif return status; } totalBytes += status; } if (_catalogFileType->dataUri != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "dataUri", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}dataUri. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}dataUri...\n"); #endif status = xmlTextWriterWriteXsAnyURIType(writer, (_catalogFileType->dataUri)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}dataUri. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}dataUri. status: %i", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a CatalogFileType. * * @param _catalogFileType The CatalogFileType to free. */ static void freeRest_dataCatalogFileTypeType(struct rsb_rest_data_catalogFileType *_catalogFileType) { int i; if (_catalogFileType->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type rsb_rest_data_catalogFileType...\n"); #endif freeXsStringType(_catalogFileType->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type rsb_rest_data_catalogFileType...\n"); #endif free(_catalogFileType->name); } if (_catalogFileType->dataUri != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor dataUri of type rsb_rest_data_catalogFileType...\n"); #endif freeXsAnyURIType(_catalogFileType->dataUri); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor dataUri of type rsb_rest_data_catalogFileType...\n"); #endif free(_catalogFileType->dataUri); } } #endif /* DEF_rsb_rest_data_catalogFileType_M */ #ifndef DEF_rsb_rest_data_directoryType_M #define DEF_rsb_rest_data_directoryType_M /** * Reads a Directory element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}directory", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The Directory, or NULL in case of error. */ struct rsb_rest_data_directoryType *xml_read_rsb_rest_data_directoryType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadRest_dataDirectoryElement(reader); } /** * Writes a Directory to XML under element name "{http://rest.rsb.openanalytics.eu/types}directory". * * @param writer The XML writer. * @param _directory The Directory to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_rest_data_directoryType(xmlTextWriterPtr writer, struct rsb_rest_data_directoryType *_directory) { return xmlTextWriterWriteRest_dataDirectoryElementNS(writer, _directory, 1); } /** * Frees a Directory. * * @param _directory The Directory to free. */ void free_rsb_rest_data_directoryType(struct rsb_rest_data_directoryType *_directory) { freeRest_dataDirectoryTypeType(_directory); free(_directory); } /** * Reads a Directory element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}directory", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The Directory, or NULL in case of error. */ struct rsb_rest_data_directoryType *xmlTextReaderReadRest_dataDirectoryElement(xmlTextReaderPtr reader) { struct rsb_rest_data_directoryType *_directory = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "directory", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://rest.rsb.openanalytics.eu/types}directory.\n"); #endif _directory = xmlTextReaderReadRest_dataDirectoryTypeType(reader); } #if DEBUG_ENUNCIATE if (_directory == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}directory failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}directory failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _directory; } /** * Writes a Directory to XML under element name "{http://rest.rsb.openanalytics.eu/types}directory". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _directory The Directory to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataDirectoryElement(xmlTextWriterPtr writer, struct rsb_rest_data_directoryType *_directory) { return xmlTextWriterWriteRest_dataDirectoryElementNS(writer, _directory, 0); } /** * Writes a Directory to XML under element name "{http://rest.rsb.openanalytics.eu/types}directory". * * @param writer The XML writer. * @param _directory The Directory to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataDirectoryElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_directoryType *_directory, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "directory", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://rest.rsb.openanalytics.eu/types}directory. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}directory...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:rest_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}directoryType for root element {http://rest.rsb.openanalytics.eu/types}directory...\n"); #endif status = xmlTextWriterWriteRest_dataDirectoryTypeType(writer, _directory); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://rest.rsb.openanalytics.eu/types}directory. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://rest.rsb.openanalytics.eu/types}directory. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a Directory. * * @param _directory The Directory whose children are to be free. */ static void freeRest_dataDirectoryElement(struct rsb_rest_data_directoryType *_directory) { freeRest_dataDirectoryTypeType(_directory); } /** * Reads a Directory from XML. The reader is assumed to be at the start element. * * @return the Directory, or NULL in case of error. */ static struct rsb_rest_data_directoryType *xmlTextReaderReadRest_dataDirectoryTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_directoryType *_directory = calloc(1, sizeof(struct rsb_rest_data_directoryType)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "path", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}path...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}path of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataDirectoryTypeType(_directory); free(_directory); return NULL; } _directory->path = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}name...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataDirectoryTypeType(_directory); free(_directory); return NULL; } _directory->name = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "uri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}anyURI from attribute {}uri...\n"); #endif _child_accessor = xmlTextReaderReadXsAnyURIType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}uri of type {http://www.w3.org/2001/XMLSchema}anyURI.\n"); #endif freeRest_dataDirectoryTypeType(_directory); free(_directory); return NULL; } _directory->uri = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "empty", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}boolean from attribute {}empty...\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}empty of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif freeRest_dataDirectoryTypeType(_directory); free(_directory); return NULL; } _directory->empty = *((int*)_child_accessor); freeXsBooleanType((int*) _child_accessor); free(_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeRest_dataDirectoryTypeType(_directory); free(_directory); return NULL; } } 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 freeRest_dataDirectoryTypeType(_directory); free(_directory); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "directory", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://rest.rsb.openanalytics.eu/types}directory of type {http://rest.rsb.openanalytics.eu/types}directoryType.\n"); #endif _child_accessor = xmlTextReaderReadRest_dataDirectoryTypeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {http://rest.rsb.openanalytics.eu/types}directory of type {http://rest.rsb.openanalytics.eu/types}directoryType.\n"); #endif //panic: unable to read the child element for some reason. freeRest_dataDirectoryTypeType(_directory); free(_directory); return NULL; } _directory->directories = realloc(_directory->directories, (_directory->_sizeof_directories + 1) * sizeof(struct rsb_rest_data_directoryType)); memcpy(&(_directory->directories[_directory->_sizeof_directories++]), _child_accessor, sizeof(struct rsb_rest_data_directoryType)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "file", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://rest.rsb.openanalytics.eu/types}file of type {http://rest.rsb.openanalytics.eu/types}fileType.\n"); #endif _child_accessor = xmlTextReaderReadRest_dataFileTypeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {http://rest.rsb.openanalytics.eu/types}file of type {http://rest.rsb.openanalytics.eu/types}fileType.\n"); #endif //panic: unable to read the child element for some reason. freeRest_dataDirectoryTypeType(_directory); free(_directory); return NULL; } _directory->files = realloc(_directory->files, (_directory->_sizeof_files + 1) * sizeof(struct rsb_rest_data_fileType)); memcpy(&(_directory->files[_directory->_sizeof_files++]), _child_accessor, sizeof(struct rsb_rest_data_fileType)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {http://rest.rsb.openanalytics.eu/types}directoryType. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {http://rest.rsb.openanalytics.eu/types}directoryType. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _directory; } /** * Writes a Directory to XML. * * @param writer The XML writer. * @param _directory The Directory to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataDirectoryTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_directoryType *_directory) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_directory->path != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "path", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}path. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}path...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_directory->path)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}path. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}path. status: %i", status); #endif return status; } totalBytes += status; } if (_directory->name != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}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 attribute {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_directory->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}name. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}name. status: %i", status); #endif return status; } totalBytes += status; } if (_directory->uri != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "uri", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}uri. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}uri...\n"); #endif status = xmlTextWriterWriteXsAnyURIType(writer, (_directory->uri)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}uri. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}uri. status: %i", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive attribute status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "empty", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}empty. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}empty...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, &(_directory->empty)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}empty. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}empty. status: %i", status); #endif return status; } totalBytes += status; } for (i = 0; i < _directory->_sizeof_directories; i++) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "directory", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://rest.rsb.openanalytics.eu/types}directory. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}directoryType for element {http://rest.rsb.openanalytics.eu/types}directory...\n"); #endif status = xmlTextWriterWriteRest_dataDirectoryTypeType(writer, &(_directory->directories[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://rest.rsb.openanalytics.eu/types}directoryType for element {http://rest.rsb.openanalytics.eu/types}directory. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://rest.rsb.openanalytics.eu/types}directory. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _directory->_sizeof_files; i++) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "file", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://rest.rsb.openanalytics.eu/types}file. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}fileType for element {http://rest.rsb.openanalytics.eu/types}file...\n"); #endif status = xmlTextWriterWriteRest_dataFileTypeType(writer, &(_directory->files[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://rest.rsb.openanalytics.eu/types}fileType for element {http://rest.rsb.openanalytics.eu/types}file. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://rest.rsb.openanalytics.eu/types}file. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a Directory. * * @param _directory The Directory to free. */ static void freeRest_dataDirectoryTypeType(struct rsb_rest_data_directoryType *_directory) { int i; if (_directory->path != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor path of type rsb_rest_data_directoryType...\n"); #endif freeXsStringType(_directory->path); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor path of type rsb_rest_data_directoryType...\n"); #endif free(_directory->path); } if (_directory->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type rsb_rest_data_directoryType...\n"); #endif freeXsStringType(_directory->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type rsb_rest_data_directoryType...\n"); #endif free(_directory->name); } if (_directory->uri != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor uri of type rsb_rest_data_directoryType...\n"); #endif freeXsAnyURIType(_directory->uri); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor uri of type rsb_rest_data_directoryType...\n"); #endif free(_directory->uri); } if (_directory->directories != NULL) { for (i = 0; i < _directory->_sizeof_directories; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor directories[%i] of type rsb_rest_data_directoryType...\n", i); #endif freeRest_dataDirectoryTypeType(&(_directory->directories[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor directories of type rsb_rest_data_directoryType...\n"); #endif free(_directory->directories); } if (_directory->files != NULL) { for (i = 0; i < _directory->_sizeof_files; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor files[%i] of type rsb_rest_data_directoryType...\n", i); #endif freeRest_dataFileTypeType(&(_directory->files[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor files of type rsb_rest_data_directoryType...\n"); #endif free(_directory->files); } } #endif /* DEF_rsb_rest_data_directoryType_M */ #ifndef DEF_rsb_rest_data_errorResultType_M #define DEF_rsb_rest_data_errorResultType_M /** * Reads a ErrorResult element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}errorResult", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ErrorResult, or NULL in case of error. */ struct rsb_rest_data_errorResultType *xml_read_rsb_rest_data_errorResultType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadRest_dataErrorResultElement(reader); } /** * Writes a ErrorResult to XML under element name "{http://rest.rsb.openanalytics.eu/types}errorResult". * * @param writer The XML writer. * @param _errorResult The ErrorResult to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_rest_data_errorResultType(xmlTextWriterPtr writer, struct rsb_rest_data_errorResultType *_errorResult) { return xmlTextWriterWriteRest_dataErrorResultElementNS(writer, _errorResult, 1); } /** * Frees a ErrorResult. * * @param _errorResult The ErrorResult to free. */ void free_rsb_rest_data_errorResultType(struct rsb_rest_data_errorResultType *_errorResult) { freeRest_dataErrorResultTypeType(_errorResult); free(_errorResult); } /** * Reads a ErrorResult element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}errorResult", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The ErrorResult, or NULL in case of error. */ struct rsb_rest_data_errorResultType *xmlTextReaderReadRest_dataErrorResultElement(xmlTextReaderPtr reader) { struct rsb_rest_data_errorResultType *_errorResult = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "errorResult", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://rest.rsb.openanalytics.eu/types}errorResult.\n"); #endif _errorResult = xmlTextReaderReadRest_dataErrorResultTypeType(reader); } #if DEBUG_ENUNCIATE if (_errorResult == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}errorResult failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}errorResult failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _errorResult; } /** * Writes a ErrorResult to XML under element name "{http://rest.rsb.openanalytics.eu/types}errorResult". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _errorResult The ErrorResult to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataErrorResultElement(xmlTextWriterPtr writer, struct rsb_rest_data_errorResultType *_errorResult) { return xmlTextWriterWriteRest_dataErrorResultElementNS(writer, _errorResult, 0); } /** * Writes a ErrorResult to XML under element name "{http://rest.rsb.openanalytics.eu/types}errorResult". * * @param writer The XML writer. * @param _errorResult The ErrorResult to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataErrorResultElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_errorResultType *_errorResult, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "errorResult", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://rest.rsb.openanalytics.eu/types}errorResult. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}errorResult...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:rest_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}errorResultType for root element {http://rest.rsb.openanalytics.eu/types}errorResult...\n"); #endif status = xmlTextWriterWriteRest_dataErrorResultTypeType(writer, _errorResult); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://rest.rsb.openanalytics.eu/types}errorResult. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://rest.rsb.openanalytics.eu/types}errorResult. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a ErrorResult. * * @param _errorResult The ErrorResult whose children are to be free. */ static void freeRest_dataErrorResultElement(struct rsb_rest_data_errorResultType *_errorResult) { freeRest_dataErrorResultTypeType(_errorResult); } /** * Reads a ErrorResult from XML. The reader is assumed to be at the start element. * * @return the ErrorResult, or NULL in case of error. */ static struct rsb_rest_data_errorResultType *xmlTextReaderReadRest_dataErrorResultTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_errorResultType *_errorResult = calloc(1, sizeof(struct rsb_rest_data_errorResultType)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "jobId", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}jobId...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}jobId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataErrorResultTypeType(_errorResult); free(_errorResult); return NULL; } _errorResult->jobId = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "applicationName", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}applicationName...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}applicationName of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataErrorResultTypeType(_errorResult); free(_errorResult); return NULL; } _errorResult->applicationName = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "submissionTime", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}dateTime from attribute {}submissionTime...\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}submissionTime of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif freeRest_dataErrorResultTypeType(_errorResult); free(_errorResult); return NULL; } _errorResult->submissionTime = ((struct tm*)_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeRest_dataErrorResultTypeType(_errorResult); free(_errorResult); return NULL; } } 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 freeRest_dataErrorResultTypeType(_errorResult); free(_errorResult); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "errorMessage", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://rest.rsb.openanalytics.eu/types}errorMessage 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 {http://rest.rsb.openanalytics.eu/types}errorMessage of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeRest_dataErrorResultTypeType(_errorResult); free(_errorResult); return NULL; } _errorResult->errorMessage = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {http://rest.rsb.openanalytics.eu/types}errorResultType. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {http://rest.rsb.openanalytics.eu/types}errorResultType. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _errorResult; } /** * Writes a ErrorResult to XML. * * @param writer The XML writer. * @param _errorResult The ErrorResult to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataErrorResultTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_errorResultType *_errorResult) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_errorResult->jobId != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jobId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}jobId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}jobId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_errorResult->jobId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}jobId. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}jobId. status: %i", status); #endif return status; } totalBytes += status; } if (_errorResult->applicationName != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationName", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}applicationName. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}applicationName...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_errorResult->applicationName)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}applicationName. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}applicationName. status: %i", status); #endif return status; } totalBytes += status; } if (_errorResult->submissionTime != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "submissionTime", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}submissionTime. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for attribute {}submissionTime...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_errorResult->submissionTime)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for attribute {}submissionTime. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}submissionTime. status: %i", status); #endif return status; } totalBytes += status; } if (_errorResult->errorMessage != NULL) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "errorMessage", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://rest.rsb.openanalytics.eu/types}errorMessage. 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 {http://rest.rsb.openanalytics.eu/types}errorMessage...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_errorResult->errorMessage)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {http://rest.rsb.openanalytics.eu/types}errorMessage. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://rest.rsb.openanalytics.eu/types}errorMessage. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a ErrorResult. * * @param _errorResult The ErrorResult to free. */ static void freeRest_dataErrorResultTypeType(struct rsb_rest_data_errorResultType *_errorResult) { int i; if (_errorResult->jobId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor jobId of type rsb_rest_data_errorResultType...\n"); #endif freeXsStringType(_errorResult->jobId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor jobId of type rsb_rest_data_errorResultType...\n"); #endif free(_errorResult->jobId); } if (_errorResult->applicationName != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor applicationName of type rsb_rest_data_errorResultType...\n"); #endif freeXsStringType(_errorResult->applicationName); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor applicationName of type rsb_rest_data_errorResultType...\n"); #endif free(_errorResult->applicationName); } if (_errorResult->submissionTime != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor submissionTime of type rsb_rest_data_errorResultType...\n"); #endif freeXsDateTimeType(_errorResult->submissionTime); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor submissionTime of type rsb_rest_data_errorResultType...\n"); #endif free(_errorResult->submissionTime); } if (_errorResult->errorMessage != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor errorMessage of type rsb_rest_data_errorResultType...\n"); #endif freeXsStringType(_errorResult->errorMessage); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor errorMessage of type rsb_rest_data_errorResultType...\n"); #endif free(_errorResult->errorMessage); } } #endif /* DEF_rsb_rest_data_errorResultType_M */ #ifndef DEF_rsb_rest_data_fileType_M #define DEF_rsb_rest_data_fileType_M /** * Reads a FileType from XML. The reader is assumed to be at the start element. * * @return the FileType, or NULL in case of error. */ static struct rsb_rest_data_fileType *xmlTextReaderReadRest_dataFileTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_fileType *_fileType = calloc(1, sizeof(struct rsb_rest_data_fileType)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "path", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}path...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}path of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataFileTypeType(_fileType); free(_fileType); return NULL; } _fileType->path = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}name...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataFileTypeType(_fileType); free(_fileType); return NULL; } _fileType->name = ((xmlChar*)_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeRest_dataFileTypeType(_fileType); free(_fileType); return NULL; } } return _fileType; } /** * Writes a FileType to XML. * * @param writer The XML writer. * @param _fileType The FileType to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataFileTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_fileType *_fileType) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_fileType->path != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "path", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}path. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}path...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_fileType->path)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}path. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}path. status: %i", status); #endif return status; } totalBytes += status; } if (_fileType->name != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}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 attribute {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_fileType->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}name. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}name. status: %i", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a FileType. * * @param _fileType The FileType to free. */ static void freeRest_dataFileTypeType(struct rsb_rest_data_fileType *_fileType) { int i; if (_fileType->path != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor path of type rsb_rest_data_fileType...\n"); #endif freeXsStringType(_fileType->path); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor path of type rsb_rest_data_fileType...\n"); #endif free(_fileType->path); } if (_fileType->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type rsb_rest_data_fileType...\n"); #endif freeXsStringType(_fileType->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type rsb_rest_data_fileType...\n"); #endif free(_fileType->name); } } #endif /* DEF_rsb_rest_data_fileType_M */ #ifndef DEF_rsb_rest_data_jobTokenType_M #define DEF_rsb_rest_data_jobTokenType_M /** * Reads a JobToken element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}jobToken", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The JobToken, or NULL in case of error. */ struct rsb_rest_data_jobTokenType *xml_read_rsb_rest_data_jobTokenType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadRest_dataJobTokenElement(reader); } /** * Writes a JobToken to XML under element name "{http://rest.rsb.openanalytics.eu/types}jobToken". * * @param writer The XML writer. * @param _jobToken The JobToken to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_rest_data_jobTokenType(xmlTextWriterPtr writer, struct rsb_rest_data_jobTokenType *_jobToken) { return xmlTextWriterWriteRest_dataJobTokenElementNS(writer, _jobToken, 1); } /** * Frees a JobToken. * * @param _jobToken The JobToken to free. */ void free_rsb_rest_data_jobTokenType(struct rsb_rest_data_jobTokenType *_jobToken) { freeRest_dataJobTokenTypeType(_jobToken); free(_jobToken); } /** * Reads a JobToken element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}jobToken", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The JobToken, or NULL in case of error. */ struct rsb_rest_data_jobTokenType *xmlTextReaderReadRest_dataJobTokenElement(xmlTextReaderPtr reader) { struct rsb_rest_data_jobTokenType *_jobToken = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "jobToken", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://rest.rsb.openanalytics.eu/types}jobToken.\n"); #endif _jobToken = xmlTextReaderReadRest_dataJobTokenTypeType(reader); } #if DEBUG_ENUNCIATE if (_jobToken == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}jobToken failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}jobToken failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _jobToken; } /** * Writes a JobToken to XML under element name "{http://rest.rsb.openanalytics.eu/types}jobToken". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _jobToken The JobToken to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataJobTokenElement(xmlTextWriterPtr writer, struct rsb_rest_data_jobTokenType *_jobToken) { return xmlTextWriterWriteRest_dataJobTokenElementNS(writer, _jobToken, 0); } /** * Writes a JobToken to XML under element name "{http://rest.rsb.openanalytics.eu/types}jobToken". * * @param writer The XML writer. * @param _jobToken The JobToken to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataJobTokenElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_jobTokenType *_jobToken, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "jobToken", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://rest.rsb.openanalytics.eu/types}jobToken. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}jobToken...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:rest_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}jobTokenType for root element {http://rest.rsb.openanalytics.eu/types}jobToken...\n"); #endif status = xmlTextWriterWriteRest_dataJobTokenTypeType(writer, _jobToken); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://rest.rsb.openanalytics.eu/types}jobToken. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://rest.rsb.openanalytics.eu/types}jobToken. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a JobToken. * * @param _jobToken The JobToken whose children are to be free. */ static void freeRest_dataJobTokenElement(struct rsb_rest_data_jobTokenType *_jobToken) { freeRest_dataJobTokenTypeType(_jobToken); } /** * Reads a JobToken from XML. The reader is assumed to be at the start element. * * @return the JobToken, or NULL in case of error. */ static struct rsb_rest_data_jobTokenType *xmlTextReaderReadRest_dataJobTokenTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_jobTokenType *_jobToken = calloc(1, sizeof(struct rsb_rest_data_jobTokenType)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "jobId", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}jobId...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}jobId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataJobTokenTypeType(_jobToken); free(_jobToken); return NULL; } _jobToken->jobId = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "applicationName", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}applicationName...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}applicationName of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataJobTokenTypeType(_jobToken); free(_jobToken); return NULL; } _jobToken->applicationName = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "submissionTime", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}dateTime from attribute {}submissionTime...\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}submissionTime of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif freeRest_dataJobTokenTypeType(_jobToken); free(_jobToken); return NULL; } _jobToken->submissionTime = ((struct tm*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "applicationResultsUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}anyURI from attribute {}applicationResultsUri...\n"); #endif _child_accessor = xmlTextReaderReadXsAnyURIType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}applicationResultsUri of type {http://www.w3.org/2001/XMLSchema}anyURI.\n"); #endif freeRest_dataJobTokenTypeType(_jobToken); free(_jobToken); return NULL; } _jobToken->applicationResultsUri = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "resultUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}anyURI from attribute {}resultUri...\n"); #endif _child_accessor = xmlTextReaderReadXsAnyURIType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}resultUri of type {http://www.w3.org/2001/XMLSchema}anyURI.\n"); #endif freeRest_dataJobTokenTypeType(_jobToken); free(_jobToken); return NULL; } _jobToken->resultUri = ((xmlChar*)_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeRest_dataJobTokenTypeType(_jobToken); free(_jobToken); return NULL; } } return _jobToken; } /** * Writes a JobToken to XML. * * @param writer The XML writer. * @param _jobToken The JobToken to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataJobTokenTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_jobTokenType *_jobToken) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_jobToken->jobId != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jobId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}jobId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}jobId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_jobToken->jobId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}jobId. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}jobId. status: %i", status); #endif return status; } totalBytes += status; } if (_jobToken->applicationName != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationName", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}applicationName. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}applicationName...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_jobToken->applicationName)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}applicationName. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}applicationName. status: %i", status); #endif return status; } totalBytes += status; } if (_jobToken->submissionTime != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "submissionTime", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}submissionTime. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for attribute {}submissionTime...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_jobToken->submissionTime)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for attribute {}submissionTime. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}submissionTime. status: %i", status); #endif return status; } totalBytes += status; } if (_jobToken->applicationResultsUri != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationResultsUri", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}applicationResultsUri. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}applicationResultsUri...\n"); #endif status = xmlTextWriterWriteXsAnyURIType(writer, (_jobToken->applicationResultsUri)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}applicationResultsUri. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}applicationResultsUri. status: %i", status); #endif return status; } totalBytes += status; } if (_jobToken->resultUri != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "resultUri", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}resultUri. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}resultUri...\n"); #endif status = xmlTextWriterWriteXsAnyURIType(writer, (_jobToken->resultUri)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}resultUri. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}resultUri. status: %i", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a JobToken. * * @param _jobToken The JobToken to free. */ static void freeRest_dataJobTokenTypeType(struct rsb_rest_data_jobTokenType *_jobToken) { int i; if (_jobToken->jobId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor jobId of type rsb_rest_data_jobTokenType...\n"); #endif freeXsStringType(_jobToken->jobId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor jobId of type rsb_rest_data_jobTokenType...\n"); #endif free(_jobToken->jobId); } if (_jobToken->applicationName != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor applicationName of type rsb_rest_data_jobTokenType...\n"); #endif freeXsStringType(_jobToken->applicationName); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor applicationName of type rsb_rest_data_jobTokenType...\n"); #endif free(_jobToken->applicationName); } if (_jobToken->submissionTime != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor submissionTime of type rsb_rest_data_jobTokenType...\n"); #endif freeXsDateTimeType(_jobToken->submissionTime); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor submissionTime of type rsb_rest_data_jobTokenType...\n"); #endif free(_jobToken->submissionTime); } if (_jobToken->applicationResultsUri != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor applicationResultsUri of type rsb_rest_data_jobTokenType...\n"); #endif freeXsAnyURIType(_jobToken->applicationResultsUri); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor applicationResultsUri of type rsb_rest_data_jobTokenType...\n"); #endif free(_jobToken->applicationResultsUri); } if (_jobToken->resultUri != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor resultUri of type rsb_rest_data_jobTokenType...\n"); #endif freeXsAnyURIType(_jobToken->resultUri); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor resultUri of type rsb_rest_data_jobTokenType...\n"); #endif free(_jobToken->resultUri); } } #endif /* DEF_rsb_rest_data_jobTokenType_M */ #ifndef DEF_rsb_rest_data_nodeInformationType_M #define DEF_rsb_rest_data_nodeInformationType_M /** * Reads a NodeInformation element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}nodeInformation", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The NodeInformation, or NULL in case of error. */ struct rsb_rest_data_nodeInformationType *xml_read_rsb_rest_data_nodeInformationType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadRest_dataNodeInformationElement(reader); } /** * Writes a NodeInformation to XML under element name "{http://rest.rsb.openanalytics.eu/types}nodeInformation". * * @param writer The XML writer. * @param _nodeInformation The NodeInformation to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_rest_data_nodeInformationType(xmlTextWriterPtr writer, struct rsb_rest_data_nodeInformationType *_nodeInformation) { return xmlTextWriterWriteRest_dataNodeInformationElementNS(writer, _nodeInformation, 1); } /** * Frees a NodeInformation. * * @param _nodeInformation The NodeInformation to free. */ void free_rsb_rest_data_nodeInformationType(struct rsb_rest_data_nodeInformationType *_nodeInformation) { freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); } /** * Reads a NodeInformation element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}nodeInformation", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The NodeInformation, or NULL in case of error. */ struct rsb_rest_data_nodeInformationType *xmlTextReaderReadRest_dataNodeInformationElement(xmlTextReaderPtr reader) { struct rsb_rest_data_nodeInformationType *_nodeInformation = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "nodeInformation", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://rest.rsb.openanalytics.eu/types}nodeInformation.\n"); #endif _nodeInformation = xmlTextReaderReadRest_dataNodeInformationTypeType(reader); } #if DEBUG_ENUNCIATE if (_nodeInformation == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}nodeInformation failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}nodeInformation failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _nodeInformation; } /** * Writes a NodeInformation to XML under element name "{http://rest.rsb.openanalytics.eu/types}nodeInformation". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _nodeInformation The NodeInformation to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataNodeInformationElement(xmlTextWriterPtr writer, struct rsb_rest_data_nodeInformationType *_nodeInformation) { return xmlTextWriterWriteRest_dataNodeInformationElementNS(writer, _nodeInformation, 0); } /** * Writes a NodeInformation to XML under element name "{http://rest.rsb.openanalytics.eu/types}nodeInformation". * * @param writer The XML writer. * @param _nodeInformation The NodeInformation to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataNodeInformationElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_nodeInformationType *_nodeInformation, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "nodeInformation", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://rest.rsb.openanalytics.eu/types}nodeInformation. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}nodeInformation...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:rest_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}nodeInformationType for root element {http://rest.rsb.openanalytics.eu/types}nodeInformation...\n"); #endif status = xmlTextWriterWriteRest_dataNodeInformationTypeType(writer, _nodeInformation); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://rest.rsb.openanalytics.eu/types}nodeInformation. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://rest.rsb.openanalytics.eu/types}nodeInformation. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a NodeInformation. * * @param _nodeInformation The NodeInformation whose children are to be free. */ static void freeRest_dataNodeInformationElement(struct rsb_rest_data_nodeInformationType *_nodeInformation) { freeRest_dataNodeInformationTypeType(_nodeInformation); } /** * Reads a NodeInformation from XML. The reader is assumed to be at the start element. * * @return the NodeInformation, or NULL in case of error. */ static struct rsb_rest_data_nodeInformationType *xmlTextReaderReadRest_dataNodeInformationTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_nodeInformationType *_nodeInformation = calloc(1, sizeof(struct rsb_rest_data_nodeInformationType)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}name...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } _nodeInformation->name = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "healthy", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}boolean from attribute {}healthy...\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}healthy of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } _nodeInformation->healthy = *((int*)_child_accessor); freeXsBooleanType((int*) _child_accessor); free(_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "uptime", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}long from attribute {}uptime...\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}uptime of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } _nodeInformation->uptime = *((long long*)_child_accessor); freeXsLongType((long long*) _child_accessor); free(_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "uptimeText", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}uptimeText...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}uptimeText of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } _nodeInformation->uptimeText = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "servletContainerInfo", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}servletContainerInfo...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}servletContainerInfo of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } _nodeInformation->servletContainerInfo = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "rsbVersion", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}rsbVersion...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}rsbVersion of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } _nodeInformation->rsbVersion = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "jvmMaxMemory", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}long from attribute {}jvmMaxMemory...\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}jvmMaxMemory of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } _nodeInformation->jvmMaxMemory = *((long long*)_child_accessor); freeXsLongType((long long*) _child_accessor); free(_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "jvmFreeMemory", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}long from attribute {}jvmFreeMemory...\n"); #endif _child_accessor = xmlTextReaderReadXsLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}jvmFreeMemory of type {http://www.w3.org/2001/XMLSchema}long.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } _nodeInformation->jvmFreeMemory = *((long long*)_child_accessor); freeXsLongType((long long*) _child_accessor); free(_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "osLoadAverage", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}double from attribute {}osLoadAverage...\n"); #endif _child_accessor = xmlTextReaderReadXsDoubleType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}osLoadAverage of type {http://www.w3.org/2001/XMLSchema}double.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } _nodeInformation->osLoadAverage = *((double*)_child_accessor); freeXsDoubleType((double*) _child_accessor); free(_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeRest_dataNodeInformationTypeType(_nodeInformation); free(_nodeInformation); return NULL; } } return _nodeInformation; } /** * Writes a NodeInformation to XML. * * @param writer The XML writer. * @param _nodeInformation The NodeInformation to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataNodeInformationTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_nodeInformationType *_nodeInformation) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_nodeInformation->name != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}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 attribute {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_nodeInformation->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}name. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}name. status: %i", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive attribute status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "healthy", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}healthy. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}healthy...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, &(_nodeInformation->healthy)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}healthy. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}healthy. status: %i", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive attribute status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "uptime", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}uptime. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for attribute {}uptime...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, &(_nodeInformation->uptime)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for attribute {}uptime. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}uptime. status: %i", status); #endif return status; } totalBytes += status; } if (_nodeInformation->uptimeText != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "uptimeText", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}uptimeText. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}uptimeText...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_nodeInformation->uptimeText)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}uptimeText. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}uptimeText. status: %i", status); #endif return status; } totalBytes += status; } if (_nodeInformation->servletContainerInfo != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "servletContainerInfo", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}servletContainerInfo. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}servletContainerInfo...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_nodeInformation->servletContainerInfo)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}servletContainerInfo. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}servletContainerInfo. status: %i", status); #endif return status; } totalBytes += status; } if (_nodeInformation->rsbVersion != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "rsbVersion", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}rsbVersion. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}rsbVersion...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_nodeInformation->rsbVersion)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}rsbVersion. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}rsbVersion. status: %i", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive attribute status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jvmMaxMemory", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}jvmMaxMemory. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for attribute {}jvmMaxMemory...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, &(_nodeInformation->jvmMaxMemory)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for attribute {}jvmMaxMemory. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}jvmMaxMemory. status: %i", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive attribute status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jvmFreeMemory", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}jvmFreeMemory. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}long for attribute {}jvmFreeMemory...\n"); #endif status = xmlTextWriterWriteXsLongType(writer, &(_nodeInformation->jvmFreeMemory)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}long for attribute {}jvmFreeMemory. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}jvmFreeMemory. status: %i", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive attribute status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "osLoadAverage", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}osLoadAverage. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}double for attribute {}osLoadAverage...\n"); #endif status = xmlTextWriterWriteXsDoubleType(writer, &(_nodeInformation->osLoadAverage)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}double for attribute {}osLoadAverage. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}osLoadAverage. status: %i", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a NodeInformation. * * @param _nodeInformation The NodeInformation to free. */ static void freeRest_dataNodeInformationTypeType(struct rsb_rest_data_nodeInformationType *_nodeInformation) { int i; if (_nodeInformation->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type rsb_rest_data_nodeInformationType...\n"); #endif freeXsStringType(_nodeInformation->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type rsb_rest_data_nodeInformationType...\n"); #endif free(_nodeInformation->name); } if (_nodeInformation->uptimeText != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor uptimeText of type rsb_rest_data_nodeInformationType...\n"); #endif freeXsStringType(_nodeInformation->uptimeText); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor uptimeText of type rsb_rest_data_nodeInformationType...\n"); #endif free(_nodeInformation->uptimeText); } if (_nodeInformation->servletContainerInfo != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor servletContainerInfo of type rsb_rest_data_nodeInformationType...\n"); #endif freeXsStringType(_nodeInformation->servletContainerInfo); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor servletContainerInfo of type rsb_rest_data_nodeInformationType...\n"); #endif free(_nodeInformation->servletContainerInfo); } if (_nodeInformation->rsbVersion != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor rsbVersion of type rsb_rest_data_nodeInformationType...\n"); #endif freeXsStringType(_nodeInformation->rsbVersion); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor rsbVersion of type rsb_rest_data_nodeInformationType...\n"); #endif free(_nodeInformation->rsbVersion); } } #endif /* DEF_rsb_rest_data_nodeInformationType_M */ #ifndef DEF_rsb_rest_data_rServiPoolType_M #define DEF_rsb_rest_data_rServiPoolType_M /** * Reads a RServiPoolType from XML. The reader is assumed to be at the start element. * * @return the RServiPoolType, or NULL in case of error. */ static struct rsb_rest_data_rServiPoolType *xmlTextReaderReadRest_dataRServiPoolTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_rServiPoolType *_rServiPoolType = calloc(1, sizeof(struct rsb_rest_data_rServiPoolType)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "poolUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}anyURI from attribute {}poolUri...\n"); #endif _child_accessor = xmlTextReaderReadXsAnyURIType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}poolUri of type {http://www.w3.org/2001/XMLSchema}anyURI.\n"); #endif freeRest_dataRServiPoolTypeType(_rServiPoolType); free(_rServiPoolType); return NULL; } _rServiPoolType->poolUri = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "applicationNames", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}applicationNames...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}applicationNames of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataRServiPoolTypeType(_rServiPoolType); free(_rServiPoolType); return NULL; } _rServiPoolType->applicationNames = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "default", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}boolean from attribute {}default...\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}default of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif freeRest_dataRServiPoolTypeType(_rServiPoolType); free(_rServiPoolType); return NULL; } _rServiPoolType->_default = *((int*)_child_accessor); freeXsBooleanType((int*) _child_accessor); free(_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeRest_dataRServiPoolTypeType(_rServiPoolType); free(_rServiPoolType); return NULL; } } return _rServiPoolType; } /** * Writes a RServiPoolType to XML. * * @param writer The XML writer. * @param _rServiPoolType The RServiPoolType to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataRServiPoolTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolType *_rServiPoolType) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_rServiPoolType->poolUri != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "poolUri", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}poolUri. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}poolUri...\n"); #endif status = xmlTextWriterWriteXsAnyURIType(writer, (_rServiPoolType->poolUri)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}poolUri. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}poolUri. status: %i", status); #endif return status; } totalBytes += status; } if (_rServiPoolType->applicationNames != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationNames", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}applicationNames. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}applicationNames...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_rServiPoolType->applicationNames)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}applicationNames. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}applicationNames. status: %i", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive attribute status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "default", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}default. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}default...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, &(_rServiPoolType->_default)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}default. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}default. status: %i", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a RServiPoolType. * * @param _rServiPoolType The RServiPoolType to free. */ static void freeRest_dataRServiPoolTypeType(struct rsb_rest_data_rServiPoolType *_rServiPoolType) { int i; if (_rServiPoolType->poolUri != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor poolUri of type rsb_rest_data_rServiPoolType...\n"); #endif freeXsAnyURIType(_rServiPoolType->poolUri); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor poolUri of type rsb_rest_data_rServiPoolType...\n"); #endif free(_rServiPoolType->poolUri); } if (_rServiPoolType->applicationNames != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor applicationNames of type rsb_rest_data_rServiPoolType...\n"); #endif freeXsStringType(_rServiPoolType->applicationNames); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor applicationNames of type rsb_rest_data_rServiPoolType...\n"); #endif free(_rServiPoolType->applicationNames); } } #endif /* DEF_rsb_rest_data_rServiPoolType_M */ #ifndef DEF_rsb_rest_data_rServiPoolsType_M #define DEF_rsb_rest_data_rServiPoolsType_M /** * Reads a RServiPools element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}rServiPools", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The RServiPools, or NULL in case of error. */ struct rsb_rest_data_rServiPoolsType *xml_read_rsb_rest_data_rServiPoolsType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadRest_dataRServiPoolsElement(reader); } /** * Writes a RServiPools to XML under element name "{http://rest.rsb.openanalytics.eu/types}rServiPools". * * @param writer The XML writer. * @param _rServiPools The RServiPools to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_rest_data_rServiPoolsType(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolsType *_rServiPools) { return xmlTextWriterWriteRest_dataRServiPoolsElementNS(writer, _rServiPools, 1); } /** * Frees a RServiPools. * * @param _rServiPools The RServiPools to free. */ void free_rsb_rest_data_rServiPoolsType(struct rsb_rest_data_rServiPoolsType *_rServiPools) { freeRest_dataRServiPoolsTypeType(_rServiPools); free(_rServiPools); } /** * Reads a RServiPools element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}rServiPools", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The RServiPools, or NULL in case of error. */ struct rsb_rest_data_rServiPoolsType *xmlTextReaderReadRest_dataRServiPoolsElement(xmlTextReaderPtr reader) { struct rsb_rest_data_rServiPoolsType *_rServiPools = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "rServiPools", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://rest.rsb.openanalytics.eu/types}rServiPools.\n"); #endif _rServiPools = xmlTextReaderReadRest_dataRServiPoolsTypeType(reader); } #if DEBUG_ENUNCIATE if (_rServiPools == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}rServiPools failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}rServiPools failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _rServiPools; } /** * Writes a RServiPools to XML under element name "{http://rest.rsb.openanalytics.eu/types}rServiPools". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _rServiPools The RServiPools to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataRServiPoolsElement(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolsType *_rServiPools) { return xmlTextWriterWriteRest_dataRServiPoolsElementNS(writer, _rServiPools, 0); } /** * Writes a RServiPools to XML under element name "{http://rest.rsb.openanalytics.eu/types}rServiPools". * * @param writer The XML writer. * @param _rServiPools The RServiPools to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataRServiPoolsElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolsType *_rServiPools, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "rServiPools", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://rest.rsb.openanalytics.eu/types}rServiPools. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}rServiPools...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:rest_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}rServiPoolsType for root element {http://rest.rsb.openanalytics.eu/types}rServiPools...\n"); #endif status = xmlTextWriterWriteRest_dataRServiPoolsTypeType(writer, _rServiPools); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://rest.rsb.openanalytics.eu/types}rServiPools. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://rest.rsb.openanalytics.eu/types}rServiPools. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a RServiPools. * * @param _rServiPools The RServiPools whose children are to be free. */ static void freeRest_dataRServiPoolsElement(struct rsb_rest_data_rServiPoolsType *_rServiPools) { freeRest_dataRServiPoolsTypeType(_rServiPools); } /** * Reads a RServiPools from XML. The reader is assumed to be at the start element. * * @return the RServiPools, or NULL in case of error. */ static struct rsb_rest_data_rServiPoolsType *xmlTextReaderReadRest_dataRServiPoolsTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_rServiPoolsType *_rServiPools = calloc(1, sizeof(struct rsb_rest_data_rServiPoolsType)); 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 freeRest_dataRServiPoolsTypeType(_rServiPools); free(_rServiPools); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "rServiPool", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://rest.rsb.openanalytics.eu/types}rServiPool of type {http://rest.rsb.openanalytics.eu/types}rServiPoolType.\n"); #endif _child_accessor = xmlTextReaderReadRest_dataRServiPoolTypeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {http://rest.rsb.openanalytics.eu/types}rServiPool of type {http://rest.rsb.openanalytics.eu/types}rServiPoolType.\n"); #endif //panic: unable to read the child element for some reason. freeRest_dataRServiPoolsTypeType(_rServiPools); free(_rServiPools); return NULL; } _rServiPools->contents = realloc(_rServiPools->contents, (_rServiPools->_sizeof_contents + 1) * sizeof(struct rsb_rest_data_rServiPoolType)); memcpy(&(_rServiPools->contents[_rServiPools->_sizeof_contents++]), _child_accessor, sizeof(struct rsb_rest_data_rServiPoolType)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {http://rest.rsb.openanalytics.eu/types}rServiPoolsType. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {http://rest.rsb.openanalytics.eu/types}rServiPoolsType. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _rServiPools; } /** * Writes a RServiPools to XML. * * @param writer The XML writer. * @param _rServiPools The RServiPools to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataRServiPoolsTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_rServiPoolsType *_rServiPools) { int status, totalBytes = 0, i; xmlChar *binaryData; for (i = 0; i < _rServiPools->_sizeof_contents; i++) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "rServiPool", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://rest.rsb.openanalytics.eu/types}rServiPool. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}rServiPoolType for element {http://rest.rsb.openanalytics.eu/types}rServiPool...\n"); #endif status = xmlTextWriterWriteRest_dataRServiPoolTypeType(writer, &(_rServiPools->contents[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://rest.rsb.openanalytics.eu/types}rServiPoolType for element {http://rest.rsb.openanalytics.eu/types}rServiPool. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://rest.rsb.openanalytics.eu/types}rServiPool. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a RServiPools. * * @param _rServiPools The RServiPools to free. */ static void freeRest_dataRServiPoolsTypeType(struct rsb_rest_data_rServiPoolsType *_rServiPools) { int i; if (_rServiPools->contents != NULL) { for (i = 0; i < _rServiPools->_sizeof_contents; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor contents[%i] of type rsb_rest_data_rServiPoolsType...\n", i); #endif freeRest_dataRServiPoolTypeType(&(_rServiPools->contents[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor contents of type rsb_rest_data_rServiPoolsType...\n"); #endif free(_rServiPools->contents); } } #endif /* DEF_rsb_rest_data_rServiPoolsType_M */ #ifndef DEF_rsb_rest_data_resultType_M #define DEF_rsb_rest_data_resultType_M /** * Reads a Result element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}result", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The Result, or NULL in case of error. */ struct rsb_rest_data_resultType *xml_read_rsb_rest_data_resultType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadRest_dataResultElement(reader); } /** * Writes a Result to XML under element name "{http://rest.rsb.openanalytics.eu/types}result". * * @param writer The XML writer. * @param _result The Result to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_rest_data_resultType(xmlTextWriterPtr writer, struct rsb_rest_data_resultType *_result) { return xmlTextWriterWriteRest_dataResultElementNS(writer, _result, 1); } /** * Frees a Result. * * @param _result The Result to free. */ void free_rsb_rest_data_resultType(struct rsb_rest_data_resultType *_result) { freeRest_dataResultTypeType(_result); free(_result); } /** * Reads a Result element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}result", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The Result, or NULL in case of error. */ struct rsb_rest_data_resultType *xmlTextReaderReadRest_dataResultElement(xmlTextReaderPtr reader) { struct rsb_rest_data_resultType *_result = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "result", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://rest.rsb.openanalytics.eu/types}result.\n"); #endif _result = xmlTextReaderReadRest_dataResultTypeType(reader); } #if DEBUG_ENUNCIATE if (_result == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}result failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}result failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _result; } /** * Writes a Result to XML under element name "{http://rest.rsb.openanalytics.eu/types}result". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _result The Result to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataResultElement(xmlTextWriterPtr writer, struct rsb_rest_data_resultType *_result) { return xmlTextWriterWriteRest_dataResultElementNS(writer, _result, 0); } /** * Writes a Result to XML under element name "{http://rest.rsb.openanalytics.eu/types}result". * * @param writer The XML writer. * @param _result The Result to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataResultElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_resultType *_result, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "result", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://rest.rsb.openanalytics.eu/types}result. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}result...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:rest_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}resultType for root element {http://rest.rsb.openanalytics.eu/types}result...\n"); #endif status = xmlTextWriterWriteRest_dataResultTypeType(writer, _result); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://rest.rsb.openanalytics.eu/types}result. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://rest.rsb.openanalytics.eu/types}result. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a Result. * * @param _result The Result whose children are to be free. */ static void freeRest_dataResultElement(struct rsb_rest_data_resultType *_result) { freeRest_dataResultTypeType(_result); } /** * Reads a Result from XML. The reader is assumed to be at the start element. * * @return the Result, or NULL in case of error. */ static struct rsb_rest_data_resultType *xmlTextReaderReadRest_dataResultTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_resultType *_result = calloc(1, sizeof(struct rsb_rest_data_resultType)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "jobId", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}jobId...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}jobId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataResultTypeType(_result); free(_result); return NULL; } _result->jobId = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "applicationName", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}applicationName...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}applicationName of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataResultTypeType(_result); free(_result); return NULL; } _result->applicationName = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "resultTime", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}dateTime from attribute {}resultTime...\n"); #endif _child_accessor = xmlTextReaderReadXsDateTimeType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}resultTime of type {http://www.w3.org/2001/XMLSchema}dateTime.\n"); #endif freeRest_dataResultTypeType(_result); free(_result); return NULL; } _result->resultTime = ((struct tm*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "success", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}boolean from attribute {}success...\n"); #endif _child_accessor = xmlTextReaderReadXsBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}success of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif freeRest_dataResultTypeType(_result); free(_result); return NULL; } _result->success = *((int*)_child_accessor); freeXsBooleanType((int*) _child_accessor); free(_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "type", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}type...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}type of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeRest_dataResultTypeType(_result); free(_result); return NULL; } _result->type = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "selfUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}anyURI from attribute {}selfUri...\n"); #endif _child_accessor = xmlTextReaderReadXsAnyURIType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}selfUri of type {http://www.w3.org/2001/XMLSchema}anyURI.\n"); #endif freeRest_dataResultTypeType(_result); free(_result); return NULL; } _result->selfUri = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "dataUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}anyURI from attribute {}dataUri...\n"); #endif _child_accessor = xmlTextReaderReadXsAnyURIType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}dataUri of type {http://www.w3.org/2001/XMLSchema}anyURI.\n"); #endif freeRest_dataResultTypeType(_result); free(_result); return NULL; } _result->dataUri = ((xmlChar*)_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeRest_dataResultTypeType(_result); free(_result); return NULL; } } return _result; } /** * Writes a Result to XML. * * @param writer The XML writer. * @param _result The Result to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataResultTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_resultType *_result) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_result->jobId != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jobId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}jobId. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}jobId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_result->jobId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}jobId. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}jobId. status: %i", status); #endif return status; } totalBytes += status; } if (_result->applicationName != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationName", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}applicationName. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}applicationName...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_result->applicationName)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}applicationName. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}applicationName. status: %i", status); #endif return status; } totalBytes += status; } if (_result->resultTime != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "resultTime", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}resultTime. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for attribute {}resultTime...\n"); #endif status = xmlTextWriterWriteXsDateTimeType(writer, (_result->resultTime)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for attribute {}resultTime. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}resultTime. status: %i", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive attribute status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "success", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}success. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}success...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, &(_result->success)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}success. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}success. status: %i", status); #endif return status; } totalBytes += status; } if (_result->type != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "type", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}type. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}type...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_result->type)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}type. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}type. status: %i", status); #endif return status; } totalBytes += status; } if (_result->selfUri != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "selfUri", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}selfUri. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}selfUri...\n"); #endif status = xmlTextWriterWriteXsAnyURIType(writer, (_result->selfUri)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}selfUri. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}selfUri. status: %i", status); #endif return status; } totalBytes += status; } if (_result->dataUri != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "dataUri", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}dataUri. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}dataUri...\n"); #endif status = xmlTextWriterWriteXsAnyURIType(writer, (_result->dataUri)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}anyURI for attribute {}dataUri. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}dataUri. status: %i", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a Result. * * @param _result The Result to free. */ static void freeRest_dataResultTypeType(struct rsb_rest_data_resultType *_result) { int i; if (_result->jobId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor jobId of type rsb_rest_data_resultType...\n"); #endif freeXsStringType(_result->jobId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor jobId of type rsb_rest_data_resultType...\n"); #endif free(_result->jobId); } if (_result->applicationName != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor applicationName of type rsb_rest_data_resultType...\n"); #endif freeXsStringType(_result->applicationName); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor applicationName of type rsb_rest_data_resultType...\n"); #endif free(_result->applicationName); } if (_result->resultTime != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor resultTime of type rsb_rest_data_resultType...\n"); #endif freeXsDateTimeType(_result->resultTime); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor resultTime of type rsb_rest_data_resultType...\n"); #endif free(_result->resultTime); } if (_result->type != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor type of type rsb_rest_data_resultType...\n"); #endif freeXsStringType(_result->type); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor type of type rsb_rest_data_resultType...\n"); #endif free(_result->type); } if (_result->selfUri != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor selfUri of type rsb_rest_data_resultType...\n"); #endif freeXsAnyURIType(_result->selfUri); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor selfUri of type rsb_rest_data_resultType...\n"); #endif free(_result->selfUri); } if (_result->dataUri != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor dataUri of type rsb_rest_data_resultType...\n"); #endif freeXsAnyURIType(_result->dataUri); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor dataUri of type rsb_rest_data_resultType...\n"); #endif free(_result->dataUri); } } #endif /* DEF_rsb_rest_data_resultType_M */ #ifndef DEF_rsb_rest_data_resultsType_M #define DEF_rsb_rest_data_resultsType_M /** * Reads a Results element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}results", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The Results, or NULL in case of error. */ struct rsb_rest_data_resultsType *xml_read_rsb_rest_data_resultsType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadRest_dataResultsElement(reader); } /** * Writes a Results to XML under element name "{http://rest.rsb.openanalytics.eu/types}results". * * @param writer The XML writer. * @param _results The Results to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_rest_data_resultsType(xmlTextWriterPtr writer, struct rsb_rest_data_resultsType *_results) { return xmlTextWriterWriteRest_dataResultsElementNS(writer, _results, 1); } /** * Frees a Results. * * @param _results The Results to free. */ void free_rsb_rest_data_resultsType(struct rsb_rest_data_resultsType *_results) { freeRest_dataResultsTypeType(_results); free(_results); } /** * Reads a Results element from XML. The element to be read is "{http://rest.rsb.openanalytics.eu/types}results", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The Results, or NULL in case of error. */ struct rsb_rest_data_resultsType *xmlTextReaderReadRest_dataResultsElement(xmlTextReaderPtr reader) { struct rsb_rest_data_resultsType *_results = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "results", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://rest.rsb.openanalytics.eu/types}results.\n"); #endif _results = xmlTextReaderReadRest_dataResultsTypeType(reader); } #if DEBUG_ENUNCIATE if (_results == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}results failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://rest.rsb.openanalytics.eu/types}results failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _results; } /** * Writes a Results to XML under element name "{http://rest.rsb.openanalytics.eu/types}results". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _results The Results to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataResultsElement(xmlTextWriterPtr writer, struct rsb_rest_data_resultsType *_results) { return xmlTextWriterWriteRest_dataResultsElementNS(writer, _results, 0); } /** * Writes a Results to XML under element name "{http://rest.rsb.openanalytics.eu/types}results". * * @param writer The XML writer. * @param _results The Results to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteRest_dataResultsElementNS(xmlTextWriterPtr writer, struct rsb_rest_data_resultsType *_results, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "results", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://rest.rsb.openanalytics.eu/types}results. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}results...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:rest_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}resultsType for root element {http://rest.rsb.openanalytics.eu/types}results...\n"); #endif status = xmlTextWriterWriteRest_dataResultsTypeType(writer, _results); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://rest.rsb.openanalytics.eu/types}results. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://rest.rsb.openanalytics.eu/types}results. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a Results. * * @param _results The Results whose children are to be free. */ static void freeRest_dataResultsElement(struct rsb_rest_data_resultsType *_results) { freeRest_dataResultsTypeType(_results); } /** * Reads a Results from XML. The reader is assumed to be at the start element. * * @return the Results, or NULL in case of error. */ static struct rsb_rest_data_resultsType *xmlTextReaderReadRest_dataResultsTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_rest_data_resultsType *_results = calloc(1, sizeof(struct rsb_rest_data_resultsType)); 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 freeRest_dataResultsTypeType(_results); free(_results); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "result", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://rest.rsb.openanalytics.eu/types}result of type {http://rest.rsb.openanalytics.eu/types}resultType.\n"); #endif _child_accessor = xmlTextReaderReadRest_dataResultTypeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {http://rest.rsb.openanalytics.eu/types}result of type {http://rest.rsb.openanalytics.eu/types}resultType.\n"); #endif //panic: unable to read the child element for some reason. freeRest_dataResultsTypeType(_results); free(_results); return NULL; } _results->contents = realloc(_results->contents, (_results->_sizeof_contents + 1) * sizeof(struct rsb_rest_data_resultType)); memcpy(&(_results->contents[_results->_sizeof_contents++]), _child_accessor, sizeof(struct rsb_rest_data_resultType)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {http://rest.rsb.openanalytics.eu/types}resultsType. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {http://rest.rsb.openanalytics.eu/types}resultsType. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _results; } /** * Writes a Results to XML. * * @param writer The XML writer. * @param _results The Results to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteRest_dataResultsTypeType(xmlTextWriterPtr writer, struct rsb_rest_data_resultsType *_results) { int status, totalBytes = 0, i; xmlChar *binaryData; for (i = 0; i < _results->_sizeof_contents; i++) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "result", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://rest.rsb.openanalytics.eu/types}result. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://rest.rsb.openanalytics.eu/types}resultType for element {http://rest.rsb.openanalytics.eu/types}result...\n"); #endif status = xmlTextWriterWriteRest_dataResultTypeType(writer, &(_results->contents[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://rest.rsb.openanalytics.eu/types}resultType for element {http://rest.rsb.openanalytics.eu/types}result. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://rest.rsb.openanalytics.eu/types}result. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a Results. * * @param _results The Results to free. */ static void freeRest_dataResultsTypeType(struct rsb_rest_data_resultsType *_results) { int i; if (_results->contents != NULL) { for (i = 0; i < _results->_sizeof_contents; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor contents[%i] of type rsb_rest_data_resultsType...\n", i); #endif freeRest_dataResultTypeType(&(_results->contents[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor contents of type rsb_rest_data_resultsType...\n"); #endif free(_results->contents); } } #endif /* DEF_rsb_rest_data_resultsType_M */ #ifndef DEF_rsb_soap_data_jobType_M #define DEF_rsb_soap_data_jobType_M /** * Reads a JobType element from XML. The element to be read is "{http://soap.rsb.openanalytics.eu/types}job", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The JobType, or NULL in case of error. */ struct rsb_soap_data_jobType *xml_read_rsb_soap_data_jobType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadSoap_dataJobElement(reader); } /** * Writes a JobType to XML under element name "{http://soap.rsb.openanalytics.eu/types}job". * * @param writer The XML writer. * @param _jobType The JobType to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_soap_data_jobType(xmlTextWriterPtr writer, struct rsb_soap_data_jobType *_jobType) { return xmlTextWriterWriteSoap_dataJobElementNS(writer, _jobType, 1); } /** * Frees a JobType. * * @param _jobType The JobType to free. */ void free_rsb_soap_data_jobType(struct rsb_soap_data_jobType *_jobType) { freeSoap_dataJobTypeType(_jobType); free(_jobType); } /** * Reads a JobType element from XML. The element to be read is "{http://soap.rsb.openanalytics.eu/types}job", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The JobType, or NULL in case of error. */ struct rsb_soap_data_jobType *xmlTextReaderReadSoap_dataJobElement(xmlTextReaderPtr reader) { struct rsb_soap_data_jobType *_jobType = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "job", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://soap.rsb.openanalytics.eu/types}job.\n"); #endif _jobType = xmlTextReaderReadSoap_dataJobTypeType(reader); } #if DEBUG_ENUNCIATE if (_jobType == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://soap.rsb.openanalytics.eu/types}job failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://soap.rsb.openanalytics.eu/types}job failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _jobType; } /** * Writes a JobType to XML under element name "{http://soap.rsb.openanalytics.eu/types}job". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _jobType The JobType to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteSoap_dataJobElement(xmlTextWriterPtr writer, struct rsb_soap_data_jobType *_jobType) { return xmlTextWriterWriteSoap_dataJobElementNS(writer, _jobType, 0); } /** * Writes a JobType to XML under element name "{http://soap.rsb.openanalytics.eu/types}job". * * @param writer The XML writer. * @param _jobType The JobType to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteSoap_dataJobElementNS(xmlTextWriterPtr writer, struct rsb_soap_data_jobType *_jobType, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "job", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://soap.rsb.openanalytics.eu/types}job. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://soap.rsb.openanalytics.eu/types}job...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:soap_data", BAD_CAST "http://soap.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:soap_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://soap.rsb.openanalytics.eu/types}jobType for root element {http://soap.rsb.openanalytics.eu/types}job...\n"); #endif status = xmlTextWriterWriteSoap_dataJobTypeType(writer, _jobType); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://soap.rsb.openanalytics.eu/types}job. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://soap.rsb.openanalytics.eu/types}job. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a JobType. * * @param _jobType The JobType whose children are to be free. */ static void freeSoap_dataJobElement(struct rsb_soap_data_jobType *_jobType) { freeSoap_dataJobTypeType(_jobType); } /** * Reads a JobType from XML. The reader is assumed to be at the start element. * * @return the JobType, or NULL in case of error. */ static struct rsb_soap_data_jobType *xmlTextReaderReadSoap_dataJobTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_soap_data_jobType *_jobType = calloc(1, sizeof(struct rsb_soap_data_jobType)); 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 freeSoap_dataJobTypeType(_jobType); free(_jobType); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "applicationName", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://soap.rsb.openanalytics.eu/types}applicationName 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 {http://soap.rsb.openanalytics.eu/types}applicationName of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeSoap_dataJobTypeType(_jobType); free(_jobType); return NULL; } _jobType->applicationName = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "parameter", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://soap.rsb.openanalytics.eu/types}parameter of type {http://soap.rsb.openanalytics.eu/types}.\n"); #endif _child_accessor = xmlTextReaderReadSoap_dataAnonymousParameterType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {http://soap.rsb.openanalytics.eu/types}parameter of type {http://soap.rsb.openanalytics.eu/types}.\n"); #endif //panic: unable to read the child element for some reason. freeSoap_dataJobTypeType(_jobType); free(_jobType); return NULL; } _jobType->parameter = realloc(_jobType->parameter, (_jobType->_sizeof_parameter + 1) * sizeof(struct rsb_soap_data_anonymous_parameter)); memcpy(&(_jobType->parameter[_jobType->_sizeof_parameter++]), _child_accessor, sizeof(struct rsb_soap_data_anonymous_parameter)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "payload", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://soap.rsb.openanalytics.eu/types}payload of type {http://soap.rsb.openanalytics.eu/types}payloadType.\n"); #endif _child_accessor = xmlTextReaderReadSoap_dataPayloadTypeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {http://soap.rsb.openanalytics.eu/types}payload of type {http://soap.rsb.openanalytics.eu/types}payloadType.\n"); #endif //panic: unable to read the child element for some reason. freeSoap_dataJobTypeType(_jobType); free(_jobType); return NULL; } _jobType->payload = realloc(_jobType->payload, (_jobType->_sizeof_payload + 1) * sizeof(struct rsb_soap_data_payloadType)); memcpy(&(_jobType->payload[_jobType->_sizeof_payload++]), _child_accessor, sizeof(struct rsb_soap_data_payloadType)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {http://soap.rsb.openanalytics.eu/types}jobType. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {http://soap.rsb.openanalytics.eu/types}jobType. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _jobType; } /** * Writes a JobType to XML. * * @param writer The XML writer. * @param _jobType The JobType to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteSoap_dataJobTypeType(xmlTextWriterPtr writer, struct rsb_soap_data_jobType *_jobType) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_jobType->applicationName != NULL) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "applicationName", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://soap.rsb.openanalytics.eu/types}applicationName. 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 {http://soap.rsb.openanalytics.eu/types}applicationName...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_jobType->applicationName)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {http://soap.rsb.openanalytics.eu/types}applicationName. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://soap.rsb.openanalytics.eu/types}applicationName. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _jobType->_sizeof_parameter; i++) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "parameter", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://soap.rsb.openanalytics.eu/types}parameter. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://soap.rsb.openanalytics.eu/types} for element {http://soap.rsb.openanalytics.eu/types}parameter...\n"); #endif status = xmlTextWriterWriteSoap_dataAnonymousParameterType(writer, &(_jobType->parameter[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://soap.rsb.openanalytics.eu/types} for element {http://soap.rsb.openanalytics.eu/types}parameter. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://soap.rsb.openanalytics.eu/types}parameter. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _jobType->_sizeof_payload; i++) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "payload", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://soap.rsb.openanalytics.eu/types}payload. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://soap.rsb.openanalytics.eu/types}payloadType for element {http://soap.rsb.openanalytics.eu/types}payload...\n"); #endif status = xmlTextWriterWriteSoap_dataPayloadTypeType(writer, &(_jobType->payload[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://soap.rsb.openanalytics.eu/types}payloadType for element {http://soap.rsb.openanalytics.eu/types}payload. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://soap.rsb.openanalytics.eu/types}payload. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a JobType. * * @param _jobType The JobType to free. */ static void freeSoap_dataJobTypeType(struct rsb_soap_data_jobType *_jobType) { int i; if (_jobType->applicationName != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor applicationName of type rsb_soap_data_jobType...\n"); #endif freeXsStringType(_jobType->applicationName); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor applicationName of type rsb_soap_data_jobType...\n"); #endif free(_jobType->applicationName); } if (_jobType->parameter != NULL) { for (i = 0; i < _jobType->_sizeof_parameter; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor parameter[%i] of type rsb_soap_data_jobType...\n", i); #endif freeSoap_dataAnonymousParameterType(&(_jobType->parameter[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor parameter of type rsb_soap_data_jobType...\n"); #endif free(_jobType->parameter); } if (_jobType->payload != NULL) { for (i = 0; i < _jobType->_sizeof_payload; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor payload[%i] of type rsb_soap_data_jobType...\n", i); #endif freeSoap_dataPayloadTypeType(&(_jobType->payload[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor payload of type rsb_soap_data_jobType...\n"); #endif free(_jobType->payload); } } #endif /* DEF_rsb_soap_data_jobType_M */ #ifndef DEF_rsb_soap_data_anonymous_parameter_M #define DEF_rsb_soap_data_anonymous_parameter_M /** * Reads a Parameter from XML. The reader is assumed to be at the start element. * * @return the Parameter, or NULL in case of error. */ static struct rsb_soap_data_anonymous_parameter *xmlTextReaderReadSoap_dataAnonymousParameterType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_soap_data_anonymous_parameter *_parameter = calloc(1, sizeof(struct rsb_soap_data_anonymous_parameter)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}name...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeSoap_dataAnonymousParameterType(_parameter); free(_parameter); return NULL; } _parameter->name = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "value", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}value...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}value of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeSoap_dataAnonymousParameterType(_parameter); free(_parameter); return NULL; } _parameter->value = ((xmlChar*)_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeSoap_dataAnonymousParameterType(_parameter); free(_parameter); return NULL; } } return _parameter; } /** * Writes a Parameter to XML. * * @param writer The XML writer. * @param _parameter The Parameter to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteSoap_dataAnonymousParameterType(xmlTextWriterPtr writer, struct rsb_soap_data_anonymous_parameter *_parameter) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_parameter->name != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}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 attribute {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_parameter->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}name. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}name. status: %i", status); #endif return status; } totalBytes += status; } if (_parameter->value != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "value", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}value. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}value...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_parameter->value)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}value. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}value. status: %i", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a Parameter. * * @param _parameter The Parameter to free. */ static void freeSoap_dataAnonymousParameterType(struct rsb_soap_data_anonymous_parameter *_parameter) { int i; if (_parameter->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type rsb_soap_data_anonymous_parameter...\n"); #endif freeXsStringType(_parameter->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type rsb_soap_data_anonymous_parameter...\n"); #endif free(_parameter->name); } if (_parameter->value != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor value of type rsb_soap_data_anonymous_parameter...\n"); #endif freeXsStringType(_parameter->value); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor value of type rsb_soap_data_anonymous_parameter...\n"); #endif free(_parameter->value); } } #endif /* DEF_rsb_soap_data_anonymous_parameter_M */ #ifndef DEF_rsb_soap_data_payloadType_M #define DEF_rsb_soap_data_payloadType_M /** * Reads a PayloadType from XML. The reader is assumed to be at the start element. * * @return the PayloadType, or NULL in case of error. */ static struct rsb_soap_data_payloadType *xmlTextReaderReadSoap_dataPayloadTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_soap_data_payloadType *_payloadType = calloc(1, sizeof(struct rsb_soap_data_payloadType)); if (xmlTextReaderHasAttributes(reader)) { while (xmlTextReaderMoveToNextAttribute(reader)) { if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}name...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}name of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeSoap_dataPayloadTypeType(_payloadType); free(_payloadType); return NULL; } _payloadType->name = ((xmlChar*)_child_accessor); continue; } if ((xmlStrcmp(BAD_CAST "contentType", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}contentType...\n"); #endif _child_accessor = xmlTextReaderReadXsStringType(reader); if (_child_accessor == NULL) { //panic: unable to return the attribute value for some reason. #if DEBUG_ENUNCIATE printf("Failed to read attribute {}contentType of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif freeSoap_dataPayloadTypeType(_payloadType); free(_payloadType); return NULL; } _payloadType->contentType = ((xmlChar*)_child_accessor); continue; } } status = xmlTextReaderMoveToElement(reader); if (status < 1) { //panic: unable to return to the element node. #if DEBUG_ENUNCIATE printf("Unable to return to element node from attributes.\n"); #endif freeSoap_dataPayloadTypeType(_payloadType); free(_payloadType); return NULL; } } 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 freeSoap_dataPayloadTypeType(_payloadType); free(_payloadType); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "data", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read binary data of choice {http://soap.rsb.openanalytics.eu/types}data.\n"); #endif _child_accessor = xmlTextReaderReadEntireNodeValue(reader); _payloadType->data = _decode_base64((xmlChar *) _child_accessor, &(_payloadType->_sizeof_data)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {http://soap.rsb.openanalytics.eu/types}payloadType. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {http://soap.rsb.openanalytics.eu/types}payloadType. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _payloadType; } /** * Writes a PayloadType to XML. * * @param writer The XML writer. * @param _payloadType The PayloadType to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteSoap_dataPayloadTypeType(xmlTextWriterPtr writer, struct rsb_soap_data_payloadType *_payloadType) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_payloadType->name != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}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 attribute {}name...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_payloadType->name)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}name. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}name. status: %i", status); #endif return status; } totalBytes += status; } if (_payloadType->contentType != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "contentType", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start attribute {}contentType. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}contentType...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_payloadType->contentType)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}contentType. status: %i", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndAttribute(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end attribute {}contentType. status: %i", status); #endif return status; } totalBytes += status; } if (_payloadType->data != NULL) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "data", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://soap.rsb.openanalytics.eu/types}data. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing binary data for element {http://soap.rsb.openanalytics.eu/types}data...\n"); #endif binaryData = _encode_base64(_payloadType->data, _payloadType->_sizeof_data); status = xmlTextWriterWriteString(writer, binaryData); free(binaryData); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write binary data for element {http://soap.rsb.openanalytics.eu/types}data. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://soap.rsb.openanalytics.eu/types}data. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a PayloadType. * * @param _payloadType The PayloadType to free. */ static void freeSoap_dataPayloadTypeType(struct rsb_soap_data_payloadType *_payloadType) { int i; if (_payloadType->name != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor name of type rsb_soap_data_payloadType...\n"); #endif freeXsStringType(_payloadType->name); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor name of type rsb_soap_data_payloadType...\n"); #endif free(_payloadType->name); } if (_payloadType->contentType != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor contentType of type rsb_soap_data_payloadType...\n"); #endif freeXsStringType(_payloadType->contentType); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor contentType of type rsb_soap_data_payloadType...\n"); #endif free(_payloadType->contentType); } if (_payloadType->data != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor data of type rsb_soap_data_payloadType...\n"); #endif free(_payloadType->data); } } #endif /* DEF_rsb_soap_data_payloadType_M */ #ifndef DEF_rsb_soap_data_resultType_M #define DEF_rsb_soap_data_resultType_M /** * Reads a ResultType element from XML. The element to be read is "{http://soap.rsb.openanalytics.eu/types}result", and * it is assumed that the reader is pointing to the XML document (not the element). * * @param reader The XML reader. * @return The ResultType, or NULL in case of error. */ struct rsb_soap_data_resultType *xml_read_rsb_soap_data_resultType(xmlTextReaderPtr reader) { int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); return xmlTextReaderReadSoap_dataResultElement(reader); } /** * Writes a ResultType to XML under element name "{http://soap.rsb.openanalytics.eu/types}result". * * @param writer The XML writer. * @param _resultType The ResultType to write. * @return 1 if successful, 0 otherwise. */ int xml_write_rsb_soap_data_resultType(xmlTextWriterPtr writer, struct rsb_soap_data_resultType *_resultType) { return xmlTextWriterWriteSoap_dataResultElementNS(writer, _resultType, 1); } /** * Frees a ResultType. * * @param _resultType The ResultType to free. */ void free_rsb_soap_data_resultType(struct rsb_soap_data_resultType *_resultType) { freeSoap_dataResultTypeType(_resultType); free(_resultType); } /** * Reads a ResultType element from XML. The element to be read is "{http://soap.rsb.openanalytics.eu/types}result", and * it is assumed that the reader is pointing to that element. * * @param reader The XML reader. * @return The ResultType, or NULL in case of error. */ struct rsb_soap_data_resultType *xmlTextReaderReadSoap_dataResultElement(xmlTextReaderPtr reader) { struct rsb_soap_data_resultType *_resultType = NULL; if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "result", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read root element {http://soap.rsb.openanalytics.eu/types}result.\n"); #endif _resultType = xmlTextReaderReadSoap_dataResultTypeType(reader); } #if DEBUG_ENUNCIATE if (_resultType == NULL) { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("attempt to read {http://soap.rsb.openanalytics.eu/types}result failed. current element: {}%s\n", xmlTextReaderConstLocalName(reader)); } else { printf("attempt to read {http://soap.rsb.openanalytics.eu/types}result failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } } #endif return _resultType; } /** * Writes a ResultType to XML under element name "{http://soap.rsb.openanalytics.eu/types}result". * Does NOT write the namespace prefixes. * * @param writer The XML writer. * @param _resultType The ResultType to write. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteSoap_dataResultElement(xmlTextWriterPtr writer, struct rsb_soap_data_resultType *_resultType) { return xmlTextWriterWriteSoap_dataResultElementNS(writer, _resultType, 0); } /** * Writes a ResultType to XML under element name "{http://soap.rsb.openanalytics.eu/types}result". * * @param writer The XML writer. * @param _resultType The ResultType to write. * @param writeNamespaces Whether to write the namespace prefixes. * @return 1 if successful, 0 otherwise. */ static int xmlTextWriterWriteSoap_dataResultElementNS(xmlTextWriterPtr writer, struct rsb_soap_data_resultType *_resultType, int writeNamespaces) { int totalBytes = 0; int status; status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "result", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write start element {http://soap.rsb.openanalytics.eu/types}result. status: %i\n", status); #endif return status; } totalBytes += status; if (writeNamespaces) { #if DEBUG_ENUNCIATE > 1 printf("writing namespaces for start element {http://soap.rsb.openanalytics.eu/types}result...\n"); #endif status = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:soap_data", BAD_CAST "http://soap.rsb.openanalytics.eu/types"); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write namespace attribute xmlns:soap_data. status: %i\n", status); #endif return status; } totalBytes += status; } #if DEBUG_ENUNCIATE > 1 printf("writing type {http://soap.rsb.openanalytics.eu/types}resultType for root element {http://soap.rsb.openanalytics.eu/types}result...\n"); #endif status = xmlTextWriterWriteSoap_dataResultTypeType(writer, _resultType); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to write type for start element {http://soap.rsb.openanalytics.eu/types}result. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("unable to end element {http://soap.rsb.openanalytics.eu/types}result. status: %i\n", status); #endif return status; } totalBytes += status; return totalBytes; } /** * Frees the children of a ResultType. * * @param _resultType The ResultType whose children are to be free. */ static void freeSoap_dataResultElement(struct rsb_soap_data_resultType *_resultType) { freeSoap_dataResultTypeType(_resultType); } /** * Reads a ResultType from XML. The reader is assumed to be at the start element. * * @return the ResultType, or NULL in case of error. */ static struct rsb_soap_data_resultType *xmlTextReaderReadSoap_dataResultTypeType(xmlTextReaderPtr reader) { int status, depth; void *_child_accessor; struct rsb_soap_data_resultType *_resultType = calloc(1, sizeof(struct rsb_soap_data_resultType)); 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 freeSoap_dataResultTypeType(_resultType); free(_resultType); return NULL; } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "applicationName", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://soap.rsb.openanalytics.eu/types}applicationName 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 {http://soap.rsb.openanalytics.eu/types}applicationName of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeSoap_dataResultTypeType(_resultType); free(_resultType); return NULL; } _resultType->applicationName = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "jobId", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://soap.rsb.openanalytics.eu/types}jobId 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 {http://soap.rsb.openanalytics.eu/types}jobId of type {http://www.w3.org/2001/XMLSchema}string.\n"); #endif //panic: unable to read the child element for some reason. freeSoap_dataResultTypeType(_resultType); free(_resultType); return NULL; } _resultType->jobId = ((xmlChar*)_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "success", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://soap.rsb.openanalytics.eu/types}success 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 {http://soap.rsb.openanalytics.eu/types}success of type {http://www.w3.org/2001/XMLSchema}boolean.\n"); #endif //panic: unable to read the child element for some reason. freeSoap_dataResultTypeType(_resultType); free(_resultType); return NULL; } _resultType->success = *((int*)_child_accessor); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "payload", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 printf("Attempting to read choice {http://soap.rsb.openanalytics.eu/types}payload of type {http://soap.rsb.openanalytics.eu/types}payloadType.\n"); #endif _child_accessor = xmlTextReaderReadSoap_dataPayloadTypeType(reader); if (_child_accessor == NULL) { #if DEBUG_ENUNCIATE printf("Failed to read choice {http://soap.rsb.openanalytics.eu/types}payload of type {http://soap.rsb.openanalytics.eu/types}payloadType.\n"); #endif //panic: unable to read the child element for some reason. freeSoap_dataResultTypeType(_resultType); free(_resultType); return NULL; } _resultType->payload = realloc(_resultType->payload, (_resultType->_sizeof_payload + 1) * sizeof(struct rsb_soap_data_payloadType)); memcpy(&(_resultType->payload[_resultType->_sizeof_payload++]), _child_accessor, sizeof(struct rsb_soap_data_payloadType)); free(_child_accessor); status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); } else { #if DEBUG_ENUNCIATE > 1 if (xmlTextReaderConstNamespaceUri(reader) == NULL) { printf("unknown child element {}%s for type {http://soap.rsb.openanalytics.eu/types}resultType. Skipping...\n", xmlTextReaderConstLocalName(reader)); } else { printf("unknown child element {%s}%s for type {http://soap.rsb.openanalytics.eu/types}resultType. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)); } #endif status = xmlTextReaderSkipElement(reader); } } } return _resultType; } /** * Writes a ResultType to XML. * * @param writer The XML writer. * @param _resultType The ResultType to write. * @return The total bytes written, or -1 on error; */ static int xmlTextWriterWriteSoap_dataResultTypeType(xmlTextWriterPtr writer, struct rsb_soap_data_resultType *_resultType) { int status, totalBytes = 0, i; xmlChar *binaryData; if (_resultType->applicationName != NULL) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "applicationName", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://soap.rsb.openanalytics.eu/types}applicationName. 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 {http://soap.rsb.openanalytics.eu/types}applicationName...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_resultType->applicationName)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {http://soap.rsb.openanalytics.eu/types}applicationName. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://soap.rsb.openanalytics.eu/types}applicationName. status: %i\n", status); #endif return status; } totalBytes += status; } if (_resultType->jobId != NULL) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "jobId", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://soap.rsb.openanalytics.eu/types}jobId. 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 {http://soap.rsb.openanalytics.eu/types}jobId...\n"); #endif status = xmlTextWriterWriteXsStringType(writer, (_resultType->jobId)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {http://soap.rsb.openanalytics.eu/types}jobId. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://soap.rsb.openanalytics.eu/types}jobId. status: %i\n", status); #endif return status; } totalBytes += status; } if (1) { //always write the primitive element. status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "success", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://soap.rsb.openanalytics.eu/types}success. 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 {http://soap.rsb.openanalytics.eu/types}success...\n"); #endif status = xmlTextWriterWriteXsBooleanType(writer, &(_resultType->success)); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for element {http://soap.rsb.openanalytics.eu/types}success. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://soap.rsb.openanalytics.eu/types}success. status: %i\n", status); #endif return status; } totalBytes += status; } for (i = 0; i < _resultType->_sizeof_payload; i++) { status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "payload", NULL); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write start element {http://soap.rsb.openanalytics.eu/types}payload. status: %i\n", status); #endif return status; } totalBytes += status; #if DEBUG_ENUNCIATE > 1 printf("writing type {http://soap.rsb.openanalytics.eu/types}payloadType for element {http://soap.rsb.openanalytics.eu/types}payload...\n"); #endif status = xmlTextWriterWriteSoap_dataPayloadTypeType(writer, &(_resultType->payload[i])); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write type {http://soap.rsb.openanalytics.eu/types}payloadType for element {http://soap.rsb.openanalytics.eu/types}payload. status: %i\n", status); #endif return status; } totalBytes += status; status = xmlTextWriterEndElement(writer); if (status < 0) { #if DEBUG_ENUNCIATE printf("Failed to write end element {http://soap.rsb.openanalytics.eu/types}payload. status: %i\n", status); #endif return status; } totalBytes += status; } return totalBytes; } /** * Frees the elements of a ResultType. * * @param _resultType The ResultType to free. */ static void freeSoap_dataResultTypeType(struct rsb_soap_data_resultType *_resultType) { int i; if (_resultType->applicationName != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor applicationName of type rsb_soap_data_resultType...\n"); #endif freeXsStringType(_resultType->applicationName); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor applicationName of type rsb_soap_data_resultType...\n"); #endif free(_resultType->applicationName); } if (_resultType->jobId != NULL) { #if DEBUG_ENUNCIATE > 1 printf("Freeing type of accessor jobId of type rsb_soap_data_resultType...\n"); #endif freeXsStringType(_resultType->jobId); #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor jobId of type rsb_soap_data_resultType...\n"); #endif free(_resultType->jobId); } if (_resultType->payload != NULL) { for (i = 0; i < _resultType->_sizeof_payload; i++) { #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor payload[%i] of type rsb_soap_data_resultType...\n", i); #endif freeSoap_dataPayloadTypeType(&(_resultType->payload[i])); } #if DEBUG_ENUNCIATE > 1 printf("Freeing accessor payload of type rsb_soap_data_resultType...\n"); #endif free(_resultType->payload); } } #endif /* DEF_rsb_soap_data_resultType_M */