#import "rsb.h"
#ifndef DEF_RSBREST_DATACatalogFileType_M
#define DEF_RSBREST_DATACatalogFileType_M

/**
 *  <p>Java class for catalogFileType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="catalogFileType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="dataUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATACatalogFileType

/**
 * (no documentation provided)
 */
- (NSString *) name
{
  return _name;
}

/**
 * (no documentation provided)
 */
- (void) setName: (NSString *) newName
{
  [newName retain];
  [_name release];
  _name = newName;
}

/**
 * (no documentation provided)
 */
- (NSString *) dataUri
{
  return _dataUri;
}

/**
 * (no documentation provided)
 */
- (void) setDataUri: (NSString *) newDataUri
{
  [newDataUri retain];
  [_dataUri release];
  _dataUri = newDataUri;
}

- (void) dealloc
{
  [self setName: nil];
  [self setDataUri: nil];
  [super dealloc];
}
@end /* implementation RSBREST_DATACatalogFileType */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATACatalogFileType (JAXB) <JAXBReading, JAXBWriting, JAXBType>

@end /*interface RSBREST_DATACatalogFileType (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATACatalogFileType (JAXB)

/**
 * Read an instance of RSBREST_DATACatalogFileType from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATACatalogFileType defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATACatalogFileType *_rSBREST_DATACatalogFileType = [[RSBREST_DATACatalogFileType alloc] init];
  NS_DURING
  {
    [_rSBREST_DATACatalogFileType initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATACatalogFileType = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATACatalogFileType autorelease];
  return _rSBREST_DATACatalogFileType;
}

/**
 * Initialize this instance of RSBREST_DATACatalogFileType according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATACatalogFileType to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}name...");
#endif
    [self setName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}name...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "dataUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}dataUri...");
#endif
    [self setDataUri: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}dataUri...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self name]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}name."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}name...");
#endif
    [[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}name...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}name."];
    }
  }
  if ([self dataUri]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "dataUri", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}dataUri."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}dataUri...");
#endif
    [[self dataUri] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}dataUri...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}dataUri."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

}
@end /* implementation RSBREST_DATACatalogFileType (JAXB) */

#endif /* DEF_RSBREST_DATACatalogFileType_M */
#ifndef DEF_RSBREST_DATAErrorResult_M
#define DEF_RSBREST_DATAErrorResult_M

/**
 *  <p>Java class for errorResultType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="errorResultType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;sequence>
         &lt;element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string"/>
       &lt;/sequence>
       &lt;attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="applicationName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="submissionTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATAErrorResult

/**
 * (no documentation provided)
 */
- (NSString *) jobId
{
  return _jobId;
}

/**
 * (no documentation provided)
 */
- (void) setJobId: (NSString *) newJobId
{
  [newJobId retain];
  [_jobId release];
  _jobId = newJobId;
}

/**
 * (no documentation provided)
 */
- (NSString *) applicationName
{
  return _applicationName;
}

/**
 * (no documentation provided)
 */
- (void) setApplicationName: (NSString *) newApplicationName
{
  [newApplicationName retain];
  [_applicationName release];
  _applicationName = newApplicationName;
}

/**
 * (no documentation provided)
 */
- (NSCalendarDate *) submissionTime
{
  return _submissionTime;
}

/**
 * (no documentation provided)
 */
- (void) setSubmissionTime: (NSCalendarDate *) newSubmissionTime
{
  [newSubmissionTime retain];
  [_submissionTime release];
  _submissionTime = newSubmissionTime;
}

/**
 * (no documentation provided)
 */
- (NSString *) errorMessage
{
  return _errorMessage;
}

/**
 * (no documentation provided)
 */
- (void) setErrorMessage: (NSString *) newErrorMessage
{
  [newErrorMessage retain];
  [_errorMessage release];
  _errorMessage = newErrorMessage;
}

- (void) dealloc
{
  [self setJobId: nil];
  [self setApplicationName: nil];
  [self setSubmissionTime: nil];
  [self setErrorMessage: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBREST_DATAErrorResult *_rSBREST_DATAErrorResult;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBREST_DATAErrorResult = (RSBREST_DATAErrorResult *) [RSBREST_DATAErrorResult readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBREST_DATAErrorResult;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBREST_DATAErrorResult */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATAErrorResult (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBREST_DATAErrorResult (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATAErrorResult (JAXB)

/**
 * Read an instance of RSBREST_DATAErrorResult from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATAErrorResult defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATAErrorResult *_rSBREST_DATAErrorResult = [[RSBREST_DATAErrorResult alloc] init];
  NS_DURING
  {
    [_rSBREST_DATAErrorResult initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATAErrorResult = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATAErrorResult autorelease];
  return _rSBREST_DATAErrorResult;
}

/**
 * Initialize this instance of RSBREST_DATAErrorResult according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATAErrorResult to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBREST_DATAErrorResult from an XML reader. The element to be read is
 * "{http://rest.rsb.openanalytics.eu/types}errorResult".
 *
 * @param reader The XML reader.
 * @return The RSBREST_DATAErrorResult.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBREST_DATAErrorResult *_errorResult = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://rest.rsb.openanalytics.eu/types}errorResult."];
    }
  }

  if (xmlStrcmp(BAD_CAST "errorResult", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://rest.rsb.openanalytics.eu/types}errorResult.");
#endif
    _errorResult = (RSBREST_DATAErrorResult *)[RSBREST_DATAErrorResult readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://rest.rsb.openanalytics.eu/types}errorResult.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATAErrorResult. Expected element {http://rest.rsb.openanalytics.eu/types}errorResult. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATAErrorResult. Expected element {http://rest.rsb.openanalytics.eu/types}errorResult. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _errorResult;
}

/**
 * Writes this RSBREST_DATAErrorResult to XML under element name "{http://rest.rsb.openanalytics.eu/types}errorResult".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _errorResult The ErrorResult to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBREST_DATAErrorResult to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "errorResult", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://rest.rsb.openanalytics.eu/types}errorResult. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}errorResult...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:rest_data' on '{http://rest.rsb.openanalytics.eu/types}errorResult'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://rest.rsb.openanalytics.eu/types}errorResult...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://rest.rsb.openanalytics.eu/types}errorResultType for root element {http://rest.rsb.openanalytics.eu/types}errorResult...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://rest.rsb.openanalytics.eu/types}errorResultType for root element {http://rest.rsb.openanalytics.eu/types}errorResult...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://rest.rsb.openanalytics.eu/types}errorResult. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "jobId", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}jobId...");
#endif
    [self setJobId: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}jobId...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "applicationName", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}applicationName...");
#endif
    [self setApplicationName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}applicationName...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "submissionTime", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}submissionTime...");
#endif
    [self setSubmissionTime: (NSCalendarDate*) [NSCalendarDate readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}submissionTime...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://rest.rsb.openanalytics.eu/types}errorMessage of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
    __child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://rest.rsb.openanalytics.eu/types}errorMessage of type {http://www.w3.org/2001/XMLSchema}string.");
#endif

    [self setErrorMessage: __child];
    return YES;
  } //end "if choice"


  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self jobId]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jobId", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}jobId."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}jobId...");
#endif
    [[self jobId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}jobId...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}jobId."];
    }
  }
  if ([self applicationName]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationName", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}applicationName."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}applicationName...");
#endif
    [[self applicationName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}applicationName...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}applicationName."];
    }
  }
  if ([self submissionTime]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "submissionTime", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}submissionTime."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}submissionTime...");
#endif
    [[self submissionTime] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}submissionTime...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}submissionTime."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

  if ([self errorMessage]) {
    status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "errorMessage", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start child element {http://rest.rsb.openanalytics.eu/types}errorMessage."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing element {http://rest.rsb.openanalytics.eu/types}errorMessage...");
#endif
    [[self errorMessage] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote element {http://rest.rsb.openanalytics.eu/types}errorMessage...");
#endif

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end child element {http://rest.rsb.openanalytics.eu/types}errorMessage."];
    }
  }
}
@end /* implementation RSBREST_DATAErrorResult (JAXB) */

#endif /* DEF_RSBREST_DATAErrorResult_M */
#ifndef DEF_RSBREST_DATAJobToken_M
#define DEF_RSBREST_DATAJobToken_M

/**
 *  <p>Java class for jobTokenType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="jobTokenType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="applicationName" use="required" type="{http://rsb.openanalytics.eu/types}applicationNameType" />
       &lt;attribute name="submissionTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
       &lt;attribute name="applicationResultsUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
       &lt;attribute name="resultUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATAJobToken

/**
 * (no documentation provided)
 */
- (NSString *) jobId
{
  return _jobId;
}

/**
 * (no documentation provided)
 */
- (void) setJobId: (NSString *) newJobId
{
  [newJobId retain];
  [_jobId release];
  _jobId = newJobId;
}

/**
 * (no documentation provided)
 */
- (NSString *) applicationName
{
  return _applicationName;
}

/**
 * (no documentation provided)
 */
- (void) setApplicationName: (NSString *) newApplicationName
{
  [newApplicationName retain];
  [_applicationName release];
  _applicationName = newApplicationName;
}

/**
 * (no documentation provided)
 */
- (NSCalendarDate *) submissionTime
{
  return _submissionTime;
}

/**
 * (no documentation provided)
 */
- (void) setSubmissionTime: (NSCalendarDate *) newSubmissionTime
{
  [newSubmissionTime retain];
  [_submissionTime release];
  _submissionTime = newSubmissionTime;
}

/**
 * (no documentation provided)
 */
- (NSString *) applicationResultsUri
{
  return _applicationResultsUri;
}

/**
 * (no documentation provided)
 */
- (void) setApplicationResultsUri: (NSString *) newApplicationResultsUri
{
  [newApplicationResultsUri retain];
  [_applicationResultsUri release];
  _applicationResultsUri = newApplicationResultsUri;
}

/**
 * (no documentation provided)
 */
- (NSString *) resultUri
{
  return _resultUri;
}

/**
 * (no documentation provided)
 */
- (void) setResultUri: (NSString *) newResultUri
{
  [newResultUri retain];
  [_resultUri release];
  _resultUri = newResultUri;
}

- (void) dealloc
{
  [self setJobId: nil];
  [self setApplicationName: nil];
  [self setSubmissionTime: nil];
  [self setApplicationResultsUri: nil];
  [self setResultUri: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBREST_DATAJobToken *_rSBREST_DATAJobToken;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBREST_DATAJobToken = (RSBREST_DATAJobToken *) [RSBREST_DATAJobToken readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBREST_DATAJobToken;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBREST_DATAJobToken */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATAJobToken (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBREST_DATAJobToken (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATAJobToken (JAXB)

/**
 * Read an instance of RSBREST_DATAJobToken from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATAJobToken defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATAJobToken *_rSBREST_DATAJobToken = [[RSBREST_DATAJobToken alloc] init];
  NS_DURING
  {
    [_rSBREST_DATAJobToken initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATAJobToken = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATAJobToken autorelease];
  return _rSBREST_DATAJobToken;
}

/**
 * Initialize this instance of RSBREST_DATAJobToken according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATAJobToken to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBREST_DATAJobToken from an XML reader. The element to be read is
 * "{http://rest.rsb.openanalytics.eu/types}jobToken".
 *
 * @param reader The XML reader.
 * @return The RSBREST_DATAJobToken.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBREST_DATAJobToken *_jobToken = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://rest.rsb.openanalytics.eu/types}jobToken."];
    }
  }

  if (xmlStrcmp(BAD_CAST "jobToken", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://rest.rsb.openanalytics.eu/types}jobToken.");
#endif
    _jobToken = (RSBREST_DATAJobToken *)[RSBREST_DATAJobToken readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://rest.rsb.openanalytics.eu/types}jobToken.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATAJobToken. Expected element {http://rest.rsb.openanalytics.eu/types}jobToken. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATAJobToken. Expected element {http://rest.rsb.openanalytics.eu/types}jobToken. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _jobToken;
}

/**
 * Writes this RSBREST_DATAJobToken to XML under element name "{http://rest.rsb.openanalytics.eu/types}jobToken".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _jobToken The JobToken to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBREST_DATAJobToken to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "jobToken", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://rest.rsb.openanalytics.eu/types}jobToken. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}jobToken...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:rest_data' on '{http://rest.rsb.openanalytics.eu/types}jobToken'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://rest.rsb.openanalytics.eu/types}jobToken...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://rest.rsb.openanalytics.eu/types}jobTokenType for root element {http://rest.rsb.openanalytics.eu/types}jobToken...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://rest.rsb.openanalytics.eu/types}jobTokenType for root element {http://rest.rsb.openanalytics.eu/types}jobToken...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://rest.rsb.openanalytics.eu/types}jobToken. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "jobId", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}jobId...");
#endif
    [self setJobId: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}jobId...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "applicationName", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}applicationName...");
#endif
    [self setApplicationName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}applicationName...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "submissionTime", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}submissionTime...");
#endif
    [self setSubmissionTime: (NSCalendarDate*) [NSCalendarDate readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}submissionTime...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "applicationResultsUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}applicationResultsUri...");
#endif
    [self setApplicationResultsUri: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}applicationResultsUri...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "resultUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}resultUri...");
#endif
    [self setResultUri: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}resultUri...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self jobId]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jobId", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}jobId."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}jobId...");
#endif
    [[self jobId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}jobId...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}jobId."];
    }
  }
  if ([self applicationName]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationName", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}applicationName."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}applicationName...");
#endif
    [[self applicationName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}applicationName...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}applicationName."];
    }
  }
  if ([self submissionTime]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "submissionTime", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}submissionTime."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}submissionTime...");
#endif
    [[self submissionTime] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}submissionTime...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}submissionTime."];
    }
  }
  if ([self applicationResultsUri]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationResultsUri", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}applicationResultsUri."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}applicationResultsUri...");
#endif
    [[self applicationResultsUri] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}applicationResultsUri...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}applicationResultsUri."];
    }
  }
  if ([self resultUri]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "resultUri", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}resultUri."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}resultUri...");
#endif
    [[self resultUri] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}resultUri...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}resultUri."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

}
@end /* implementation RSBREST_DATAJobToken (JAXB) */

#endif /* DEF_RSBREST_DATAJobToken_M */
#ifndef DEF_RSBREST_DATARServiPoolType_M
#define DEF_RSBREST_DATARServiPoolType_M

/**
 *  <p>Java class for rServiPoolType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="rServiPoolType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;attribute name="poolUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
       &lt;attribute name="applicationNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="default" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATARServiPoolType

/**
 * (no documentation provided)
 */
- (NSString *) poolUri
{
  return _poolUri;
}

/**
 * (no documentation provided)
 */
- (void) setPoolUri: (NSString *) newPoolUri
{
  [newPoolUri retain];
  [_poolUri release];
  _poolUri = newPoolUri;
}

/**
 * (no documentation provided)
 */
- (NSString *) applicationNames
{
  return _applicationNames;
}

/**
 * (no documentation provided)
 */
- (void) setApplicationNames: (NSString *) newApplicationNames
{
  [newApplicationNames retain];
  [_applicationNames release];
  _applicationNames = newApplicationNames;
}

/**
 * (no documentation provided)
 */
- (BOOL) _default
{
  return __default;
}

/**
 * (no documentation provided)
 */
- (void) set_default: (BOOL) new_default
{
  __default = new_default;
}

- (void) dealloc
{
  [self setPoolUri: nil];
  [self setApplicationNames: nil];
  [super dealloc];
}
@end /* implementation RSBREST_DATARServiPoolType */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATARServiPoolType (JAXB) <JAXBReading, JAXBWriting, JAXBType>

@end /*interface RSBREST_DATARServiPoolType (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATARServiPoolType (JAXB)

/**
 * Read an instance of RSBREST_DATARServiPoolType from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATARServiPoolType defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATARServiPoolType *_rSBREST_DATARServiPoolType = [[RSBREST_DATARServiPoolType alloc] init];
  NS_DURING
  {
    [_rSBREST_DATARServiPoolType initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATARServiPoolType = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATARServiPoolType autorelease];
  return _rSBREST_DATARServiPoolType;
}

/**
 * Initialize this instance of RSBREST_DATARServiPoolType according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATARServiPoolType to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "poolUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}poolUri...");
#endif
    [self setPoolUri: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}poolUri...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "applicationNames", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}applicationNames...");
#endif
    [self setApplicationNames: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}applicationNames...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "default", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}default...");
#endif
    _child_accessor = xmlTextReaderReadBooleanType(reader);
    if (_child_accessor == NULL) {
      //panic: unable to read the attribute value for some reason.
      [NSException raise: @"XMLReadError"
                   format: @"Error reading attribute {}default."];
    }
    [self set_default: *((BOOL*) _child_accessor)];
    free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}default...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self poolUri]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "poolUri", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}poolUri."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}poolUri...");
#endif
    [[self poolUri] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}poolUri...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}poolUri."];
    }
  }
  if ([self applicationNames]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationNames", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}applicationNames."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}applicationNames...");
#endif
    [[self applicationNames] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}applicationNames...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}applicationNames."];
    }
  }
  if (YES) { //always write the primitive attributes...

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "default", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}default."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}default...");
#endif
    status = xmlTextWriterWriteBooleanType(writer, &__default);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute {}default."];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}default...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}default."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

}
@end /* implementation RSBREST_DATARServiPoolType (JAXB) */

#endif /* DEF_RSBREST_DATARServiPoolType_M */
#ifndef DEF_RSBREST_DATAResult_M
#define DEF_RSBREST_DATAResult_M

/**
 *  <p>Java class for resultType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="resultType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="applicationName" use="required" type="{http://rsb.openanalytics.eu/types}applicationNameType" />
       &lt;attribute name="resultTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
       &lt;attribute name="success" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="selfUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
       &lt;attribute name="dataUri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATAResult

/**
 * (no documentation provided)
 */
- (NSString *) jobId
{
  return _jobId;
}

/**
 * (no documentation provided)
 */
- (void) setJobId: (NSString *) newJobId
{
  [newJobId retain];
  [_jobId release];
  _jobId = newJobId;
}

/**
 * (no documentation provided)
 */
- (NSString *) applicationName
{
  return _applicationName;
}

/**
 * (no documentation provided)
 */
- (void) setApplicationName: (NSString *) newApplicationName
{
  [newApplicationName retain];
  [_applicationName release];
  _applicationName = newApplicationName;
}

/**
 * (no documentation provided)
 */
- (NSCalendarDate *) resultTime
{
  return _resultTime;
}

/**
 * (no documentation provided)
 */
- (void) setResultTime: (NSCalendarDate *) newResultTime
{
  [newResultTime retain];
  [_resultTime release];
  _resultTime = newResultTime;
}

/**
 * (no documentation provided)
 */
- (BOOL) success
{
  return _success;
}

/**
 * (no documentation provided)
 */
- (void) setSuccess: (BOOL) newSuccess
{
  _success = newSuccess;
}

/**
 * (no documentation provided)
 */
- (NSString *) type
{
  return _type;
}

/**
 * (no documentation provided)
 */
- (void) setType: (NSString *) newType
{
  [newType retain];
  [_type release];
  _type = newType;
}

/**
 * (no documentation provided)
 */
- (NSString *) selfUri
{
  return _selfUri;
}

/**
 * (no documentation provided)
 */
- (void) setSelfUri: (NSString *) newSelfUri
{
  [newSelfUri retain];
  [_selfUri release];
  _selfUri = newSelfUri;
}

/**
 * (no documentation provided)
 */
- (NSString *) dataUri
{
  return _dataUri;
}

/**
 * (no documentation provided)
 */
- (void) setDataUri: (NSString *) newDataUri
{
  [newDataUri retain];
  [_dataUri release];
  _dataUri = newDataUri;
}

- (void) dealloc
{
  [self setJobId: nil];
  [self setApplicationName: nil];
  [self setResultTime: nil];
  [self setType: nil];
  [self setSelfUri: nil];
  [self setDataUri: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBREST_DATAResult *_rSBREST_DATAResult;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBREST_DATAResult = (RSBREST_DATAResult *) [RSBREST_DATAResult readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBREST_DATAResult;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBREST_DATAResult */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATAResult (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBREST_DATAResult (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATAResult (JAXB)

/**
 * Read an instance of RSBREST_DATAResult from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATAResult defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATAResult *_rSBREST_DATAResult = [[RSBREST_DATAResult alloc] init];
  NS_DURING
  {
    [_rSBREST_DATAResult initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATAResult = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATAResult autorelease];
  return _rSBREST_DATAResult;
}

/**
 * Initialize this instance of RSBREST_DATAResult according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATAResult to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBREST_DATAResult from an XML reader. The element to be read is
 * "{http://rest.rsb.openanalytics.eu/types}result".
 *
 * @param reader The XML reader.
 * @return The RSBREST_DATAResult.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBREST_DATAResult *_result = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://rest.rsb.openanalytics.eu/types}result."];
    }
  }

  if (xmlStrcmp(BAD_CAST "result", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://rest.rsb.openanalytics.eu/types}result.");
#endif
    _result = (RSBREST_DATAResult *)[RSBREST_DATAResult readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://rest.rsb.openanalytics.eu/types}result.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATAResult. Expected element {http://rest.rsb.openanalytics.eu/types}result. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATAResult. Expected element {http://rest.rsb.openanalytics.eu/types}result. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _result;
}

/**
 * Writes this RSBREST_DATAResult to XML under element name "{http://rest.rsb.openanalytics.eu/types}result".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _result The Result to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBREST_DATAResult to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "result", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://rest.rsb.openanalytics.eu/types}result. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}result...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:rest_data' on '{http://rest.rsb.openanalytics.eu/types}result'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://rest.rsb.openanalytics.eu/types}result...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://rest.rsb.openanalytics.eu/types}resultType for root element {http://rest.rsb.openanalytics.eu/types}result...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://rest.rsb.openanalytics.eu/types}resultType for root element {http://rest.rsb.openanalytics.eu/types}result...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://rest.rsb.openanalytics.eu/types}result. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "jobId", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}jobId...");
#endif
    [self setJobId: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}jobId...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "applicationName", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}applicationName...");
#endif
    [self setApplicationName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}applicationName...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "resultTime", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}resultTime...");
#endif
    [self setResultTime: (NSCalendarDate*) [NSCalendarDate readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}resultTime...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "success", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}success...");
#endif
    _child_accessor = xmlTextReaderReadBooleanType(reader);
    if (_child_accessor == NULL) {
      //panic: unable to read the attribute value for some reason.
      [NSException raise: @"XMLReadError"
                   format: @"Error reading attribute {}success."];
    }
    [self setSuccess: *((BOOL*) _child_accessor)];
    free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}success...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "type", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}type...");
#endif
    [self setType: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}type...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "selfUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}selfUri...");
#endif
    [self setSelfUri: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}selfUri...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "dataUri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}dataUri...");
#endif
    [self setDataUri: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}dataUri...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self jobId]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jobId", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}jobId."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}jobId...");
#endif
    [[self jobId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}jobId...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}jobId."];
    }
  }
  if ([self applicationName]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "applicationName", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}applicationName."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}applicationName...");
#endif
    [[self applicationName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}applicationName...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}applicationName."];
    }
  }
  if ([self resultTime]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "resultTime", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}resultTime."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}resultTime...");
#endif
    [[self resultTime] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}resultTime...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}resultTime."];
    }
  }
  if (YES) { //always write the primitive attributes...

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "success", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}success."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}success...");
#endif
    status = xmlTextWriterWriteBooleanType(writer, &_success);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute {}success."];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}success...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}success."];
    }
  }
  if ([self type]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "type", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}type."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}type...");
#endif
    [[self type] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}type...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}type."];
    }
  }
  if ([self selfUri]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "selfUri", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}selfUri."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}selfUri...");
#endif
    [[self selfUri] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}selfUri...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}selfUri."];
    }
  }
  if ([self dataUri]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "dataUri", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}dataUri."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}dataUri...");
#endif
    [[self dataUri] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}dataUri...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}dataUri."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

}
@end /* implementation RSBREST_DATAResult (JAXB) */

#endif /* DEF_RSBREST_DATAResult_M */
#ifndef DEF_RSBSOAP_DATAJobType_M
#define DEF_RSBSOAP_DATAJobType_M

/**
 *  <p>Java class for jobType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="jobType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;sequence>
         &lt;element name="applicationName" type="{http://rsb.openanalytics.eu/types}applicationNameType"/>
         &lt;element name="parameter" maxOccurs="unbounded" minOccurs="0">
           &lt;complexType>
             &lt;complexContent>
               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
                 &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
                 &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
               &lt;/restriction>
             &lt;/complexContent>
           &lt;/complexType>
         &lt;/element>
         &lt;element name="payload" type="{http://soap.rsb.openanalytics.eu/types}payloadType" maxOccurs="unbounded"/>
       &lt;/sequence>
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBSOAP_DATAJobType

/**
 * (no documentation provided)
 */
- (NSString *) applicationName
{
  return _applicationName;
}

/**
 * (no documentation provided)
 */
- (void) setApplicationName: (NSString *) newApplicationName
{
  [newApplicationName retain];
  [_applicationName release];
  _applicationName = newApplicationName;
}

/**
 * (no documentation provided)
 */
- (NSArray *) parameter
{
  return _parameter;
}

/**
 * (no documentation provided)
 */
- (void) setParameter: (NSArray *) newParameter
{
  [newParameter retain];
  [_parameter release];
  _parameter = newParameter;
}

/**
 * (no documentation provided)
 */
- (NSArray *) payload
{
  return _payload;
}

/**
 * (no documentation provided)
 */
- (void) setPayload: (NSArray *) newPayload
{
  [newPayload retain];
  [_payload release];
  _payload = newPayload;
}

- (void) dealloc
{
  [self setApplicationName: nil];
  [self setParameter: nil];
  [self setPayload: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBSOAP_DATAJobType *_rSBSOAP_DATAJobType;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBSOAP_DATAJobType = (RSBSOAP_DATAJobType *) [RSBSOAP_DATAJobType readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBSOAP_DATAJobType;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBSOAP_DATAJobType */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBSOAP_DATAJobType (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBSOAP_DATAJobType (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBSOAP_DATAJobType (JAXB)

/**
 * Read an instance of RSBSOAP_DATAJobType from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBSOAP_DATAJobType defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBSOAP_DATAJobType *_rSBSOAP_DATAJobType = [[RSBSOAP_DATAJobType alloc] init];
  NS_DURING
  {
    [_rSBSOAP_DATAJobType initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBSOAP_DATAJobType = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBSOAP_DATAJobType autorelease];
  return _rSBSOAP_DATAJobType;
}

/**
 * Initialize this instance of RSBSOAP_DATAJobType according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBSOAP_DATAJobType to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBSOAP_DATAJobType from an XML reader. The element to be read is
 * "{http://soap.rsb.openanalytics.eu/types}job".
 *
 * @param reader The XML reader.
 * @return The RSBSOAP_DATAJobType.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBSOAP_DATAJobType *_jobType = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://soap.rsb.openanalytics.eu/types}job."];
    }
  }

  if (xmlStrcmp(BAD_CAST "job", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://soap.rsb.openanalytics.eu/types}job.");
#endif
    _jobType = (RSBSOAP_DATAJobType *)[RSBSOAP_DATAJobType readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://soap.rsb.openanalytics.eu/types}job.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBSOAP_DATAJobType. Expected element {http://soap.rsb.openanalytics.eu/types}job. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBSOAP_DATAJobType. Expected element {http://soap.rsb.openanalytics.eu/types}job. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _jobType;
}

/**
 * Writes this RSBSOAP_DATAJobType to XML under element name "{http://soap.rsb.openanalytics.eu/types}job".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _jobType The JobType to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBSOAP_DATAJobType to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "job", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://soap.rsb.openanalytics.eu/types}job. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://soap.rsb.openanalytics.eu/types}job...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:soap_data", BAD_CAST "http://soap.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:soap_data' on '{http://soap.rsb.openanalytics.eu/types}job'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://soap.rsb.openanalytics.eu/types}job...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://soap.rsb.openanalytics.eu/types}jobType for root element {http://soap.rsb.openanalytics.eu/types}job...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://soap.rsb.openanalytics.eu/types}jobType for root element {http://soap.rsb.openanalytics.eu/types}job...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://soap.rsb.openanalytics.eu/types}job. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://soap.rsb.openanalytics.eu/types}applicationName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
    __child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://soap.rsb.openanalytics.eu/types}applicationName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif

    [self setApplicationName: __child];
    return YES;
  } //end "if choice"

  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
    NSLog(@"Attempting to read choice {http://soap.rsb.openanalytics.eu/types}parameter of type {http://soap.rsb.openanalytics.eu/types}.");
#endif

     __child = [RSBSOAP_DATAParameter readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://soap.rsb.openanalytics.eu/types}parameter of type {http://soap.rsb.openanalytics.eu/types}.");
#endif

    if ([self parameter]) {
      [self setParameter: [[self parameter] arrayByAddingObject: __child]];
    }
    else {
      [self setParameter: [NSArray arrayWithObject: __child]];
    }
    return YES;
  } //end "if choice"

  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
    NSLog(@"Attempting to read choice {http://soap.rsb.openanalytics.eu/types}payload of type {http://soap.rsb.openanalytics.eu/types}payloadType.");
#endif

     __child = [RSBSOAP_DATAPayloadType readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://soap.rsb.openanalytics.eu/types}payload of type {http://soap.rsb.openanalytics.eu/types}payloadType.");
#endif

    if ([self payload]) {
      [self setPayload: [[self payload] arrayByAddingObject: __child]];
    }
    else {
      [self setPayload: [NSArray arrayWithObject: __child]];
    }
    return YES;
  } //end "if choice"


  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

  if ([self applicationName]) {
    status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "applicationName", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start child element {http://soap.rsb.openanalytics.eu/types}applicationName."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing element {http://soap.rsb.openanalytics.eu/types}applicationName...");
#endif
    [[self applicationName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote element {http://soap.rsb.openanalytics.eu/types}applicationName...");
#endif

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end child element {http://soap.rsb.openanalytics.eu/types}applicationName."];
    }
  }
  if ([self parameter]) {
    __enumerator = [[self parameter] objectEnumerator];

    while ( (__item = [__enumerator nextObject]) ) {
      status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "parameter", NULL);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing start child element {http://soap.rsb.openanalytics.eu/types}parameter."];
      }

#if DEBUG_ENUNCIATE > 1
      NSLog(@"writing element {http://soap.rsb.openanalytics.eu/types}parameter...");
#endif
      [__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
      NSLog(@"successfully wrote element {http://soap.rsb.openanalytics.eu/types}parameter...");
#endif

      status = xmlTextWriterEndElement(writer);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing end child element {http://soap.rsb.openanalytics.eu/types}parameter."];
      }
    } //end item iterator.
  }
  if ([self payload]) {
    __enumerator = [[self payload] objectEnumerator];

    while ( (__item = [__enumerator nextObject]) ) {
      status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "payload", NULL);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing start child element {http://soap.rsb.openanalytics.eu/types}payload."];
      }

#if DEBUG_ENUNCIATE > 1
      NSLog(@"writing element {http://soap.rsb.openanalytics.eu/types}payload...");
#endif
      [__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
      NSLog(@"successfully wrote element {http://soap.rsb.openanalytics.eu/types}payload...");
#endif

      status = xmlTextWriterEndElement(writer);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing end child element {http://soap.rsb.openanalytics.eu/types}payload."];
      }
    } //end item iterator.
  }
}
@end /* implementation RSBSOAP_DATAJobType (JAXB) */

#endif /* DEF_RSBSOAP_DATAJobType_M */
#ifndef DEF_RSBSOAP_DATAPayloadType_M
#define DEF_RSBSOAP_DATAPayloadType_M

/**
 *  <p>Java class for payloadType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="payloadType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;sequence>
         &lt;element name="data" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
       &lt;/sequence>
       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="contentType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBSOAP_DATAPayloadType

/**
 * (no documentation provided)
 */
- (NSString *) name
{
  return _name;
}

/**
 * (no documentation provided)
 */
- (void) setName: (NSString *) newName
{
  [newName retain];
  [_name release];
  _name = newName;
}

/**
 * (no documentation provided)
 */
- (NSString *) contentType
{
  return _contentType;
}

/**
 * (no documentation provided)
 */
- (void) setContentType: (NSString *) newContentType
{
  [newContentType retain];
  [_contentType release];
  _contentType = newContentType;
}

/**
 * (no documentation provided)
 */
- (NSData *) data
{
  return _data;
}

/**
 * (no documentation provided)
 */
- (void) setData: (NSData *) newData
{
  [newData retain];
  [_data release];
  _data = newData;
}

- (void) dealloc
{
  [self setName: nil];
  [self setContentType: nil];
  [self setData: nil];
  [super dealloc];
}
@end /* implementation RSBSOAP_DATAPayloadType */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBSOAP_DATAPayloadType (JAXB) <JAXBReading, JAXBWriting, JAXBType>

@end /*interface RSBSOAP_DATAPayloadType (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBSOAP_DATAPayloadType (JAXB)

/**
 * Read an instance of RSBSOAP_DATAPayloadType from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBSOAP_DATAPayloadType defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBSOAP_DATAPayloadType *_rSBSOAP_DATAPayloadType = [[RSBSOAP_DATAPayloadType alloc] init];
  NS_DURING
  {
    [_rSBSOAP_DATAPayloadType initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBSOAP_DATAPayloadType = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBSOAP_DATAPayloadType autorelease];
  return _rSBSOAP_DATAPayloadType;
}

/**
 * Initialize this instance of RSBSOAP_DATAPayloadType according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBSOAP_DATAPayloadType to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}name...");
#endif
    [self setName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}name...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "contentType", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}contentType...");
#endif
    [self setContentType: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}contentType...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://soap.rsb.openanalytics.eu/types}data of type {http://www.w3.org/2001/XMLSchema}base64Binary.");
#endif
    __child = [NSData readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://soap.rsb.openanalytics.eu/types}data of type {http://www.w3.org/2001/XMLSchema}base64Binary.");
#endif

    [self setData: __child];
    return YES;
  } //end "if choice"


  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self name]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}name."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}name...");
#endif
    [[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}name...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}name."];
    }
  }
  if ([self contentType]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "contentType", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}contentType."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}contentType...");
#endif
    [[self contentType] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}contentType...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}contentType."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

  if ([self data]) {
    status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "data", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start child element {http://soap.rsb.openanalytics.eu/types}data."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing element {http://soap.rsb.openanalytics.eu/types}data...");
#endif
    [[self data] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote element {http://soap.rsb.openanalytics.eu/types}data...");
#endif

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end child element {http://soap.rsb.openanalytics.eu/types}data."];
    }
  }
}
@end /* implementation RSBSOAP_DATAPayloadType (JAXB) */

#endif /* DEF_RSBSOAP_DATAPayloadType_M */
#ifndef DEF_RSBSOAP_DATAResultType_M
#define DEF_RSBSOAP_DATAResultType_M

/**
 *  <p>Java class for resultType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="resultType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;sequence>
         &lt;element name="applicationName" type="{http://rsb.openanalytics.eu/types}applicationNameType"/>
         &lt;element name="jobId" type="{http://www.w3.org/2001/XMLSchema}string"/>
         &lt;element name="success" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
         &lt;element name="payload" type="{http://soap.rsb.openanalytics.eu/types}payloadType" maxOccurs="unbounded"/>
       &lt;/sequence>
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBSOAP_DATAResultType

/**
 * (no documentation provided)
 */
- (NSString *) applicationName
{
  return _applicationName;
}

/**
 * (no documentation provided)
 */
- (void) setApplicationName: (NSString *) newApplicationName
{
  [newApplicationName retain];
  [_applicationName release];
  _applicationName = newApplicationName;
}

/**
 * (no documentation provided)
 */
- (NSString *) jobId
{
  return _jobId;
}

/**
 * (no documentation provided)
 */
- (void) setJobId: (NSString *) newJobId
{
  [newJobId retain];
  [_jobId release];
  _jobId = newJobId;
}

/**
 * (no documentation provided)
 */
- (BOOL) success
{
  return _success;
}

/**
 * (no documentation provided)
 */
- (void) setSuccess: (BOOL) newSuccess
{
  _success = newSuccess;
}

/**
 * (no documentation provided)
 */
- (NSArray *) payload
{
  return _payload;
}

/**
 * (no documentation provided)
 */
- (void) setPayload: (NSArray *) newPayload
{
  [newPayload retain];
  [_payload release];
  _payload = newPayload;
}

- (void) dealloc
{
  [self setApplicationName: nil];
  [self setJobId: nil];
  [self setPayload: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBSOAP_DATAResultType *_rSBSOAP_DATAResultType;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBSOAP_DATAResultType = (RSBSOAP_DATAResultType *) [RSBSOAP_DATAResultType readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBSOAP_DATAResultType;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBSOAP_DATAResultType */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBSOAP_DATAResultType (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBSOAP_DATAResultType (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBSOAP_DATAResultType (JAXB)

/**
 * Read an instance of RSBSOAP_DATAResultType from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBSOAP_DATAResultType defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBSOAP_DATAResultType *_rSBSOAP_DATAResultType = [[RSBSOAP_DATAResultType alloc] init];
  NS_DURING
  {
    [_rSBSOAP_DATAResultType initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBSOAP_DATAResultType = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBSOAP_DATAResultType autorelease];
  return _rSBSOAP_DATAResultType;
}

/**
 * Initialize this instance of RSBSOAP_DATAResultType according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBSOAP_DATAResultType to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBSOAP_DATAResultType from an XML reader. The element to be read is
 * "{http://soap.rsb.openanalytics.eu/types}result".
 *
 * @param reader The XML reader.
 * @return The RSBSOAP_DATAResultType.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBSOAP_DATAResultType *_resultType = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://soap.rsb.openanalytics.eu/types}result."];
    }
  }

  if (xmlStrcmp(BAD_CAST "result", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://soap.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://soap.rsb.openanalytics.eu/types}result.");
#endif
    _resultType = (RSBSOAP_DATAResultType *)[RSBSOAP_DATAResultType readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://soap.rsb.openanalytics.eu/types}result.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBSOAP_DATAResultType. Expected element {http://soap.rsb.openanalytics.eu/types}result. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBSOAP_DATAResultType. Expected element {http://soap.rsb.openanalytics.eu/types}result. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _resultType;
}

/**
 * Writes this RSBSOAP_DATAResultType to XML under element name "{http://soap.rsb.openanalytics.eu/types}result".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _resultType The ResultType to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBSOAP_DATAResultType to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "result", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://soap.rsb.openanalytics.eu/types}result. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://soap.rsb.openanalytics.eu/types}result...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:soap_data", BAD_CAST "http://soap.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:soap_data' on '{http://soap.rsb.openanalytics.eu/types}result'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://soap.rsb.openanalytics.eu/types}result...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://soap.rsb.openanalytics.eu/types}resultType for root element {http://soap.rsb.openanalytics.eu/types}result...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://soap.rsb.openanalytics.eu/types}resultType for root element {http://soap.rsb.openanalytics.eu/types}result...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://soap.rsb.openanalytics.eu/types}result. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://soap.rsb.openanalytics.eu/types}applicationName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
    __child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://soap.rsb.openanalytics.eu/types}applicationName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif

    [self setApplicationName: __child];
    return YES;
  } //end "if choice"

  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
    NSLog(@"Attempting to read choice {http://soap.rsb.openanalytics.eu/types}jobId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
    __child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://soap.rsb.openanalytics.eu/types}jobId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif

    [self setJobId: __child];
    return YES;
  } //end "if choice"


  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) {

    _child_accessor = xmlTextReaderReadBooleanType(reader);
    if (_child_accessor == NULL) {
      //panic: unable to return the value for some reason.
      [NSException raise: @"XMLReadError"
                   format: @"Error reading element value."];
    }
    [self setSuccess: *((BOOL*) _child_accessor)];
    free(_child_accessor);
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://soap.rsb.openanalytics.eu/types}payload of type {http://soap.rsb.openanalytics.eu/types}payloadType.");
#endif

     __child = [RSBSOAP_DATAPayloadType readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://soap.rsb.openanalytics.eu/types}payload of type {http://soap.rsb.openanalytics.eu/types}payloadType.");
#endif

    if ([self payload]) {
      [self setPayload: [[self payload] arrayByAddingObject: __child]];
    }
    else {
      [self setPayload: [NSArray arrayWithObject: __child]];
    }
    return YES;
  } //end "if choice"


  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

  if ([self applicationName]) {
    status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "applicationName", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start child element {http://soap.rsb.openanalytics.eu/types}applicationName."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing element {http://soap.rsb.openanalytics.eu/types}applicationName...");
#endif
    [[self applicationName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote element {http://soap.rsb.openanalytics.eu/types}applicationName...");
#endif

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end child element {http://soap.rsb.openanalytics.eu/types}applicationName."];
    }
  }
  if ([self jobId]) {
    status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "jobId", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start child element {http://soap.rsb.openanalytics.eu/types}jobId."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing element {http://soap.rsb.openanalytics.eu/types}jobId...");
#endif
    [[self jobId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote element {http://soap.rsb.openanalytics.eu/types}jobId...");
#endif

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end child element {http://soap.rsb.openanalytics.eu/types}jobId."];
    }
  }
  if (YES) { //always write the primitive element...
    status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "success", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start child element {http://soap.rsb.openanalytics.eu/types}success."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing element {http://soap.rsb.openanalytics.eu/types}success...");
#endif
    status = xmlTextWriterWriteBooleanType(writer, &_success);
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote element {http://soap.rsb.openanalytics.eu/types}success...");
#endif
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing child element {http://soap.rsb.openanalytics.eu/types}success."];
    }

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end child element {http://soap.rsb.openanalytics.eu/types}success."];
    }
  }
  if ([self payload]) {
    __enumerator = [[self payload] objectEnumerator];

    while ( (__item = [__enumerator nextObject]) ) {
      status = xmlTextWriterStartElementNS(writer, BAD_CAST "soap_data", BAD_CAST "payload", NULL);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing start child element {http://soap.rsb.openanalytics.eu/types}payload."];
      }

#if DEBUG_ENUNCIATE > 1
      NSLog(@"writing element {http://soap.rsb.openanalytics.eu/types}payload...");
#endif
      [__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
      NSLog(@"successfully wrote element {http://soap.rsb.openanalytics.eu/types}payload...");
#endif

      status = xmlTextWriterEndElement(writer);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing end child element {http://soap.rsb.openanalytics.eu/types}payload."];
      }
    } //end item iterator.
  }
}
@end /* implementation RSBSOAP_DATAResultType (JAXB) */

#endif /* DEF_RSBSOAP_DATAResultType_M */
#ifndef DEF_RSBSOAP_DATAParameter_M
#define DEF_RSBSOAP_DATAParameter_M

/**
 *  <p>Java class for anonymous complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType>
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBSOAP_DATAParameter

/**
 * (no documentation provided)
 */
- (NSString *) name
{
  return _name;
}

/**
 * (no documentation provided)
 */
- (void) setName: (NSString *) newName
{
  [newName retain];
  [_name release];
  _name = newName;
}

/**
 * (no documentation provided)
 */
- (NSString *) value
{
  return _value;
}

/**
 * (no documentation provided)
 */
- (void) setValue: (NSString *) newValue
{
  [newValue retain];
  [_value release];
  _value = newValue;
}

- (void) dealloc
{
  [self setName: nil];
  [self setValue: nil];
  [super dealloc];
}
@end /* implementation RSBSOAP_DATAParameter */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBSOAP_DATAParameter (JAXB) <JAXBReading, JAXBWriting, JAXBType>

@end /*interface RSBSOAP_DATAParameter (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBSOAP_DATAParameter (JAXB)

/**
 * Read an instance of RSBSOAP_DATAParameter from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBSOAP_DATAParameter defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBSOAP_DATAParameter *_rSBSOAP_DATAParameter = [[RSBSOAP_DATAParameter alloc] init];
  NS_DURING
  {
    [_rSBSOAP_DATAParameter initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBSOAP_DATAParameter = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBSOAP_DATAParameter autorelease];
  return _rSBSOAP_DATAParameter;
}

/**
 * Initialize this instance of RSBSOAP_DATAParameter according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBSOAP_DATAParameter to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}name...");
#endif
    [self setName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}name...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "value", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}value...");
#endif
    [self setValue: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}value...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self name]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}name."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}name...");
#endif
    [[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}name...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}name."];
    }
  }
  if ([self value]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "value", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}value."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}value...");
#endif
    [[self value] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}value...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}value."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

}
@end /* implementation RSBSOAP_DATAParameter (JAXB) */

#endif /* DEF_RSBSOAP_DATAParameter_M */
#ifndef DEF_RSBREST_DATAResults_M
#define DEF_RSBREST_DATAResults_M

/**
 *  <p>Java class for resultsType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="resultsType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;sequence>
         &lt;element name="result" type="{http://rest.rsb.openanalytics.eu/types}resultType" maxOccurs="unbounded" minOccurs="0"/>
       &lt;/sequence>
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATAResults

/**
 * (no documentation provided)
 */
- (NSArray *) contents
{
  return _contents;
}

/**
 * (no documentation provided)
 */
- (void) setContents: (NSArray *) newContents
{
  [newContents retain];
  [_contents release];
  _contents = newContents;
}

- (void) dealloc
{
  [self setContents: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBREST_DATAResults *_rSBREST_DATAResults;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBREST_DATAResults = (RSBREST_DATAResults *) [RSBREST_DATAResults readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBREST_DATAResults;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBREST_DATAResults */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATAResults (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBREST_DATAResults (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATAResults (JAXB)

/**
 * Read an instance of RSBREST_DATAResults from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATAResults defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATAResults *_rSBREST_DATAResults = [[RSBREST_DATAResults alloc] init];
  NS_DURING
  {
    [_rSBREST_DATAResults initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATAResults = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATAResults autorelease];
  return _rSBREST_DATAResults;
}

/**
 * Initialize this instance of RSBREST_DATAResults according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATAResults to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBREST_DATAResults from an XML reader. The element to be read is
 * "{http://rest.rsb.openanalytics.eu/types}results".
 *
 * @param reader The XML reader.
 * @return The RSBREST_DATAResults.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBREST_DATAResults *_results = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://rest.rsb.openanalytics.eu/types}results."];
    }
  }

  if (xmlStrcmp(BAD_CAST "results", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://rest.rsb.openanalytics.eu/types}results.");
#endif
    _results = (RSBREST_DATAResults *)[RSBREST_DATAResults readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://rest.rsb.openanalytics.eu/types}results.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATAResults. Expected element {http://rest.rsb.openanalytics.eu/types}results. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATAResults. Expected element {http://rest.rsb.openanalytics.eu/types}results. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _results;
}

/**
 * Writes this RSBREST_DATAResults to XML under element name "{http://rest.rsb.openanalytics.eu/types}results".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _results The Results to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBREST_DATAResults to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "results", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://rest.rsb.openanalytics.eu/types}results. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}results...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:rest_data' on '{http://rest.rsb.openanalytics.eu/types}results'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://rest.rsb.openanalytics.eu/types}results...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://rest.rsb.openanalytics.eu/types}resultsType for root element {http://rest.rsb.openanalytics.eu/types}results...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://rest.rsb.openanalytics.eu/types}resultsType for root element {http://rest.rsb.openanalytics.eu/types}results...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://rest.rsb.openanalytics.eu/types}results. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://rest.rsb.openanalytics.eu/types}result of type {http://rest.rsb.openanalytics.eu/types}resultType.");
#endif

     __child = [RSBREST_DATAResult readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://rest.rsb.openanalytics.eu/types}result of type {http://rest.rsb.openanalytics.eu/types}resultType.");
#endif

    if ([self contents]) {
      [self setContents: [[self contents] arrayByAddingObject: __child]];
    }
    else {
      [self setContents: [NSArray arrayWithObject: __child]];
    }
    return YES;
  } //end "if choice"


  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

  if ([self contents]) {
    __enumerator = [[self contents] objectEnumerator];

    while ( (__item = [__enumerator nextObject]) ) {
      status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "result", NULL);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing start child element {http://rest.rsb.openanalytics.eu/types}result."];
      }

#if DEBUG_ENUNCIATE > 1
      NSLog(@"writing element {http://rest.rsb.openanalytics.eu/types}result...");
#endif
      [__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
      NSLog(@"successfully wrote element {http://rest.rsb.openanalytics.eu/types}result...");
#endif

      status = xmlTextWriterEndElement(writer);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing end child element {http://rest.rsb.openanalytics.eu/types}result."];
      }
    } //end item iterator.
  }
}
@end /* implementation RSBREST_DATAResults (JAXB) */

#endif /* DEF_RSBREST_DATAResults_M */
#ifndef DEF_RSBREST_DATARServiPools_M
#define DEF_RSBREST_DATARServiPools_M

/**
 *  <p>Java class for rServiPoolsType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="rServiPoolsType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;sequence>
         &lt;element name="rServiPool" type="{http://rest.rsb.openanalytics.eu/types}rServiPoolType" maxOccurs="unbounded"/>
       &lt;/sequence>
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATARServiPools

/**
 * (no documentation provided)
 */
- (NSArray *) contents
{
  return _contents;
}

/**
 * (no documentation provided)
 */
- (void) setContents: (NSArray *) newContents
{
  [newContents retain];
  [_contents release];
  _contents = newContents;
}

- (void) dealloc
{
  [self setContents: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBREST_DATARServiPools *_rSBREST_DATARServiPools;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBREST_DATARServiPools = (RSBREST_DATARServiPools *) [RSBREST_DATARServiPools readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBREST_DATARServiPools;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBREST_DATARServiPools */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATARServiPools (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBREST_DATARServiPools (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATARServiPools (JAXB)

/**
 * Read an instance of RSBREST_DATARServiPools from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATARServiPools defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATARServiPools *_rSBREST_DATARServiPools = [[RSBREST_DATARServiPools alloc] init];
  NS_DURING
  {
    [_rSBREST_DATARServiPools initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATARServiPools = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATARServiPools autorelease];
  return _rSBREST_DATARServiPools;
}

/**
 * Initialize this instance of RSBREST_DATARServiPools according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATARServiPools to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBREST_DATARServiPools from an XML reader. The element to be read is
 * "{http://rest.rsb.openanalytics.eu/types}rServiPools".
 *
 * @param reader The XML reader.
 * @return The RSBREST_DATARServiPools.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBREST_DATARServiPools *_rServiPools = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://rest.rsb.openanalytics.eu/types}rServiPools."];
    }
  }

  if (xmlStrcmp(BAD_CAST "rServiPools", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://rest.rsb.openanalytics.eu/types}rServiPools.");
#endif
    _rServiPools = (RSBREST_DATARServiPools *)[RSBREST_DATARServiPools readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://rest.rsb.openanalytics.eu/types}rServiPools.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATARServiPools. Expected element {http://rest.rsb.openanalytics.eu/types}rServiPools. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATARServiPools. Expected element {http://rest.rsb.openanalytics.eu/types}rServiPools. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _rServiPools;
}

/**
 * Writes this RSBREST_DATARServiPools to XML under element name "{http://rest.rsb.openanalytics.eu/types}rServiPools".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _rServiPools The RServiPools to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBREST_DATARServiPools to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "rServiPools", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://rest.rsb.openanalytics.eu/types}rServiPools. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}rServiPools...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:rest_data' on '{http://rest.rsb.openanalytics.eu/types}rServiPools'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://rest.rsb.openanalytics.eu/types}rServiPools...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://rest.rsb.openanalytics.eu/types}rServiPoolsType for root element {http://rest.rsb.openanalytics.eu/types}rServiPools...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://rest.rsb.openanalytics.eu/types}rServiPoolsType for root element {http://rest.rsb.openanalytics.eu/types}rServiPools...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://rest.rsb.openanalytics.eu/types}rServiPools. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://rest.rsb.openanalytics.eu/types}rServiPool of type {http://rest.rsb.openanalytics.eu/types}rServiPoolType.");
#endif

     __child = [RSBREST_DATARServiPoolType readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://rest.rsb.openanalytics.eu/types}rServiPool of type {http://rest.rsb.openanalytics.eu/types}rServiPoolType.");
#endif

    if ([self contents]) {
      [self setContents: [[self contents] arrayByAddingObject: __child]];
    }
    else {
      [self setContents: [NSArray arrayWithObject: __child]];
    }
    return YES;
  } //end "if choice"


  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

  if ([self contents]) {
    __enumerator = [[self contents] objectEnumerator];

    while ( (__item = [__enumerator nextObject]) ) {
      status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "rServiPool", NULL);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing start child element {http://rest.rsb.openanalytics.eu/types}rServiPool."];
      }

#if DEBUG_ENUNCIATE > 1
      NSLog(@"writing element {http://rest.rsb.openanalytics.eu/types}rServiPool...");
#endif
      [__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
      NSLog(@"successfully wrote element {http://rest.rsb.openanalytics.eu/types}rServiPool...");
#endif

      status = xmlTextWriterEndElement(writer);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing end child element {http://rest.rsb.openanalytics.eu/types}rServiPool."];
      }
    } //end item iterator.
  }
}
@end /* implementation RSBREST_DATARServiPools (JAXB) */

#endif /* DEF_RSBREST_DATARServiPools_M */
#ifndef DEF_RSBREST_DATANodeInformation_M
#define DEF_RSBREST_DATANodeInformation_M

/**
 *  <p>Java class for nodeInformationType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="nodeInformationType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="healthy" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
       &lt;attribute name="uptime" use="required" type="{http://www.w3.org/2001/XMLSchema}long" />
       &lt;attribute name="uptimeText" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="servletContainerInfo" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="rsbVersion" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="jvmMaxMemory" use="required" type="{http://www.w3.org/2001/XMLSchema}long" />
       &lt;attribute name="jvmFreeMemory" use="required" type="{http://www.w3.org/2001/XMLSchema}long" />
       &lt;attribute name="osLoadAverage" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATANodeInformation

/**
 * (no documentation provided)
 */
- (NSString *) name
{
  return _name;
}

/**
 * (no documentation provided)
 */
- (void) setName: (NSString *) newName
{
  [newName retain];
  [_name release];
  _name = newName;
}

/**
 * (no documentation provided)
 */
- (BOOL) healthy
{
  return _healthy;
}

/**
 * (no documentation provided)
 */
- (void) setHealthy: (BOOL) newHealthy
{
  _healthy = newHealthy;
}

/**
 * (no documentation provided)
 */
- (long long) uptime
{
  return _uptime;
}

/**
 * (no documentation provided)
 */
- (void) setUptime: (long long) newUptime
{
  _uptime = newUptime;
}

/**
 * (no documentation provided)
 */
- (NSString *) uptimeText
{
  return _uptimeText;
}

/**
 * (no documentation provided)
 */
- (void) setUptimeText: (NSString *) newUptimeText
{
  [newUptimeText retain];
  [_uptimeText release];
  _uptimeText = newUptimeText;
}

/**
 * (no documentation provided)
 */
- (NSString *) servletContainerInfo
{
  return _servletContainerInfo;
}

/**
 * (no documentation provided)
 */
- (void) setServletContainerInfo: (NSString *) newServletContainerInfo
{
  [newServletContainerInfo retain];
  [_servletContainerInfo release];
  _servletContainerInfo = newServletContainerInfo;
}

/**
 * (no documentation provided)
 */
- (NSString *) rsbVersion
{
  return _rsbVersion;
}

/**
 * (no documentation provided)
 */
- (void) setRsbVersion: (NSString *) newRsbVersion
{
  [newRsbVersion retain];
  [_rsbVersion release];
  _rsbVersion = newRsbVersion;
}

/**
 * (no documentation provided)
 */
- (long long) jvmMaxMemory
{
  return _jvmMaxMemory;
}

/**
 * (no documentation provided)
 */
- (void) setJvmMaxMemory: (long long) newJvmMaxMemory
{
  _jvmMaxMemory = newJvmMaxMemory;
}

/**
 * (no documentation provided)
 */
- (long long) jvmFreeMemory
{
  return _jvmFreeMemory;
}

/**
 * (no documentation provided)
 */
- (void) setJvmFreeMemory: (long long) newJvmFreeMemory
{
  _jvmFreeMemory = newJvmFreeMemory;
}

/**
 * (no documentation provided)
 */
- (double) osLoadAverage
{
  return _osLoadAverage;
}

/**
 * (no documentation provided)
 */
- (void) setOsLoadAverage: (double) newOsLoadAverage
{
  _osLoadAverage = newOsLoadAverage;
}

- (void) dealloc
{
  [self setName: nil];
  [self setUptimeText: nil];
  [self setServletContainerInfo: nil];
  [self setRsbVersion: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBREST_DATANodeInformation *_rSBREST_DATANodeInformation;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBREST_DATANodeInformation = (RSBREST_DATANodeInformation *) [RSBREST_DATANodeInformation readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBREST_DATANodeInformation;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBREST_DATANodeInformation */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATANodeInformation (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBREST_DATANodeInformation (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATANodeInformation (JAXB)

/**
 * Read an instance of RSBREST_DATANodeInformation from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATANodeInformation defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATANodeInformation *_rSBREST_DATANodeInformation = [[RSBREST_DATANodeInformation alloc] init];
  NS_DURING
  {
    [_rSBREST_DATANodeInformation initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATANodeInformation = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATANodeInformation autorelease];
  return _rSBREST_DATANodeInformation;
}

/**
 * Initialize this instance of RSBREST_DATANodeInformation according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATANodeInformation to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBREST_DATANodeInformation from an XML reader. The element to be read is
 * "{http://rest.rsb.openanalytics.eu/types}nodeInformation".
 *
 * @param reader The XML reader.
 * @return The RSBREST_DATANodeInformation.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBREST_DATANodeInformation *_nodeInformation = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://rest.rsb.openanalytics.eu/types}nodeInformation."];
    }
  }

  if (xmlStrcmp(BAD_CAST "nodeInformation", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://rest.rsb.openanalytics.eu/types}nodeInformation.");
#endif
    _nodeInformation = (RSBREST_DATANodeInformation *)[RSBREST_DATANodeInformation readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://rest.rsb.openanalytics.eu/types}nodeInformation.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATANodeInformation. Expected element {http://rest.rsb.openanalytics.eu/types}nodeInformation. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATANodeInformation. Expected element {http://rest.rsb.openanalytics.eu/types}nodeInformation. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _nodeInformation;
}

/**
 * Writes this RSBREST_DATANodeInformation to XML under element name "{http://rest.rsb.openanalytics.eu/types}nodeInformation".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _nodeInformation The NodeInformation to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBREST_DATANodeInformation to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "nodeInformation", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://rest.rsb.openanalytics.eu/types}nodeInformation. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}nodeInformation...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:rest_data' on '{http://rest.rsb.openanalytics.eu/types}nodeInformation'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://rest.rsb.openanalytics.eu/types}nodeInformation...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://rest.rsb.openanalytics.eu/types}nodeInformationType for root element {http://rest.rsb.openanalytics.eu/types}nodeInformation...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://rest.rsb.openanalytics.eu/types}nodeInformationType for root element {http://rest.rsb.openanalytics.eu/types}nodeInformation...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://rest.rsb.openanalytics.eu/types}nodeInformation. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}name...");
#endif
    [self setName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}name...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "healthy", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}healthy...");
#endif
    _child_accessor = xmlTextReaderReadBooleanType(reader);
    if (_child_accessor == NULL) {
      //panic: unable to read the attribute value for some reason.
      [NSException raise: @"XMLReadError"
                   format: @"Error reading attribute {}healthy."];
    }
    [self setHealthy: *((BOOL*) _child_accessor)];
    free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}healthy...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "uptime", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}uptime...");
#endif
    _child_accessor = xmlTextReaderReadLongType(reader);
    if (_child_accessor == NULL) {
      //panic: unable to read the attribute value for some reason.
      [NSException raise: @"XMLReadError"
                   format: @"Error reading attribute {}uptime."];
    }
    [self setUptime: *((long long*) _child_accessor)];
    free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}uptime...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "uptimeText", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}uptimeText...");
#endif
    [self setUptimeText: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}uptimeText...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "servletContainerInfo", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}servletContainerInfo...");
#endif
    [self setServletContainerInfo: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}servletContainerInfo...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "rsbVersion", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}rsbVersion...");
#endif
    [self setRsbVersion: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}rsbVersion...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "jvmMaxMemory", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}jvmMaxMemory...");
#endif
    _child_accessor = xmlTextReaderReadLongType(reader);
    if (_child_accessor == NULL) {
      //panic: unable to read the attribute value for some reason.
      [NSException raise: @"XMLReadError"
                   format: @"Error reading attribute {}jvmMaxMemory."];
    }
    [self setJvmMaxMemory: *((long long*) _child_accessor)];
    free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}jvmMaxMemory...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "jvmFreeMemory", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}jvmFreeMemory...");
#endif
    _child_accessor = xmlTextReaderReadLongType(reader);
    if (_child_accessor == NULL) {
      //panic: unable to read the attribute value for some reason.
      [NSException raise: @"XMLReadError"
                   format: @"Error reading attribute {}jvmFreeMemory."];
    }
    [self setJvmFreeMemory: *((long long*) _child_accessor)];
    free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}jvmFreeMemory...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "osLoadAverage", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}osLoadAverage...");
#endif
    _child_accessor = xmlTextReaderReadDoubleType(reader);
    if (_child_accessor == NULL) {
      //panic: unable to read the attribute value for some reason.
      [NSException raise: @"XMLReadError"
                   format: @"Error reading attribute {}osLoadAverage."];
    }
    [self setOsLoadAverage: *((double*) _child_accessor)];
    free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}osLoadAverage...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self name]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}name."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}name...");
#endif
    [[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}name...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}name."];
    }
  }
  if (YES) { //always write the primitive attributes...

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "healthy", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}healthy."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}healthy...");
#endif
    status = xmlTextWriterWriteBooleanType(writer, &_healthy);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute {}healthy."];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}healthy...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}healthy."];
    }
  }
  if (YES) { //always write the primitive attributes...

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "uptime", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}uptime."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}uptime...");
#endif
    status = xmlTextWriterWriteLongType(writer, &_uptime);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute {}uptime."];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}uptime...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}uptime."];
    }
  }
  if ([self uptimeText]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "uptimeText", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}uptimeText."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}uptimeText...");
#endif
    [[self uptimeText] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}uptimeText...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}uptimeText."];
    }
  }
  if ([self servletContainerInfo]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "servletContainerInfo", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}servletContainerInfo."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}servletContainerInfo...");
#endif
    [[self servletContainerInfo] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}servletContainerInfo...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}servletContainerInfo."];
    }
  }
  if ([self rsbVersion]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "rsbVersion", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}rsbVersion."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}rsbVersion...");
#endif
    [[self rsbVersion] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}rsbVersion...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}rsbVersion."];
    }
  }
  if (YES) { //always write the primitive attributes...

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jvmMaxMemory", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}jvmMaxMemory."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}jvmMaxMemory...");
#endif
    status = xmlTextWriterWriteLongType(writer, &_jvmMaxMemory);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute {}jvmMaxMemory."];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}jvmMaxMemory...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}jvmMaxMemory."];
    }
  }
  if (YES) { //always write the primitive attributes...

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jvmFreeMemory", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}jvmFreeMemory."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}jvmFreeMemory...");
#endif
    status = xmlTextWriterWriteLongType(writer, &_jvmFreeMemory);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute {}jvmFreeMemory."];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}jvmFreeMemory...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}jvmFreeMemory."];
    }
  }
  if (YES) { //always write the primitive attributes...

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "osLoadAverage", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}osLoadAverage."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}osLoadAverage...");
#endif
    status = xmlTextWriterWriteDoubleType(writer, &_osLoadAverage);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute {}osLoadAverage."];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}osLoadAverage...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}osLoadAverage."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

}
@end /* implementation RSBREST_DATANodeInformation (JAXB) */

#endif /* DEF_RSBREST_DATANodeInformation_M */
#ifndef DEF_RSBREST_DATAFileType_M
#define DEF_RSBREST_DATAFileType_M

/**
 *  <p>Java class for fileType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="fileType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;attribute name="path" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATAFileType

/**
 * (no documentation provided)
 */
- (NSString *) path
{
  return _path;
}

/**
 * (no documentation provided)
 */
- (void) setPath: (NSString *) newPath
{
  [newPath retain];
  [_path release];
  _path = newPath;
}

/**
 * (no documentation provided)
 */
- (NSString *) name
{
  return _name;
}

/**
 * (no documentation provided)
 */
- (void) setName: (NSString *) newName
{
  [newName retain];
  [_name release];
  _name = newName;
}

- (void) dealloc
{
  [self setPath: nil];
  [self setName: nil];
  [super dealloc];
}
@end /* implementation RSBREST_DATAFileType */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATAFileType (JAXB) <JAXBReading, JAXBWriting, JAXBType>

@end /*interface RSBREST_DATAFileType (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATAFileType (JAXB)

/**
 * Read an instance of RSBREST_DATAFileType from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATAFileType defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATAFileType *_rSBREST_DATAFileType = [[RSBREST_DATAFileType alloc] init];
  NS_DURING
  {
    [_rSBREST_DATAFileType initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATAFileType = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATAFileType autorelease];
  return _rSBREST_DATAFileType;
}

/**
 * Initialize this instance of RSBREST_DATAFileType according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATAFileType to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "path", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}path...");
#endif
    [self setPath: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}path...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}name...");
#endif
    [self setName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}name...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self path]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "path", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}path."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}path...");
#endif
    [[self path] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}path...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}path."];
    }
  }
  if ([self name]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}name."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}name...");
#endif
    [[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}name...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}name."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

}
@end /* implementation RSBREST_DATAFileType (JAXB) */

#endif /* DEF_RSBREST_DATAFileType_M */
#ifndef DEF_RSBREST_DATADirectory_M
#define DEF_RSBREST_DATADirectory_M

/**
 *  <p>Java class for directoryType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="directoryType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;sequence>
         &lt;element name="directory" type="{http://rest.rsb.openanalytics.eu/types}directoryType" maxOccurs="unbounded" minOccurs="0"/>
         &lt;element name="file" type="{http://rest.rsb.openanalytics.eu/types}fileType" maxOccurs="unbounded" minOccurs="0"/>
       &lt;/sequence>
       &lt;attribute name="path" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       &lt;attribute name="uri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
       &lt;attribute name="empty" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATADirectory

/**
 * (no documentation provided)
 */
- (NSString *) path
{
  return _path;
}

/**
 * (no documentation provided)
 */
- (void) setPath: (NSString *) newPath
{
  [newPath retain];
  [_path release];
  _path = newPath;
}

/**
 * (no documentation provided)
 */
- (NSString *) name
{
  return _name;
}

/**
 * (no documentation provided)
 */
- (void) setName: (NSString *) newName
{
  [newName retain];
  [_name release];
  _name = newName;
}

/**
 * (no documentation provided)
 */
- (NSString *) uri
{
  return _uri;
}

/**
 * (no documentation provided)
 */
- (void) setUri: (NSString *) newUri
{
  [newUri retain];
  [_uri release];
  _uri = newUri;
}

/**
 * (no documentation provided)
 */
- (BOOL) empty
{
  return _empty;
}

/**
 * (no documentation provided)
 */
- (void) setEmpty: (BOOL) newEmpty
{
  _empty = newEmpty;
}

/**
 * (no documentation provided)
 */
- (NSArray *) directories
{
  return _directories;
}

/**
 * (no documentation provided)
 */
- (void) setDirectories: (NSArray *) newDirectories
{
  [newDirectories retain];
  [_directories release];
  _directories = newDirectories;
}

/**
 * (no documentation provided)
 */
- (NSArray *) files
{
  return _files;
}

/**
 * (no documentation provided)
 */
- (void) setFiles: (NSArray *) newFiles
{
  [newFiles retain];
  [_files release];
  _files = newFiles;
}

- (void) dealloc
{
  [self setPath: nil];
  [self setName: nil];
  [self setUri: nil];
  [self setDirectories: nil];
  [self setFiles: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBREST_DATADirectory *_rSBREST_DATADirectory;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBREST_DATADirectory = (RSBREST_DATADirectory *) [RSBREST_DATADirectory readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBREST_DATADirectory;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBREST_DATADirectory */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATADirectory (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBREST_DATADirectory (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATADirectory (JAXB)

/**
 * Read an instance of RSBREST_DATADirectory from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATADirectory defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATADirectory *_rSBREST_DATADirectory = [[RSBREST_DATADirectory alloc] init];
  NS_DURING
  {
    [_rSBREST_DATADirectory initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATADirectory = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATADirectory autorelease];
  return _rSBREST_DATADirectory;
}

/**
 * Initialize this instance of RSBREST_DATADirectory according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATADirectory to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBREST_DATADirectory from an XML reader. The element to be read is
 * "{http://rest.rsb.openanalytics.eu/types}directory".
 *
 * @param reader The XML reader.
 * @return The RSBREST_DATADirectory.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBREST_DATADirectory *_directory = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://rest.rsb.openanalytics.eu/types}directory."];
    }
  }

  if (xmlStrcmp(BAD_CAST "directory", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://rest.rsb.openanalytics.eu/types}directory.");
#endif
    _directory = (RSBREST_DATADirectory *)[RSBREST_DATADirectory readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://rest.rsb.openanalytics.eu/types}directory.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATADirectory. Expected element {http://rest.rsb.openanalytics.eu/types}directory. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATADirectory. Expected element {http://rest.rsb.openanalytics.eu/types}directory. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _directory;
}

/**
 * Writes this RSBREST_DATADirectory to XML under element name "{http://rest.rsb.openanalytics.eu/types}directory".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _directory The Directory to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBREST_DATADirectory to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "directory", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://rest.rsb.openanalytics.eu/types}directory. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}directory...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:rest_data' on '{http://rest.rsb.openanalytics.eu/types}directory'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://rest.rsb.openanalytics.eu/types}directory...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://rest.rsb.openanalytics.eu/types}directoryType for root element {http://rest.rsb.openanalytics.eu/types}directory...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://rest.rsb.openanalytics.eu/types}directoryType for root element {http://rest.rsb.openanalytics.eu/types}directory...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://rest.rsb.openanalytics.eu/types}directory. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "path", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}path...");
#endif
    [self setPath: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}path...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}name...");
#endif
    [self setName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}name...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "uri", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}uri...");
#endif
    [self setUri: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}uri...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "empty", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}empty...");
#endif
    _child_accessor = xmlTextReaderReadBooleanType(reader);
    if (_child_accessor == NULL) {
      //panic: unable to read the attribute value for some reason.
      [NSException raise: @"XMLReadError"
                   format: @"Error reading attribute {}empty."];
    }
    [self setEmpty: *((BOOL*) _child_accessor)];
    free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}empty...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://rest.rsb.openanalytics.eu/types}directory of type {http://rest.rsb.openanalytics.eu/types}directoryType.");
#endif

     __child = [RSBREST_DATADirectory readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://rest.rsb.openanalytics.eu/types}directory of type {http://rest.rsb.openanalytics.eu/types}directoryType.");
#endif

    if ([self directories]) {
      [self setDirectories: [[self directories] arrayByAddingObject: __child]];
    }
    else {
      [self setDirectories: [NSArray arrayWithObject: __child]];
    }
    return YES;
  } //end "if choice"

  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
    NSLog(@"Attempting to read choice {http://rest.rsb.openanalytics.eu/types}file of type {http://rest.rsb.openanalytics.eu/types}fileType.");
#endif

     __child = [RSBREST_DATAFileType readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://rest.rsb.openanalytics.eu/types}file of type {http://rest.rsb.openanalytics.eu/types}fileType.");
#endif

    if ([self files]) {
      [self setFiles: [[self files] arrayByAddingObject: __child]];
    }
    else {
      [self setFiles: [NSArray arrayWithObject: __child]];
    }
    return YES;
  } //end "if choice"


  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self path]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "path", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}path."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}path...");
#endif
    [[self path] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}path...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}path."];
    }
  }
  if ([self name]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}name."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}name...");
#endif
    [[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}name...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}name."];
    }
  }
  if ([self uri]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "uri", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}uri."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}uri...");
#endif
    [[self uri] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}uri...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}uri."];
    }
  }
  if (YES) { //always write the primitive attributes...

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "empty", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}empty."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}empty...");
#endif
    status = xmlTextWriterWriteBooleanType(writer, &_empty);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute {}empty."];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}empty...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}empty."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

  if ([self directories]) {
    __enumerator = [[self directories] objectEnumerator];

    while ( (__item = [__enumerator nextObject]) ) {
      status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "directory", NULL);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing start child element {http://rest.rsb.openanalytics.eu/types}directory."];
      }

#if DEBUG_ENUNCIATE > 1
      NSLog(@"writing element {http://rest.rsb.openanalytics.eu/types}directory...");
#endif
      [__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
      NSLog(@"successfully wrote element {http://rest.rsb.openanalytics.eu/types}directory...");
#endif

      status = xmlTextWriterEndElement(writer);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing end child element {http://rest.rsb.openanalytics.eu/types}directory."];
      }
    } //end item iterator.
  }
  if ([self files]) {
    __enumerator = [[self files] objectEnumerator];

    while ( (__item = [__enumerator nextObject]) ) {
      status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "file", NULL);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing start child element {http://rest.rsb.openanalytics.eu/types}file."];
      }

#if DEBUG_ENUNCIATE > 1
      NSLog(@"writing element {http://rest.rsb.openanalytics.eu/types}file...");
#endif
      [__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
      NSLog(@"successfully wrote element {http://rest.rsb.openanalytics.eu/types}file...");
#endif

      status = xmlTextWriterEndElement(writer);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing end child element {http://rest.rsb.openanalytics.eu/types}file."];
      }
    } //end item iterator.
  }
}
@end /* implementation RSBREST_DATADirectory (JAXB) */

#endif /* DEF_RSBREST_DATADirectory_M */
#ifndef DEF_RSBREST_DATACatalogDirectory_M
#define DEF_RSBREST_DATACatalogDirectory_M

/**
 *  <p>Java class for catalogDirectory complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="catalogDirectory">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;sequence>
         &lt;element name="file" type="{http://rest.rsb.openanalytics.eu/types}catalogFileType" maxOccurs="unbounded" minOccurs="0"/>
       &lt;/sequence>
       &lt;attribute name="type" use="required">
         &lt;simpleType>
           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
             &lt;enumeration value="EMAIL_REPLIES"/>
             &lt;enumeration value="JOB_CONFIGURATIONS"/>
             &lt;enumeration value="R_SCRIPTS"/>
             &lt;enumeration value="SWEAVE_FILES"/>
           &lt;/restriction>
         &lt;/simpleType>
       &lt;/attribute>
       &lt;attribute name="path" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATACatalogDirectory

/**
 * (no documentation provided)
 */
- (NSString *) type
{
  return _type;
}

/**
 * (no documentation provided)
 */
- (void) setType: (NSString *) newType
{
  [newType retain];
  [_type release];
  _type = newType;
}

/**
 * (no documentation provided)
 */
- (NSString *) path
{
  return _path;
}

/**
 * (no documentation provided)
 */
- (void) setPath: (NSString *) newPath
{
  [newPath retain];
  [_path release];
  _path = newPath;
}

/**
 * (no documentation provided)
 */
- (NSArray *) files
{
  return _files;
}

/**
 * (no documentation provided)
 */
- (void) setFiles: (NSArray *) newFiles
{
  [newFiles retain];
  [_files release];
  _files = newFiles;
}

- (void) dealloc
{
  [self setType: nil];
  [self setPath: nil];
  [self setFiles: nil];
  [super dealloc];
}
@end /* implementation RSBREST_DATACatalogDirectory */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATACatalogDirectory (JAXB) <JAXBReading, JAXBWriting, JAXBType>

@end /*interface RSBREST_DATACatalogDirectory (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATACatalogDirectory (JAXB)

/**
 * Read an instance of RSBREST_DATACatalogDirectory from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATACatalogDirectory defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATACatalogDirectory *_rSBREST_DATACatalogDirectory = [[RSBREST_DATACatalogDirectory alloc] init];
  NS_DURING
  {
    [_rSBREST_DATACatalogDirectory initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATACatalogDirectory = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATACatalogDirectory autorelease];
  return _rSBREST_DATACatalogDirectory;
}

/**
 * Initialize this instance of RSBREST_DATACatalogDirectory according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATACatalogDirectory to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "type", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}type...");
#endif
    [self setType: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}type...");
#endif
    return YES;
  }

  if ((xmlStrcmp(BAD_CAST "path", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read attribute {}path...");
#endif
    [self setPath: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read attribute {}path...");
#endif
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://rest.rsb.openanalytics.eu/types}file of type {http://rest.rsb.openanalytics.eu/types}catalogFileType.");
#endif

     __child = [RSBREST_DATACatalogFileType readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://rest.rsb.openanalytics.eu/types}file of type {http://rest.rsb.openanalytics.eu/types}catalogFileType.");
#endif

    if ([self files]) {
      [self setFiles: [[self files] arrayByAddingObject: __child]];
    }
    else {
      [self setFiles: [NSArray arrayWithObject: __child]];
    }
    return YES;
  } //end "if choice"


  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

  if ([self type]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "type", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}type."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}type...");
#endif
    [[self type] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}type...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}type."];
    }
  }
  if ([self path]) {

    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "path", NULL);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing start attribute {}path."];
    }

#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing attribute {}path...");
#endif
    [[self path] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote attribute {}path...");
#endif

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing end attribute {}path."];
    }
  }
}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

  if ([self files]) {
    __enumerator = [[self files] objectEnumerator];

    while ( (__item = [__enumerator nextObject]) ) {
      status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "file", NULL);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing start child element {http://rest.rsb.openanalytics.eu/types}file."];
      }

#if DEBUG_ENUNCIATE > 1
      NSLog(@"writing element {http://rest.rsb.openanalytics.eu/types}file...");
#endif
      [__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
      NSLog(@"successfully wrote element {http://rest.rsb.openanalytics.eu/types}file...");
#endif

      status = xmlTextWriterEndElement(writer);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing end child element {http://rest.rsb.openanalytics.eu/types}file."];
      }
    } //end item iterator.
  }
}
@end /* implementation RSBREST_DATACatalogDirectory (JAXB) */

#endif /* DEF_RSBREST_DATACatalogDirectory_M */
#ifndef DEF_RSBREST_DATACatalog_M
#define DEF_RSBREST_DATACatalog_M

/**
 *  <p>Java class for catalogType complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 &lt;complexType name="catalogType">
   &lt;complexContent>
     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       &lt;sequence>
         &lt;element name="directory" type="{http://rest.rsb.openanalytics.eu/types}catalogDirectory" maxOccurs="4" minOccurs="4"/>
       &lt;/sequence>
     &lt;/restriction>
   &lt;/complexContent>
 &lt;/complexType>
 </pre>
 
 

 */
@implementation RSBREST_DATACatalog

/**
 * (no documentation provided)
 */
- (NSArray *) directories
{
  return _directories;
}

/**
 * (no documentation provided)
 */
- (void) setDirectories: (NSArray *) newDirectories
{
  [newDirectories retain];
  [_directories release];
  _directories = newDirectories;
}

- (void) dealloc
{
  [self setDirectories: nil];
  [super dealloc];
}

//documentation inherited.
+ (id<EnunciateXML>) readFromXML: (NSData *) xml
{
  RSBREST_DATACatalog *_rSBREST_DATACatalog;
  xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
  if (reader == NULL) {
    [NSException raise: @"XMLReadError"
                 format: @"Error instantiating an XML reader."];
    return nil;
  }

  _rSBREST_DATACatalog = (RSBREST_DATACatalog *) [RSBREST_DATACatalog readXMLElement: reader];
  xmlFreeTextReader(reader); //free the reader
  return _rSBREST_DATACatalog;
}

//documentation inherited.
- (NSData *) writeToXML
{
  xmlBufferPtr buf;
  xmlTextWriterPtr writer;
  int rc;
  NSData *data;

  buf = xmlBufferCreate();
  if (buf == NULL) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML buffer."];
    return nil;
  }

  writer = xmlNewTextWriterMemory(buf, 0);
  if (writer == NULL) {
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error creating an XML writer."];
    return nil;
  }

  rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML start document."];
    return nil;
  }

  NS_DURING
  {
    [self writeXMLElement: writer];
  }
  NS_HANDLER
  {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [localException raise];
  }
  NS_ENDHANDLER

  rc = xmlTextWriterEndDocument(writer);
  if (rc < 0) {
    xmlFreeTextWriter(writer);
    xmlBufferFree(buf);
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing XML end document."];
    return nil;
  }

  xmlFreeTextWriter(writer);
  data = [NSData dataWithBytes: buf->content length: buf->use];
  xmlBufferFree(buf);
  return data;
}
@end /* implementation RSBREST_DATACatalog */

/**
 * Internal, private interface for JAXB reading and writing.
 */
@interface RSBREST_DATACatalog (JAXB) <JAXBReading, JAXBWriting, JAXBType, JAXBElement>

@end /*interface RSBREST_DATACatalog (JAXB)*/

/**
 * Internal, private implementation for JAXB reading and writing.
 */
@implementation RSBREST_DATACatalog (JAXB)

/**
 * Read an instance of RSBREST_DATACatalog from an XML reader.
 *
 * @param reader The reader.
 * @return An instance of RSBREST_DATACatalog defined by the XML reader.
 */
+ (id<JAXBType>) readXMLType: (xmlTextReaderPtr) reader
{
  RSBREST_DATACatalog *_rSBREST_DATACatalog = [[RSBREST_DATACatalog alloc] init];
  NS_DURING
  {
    [_rSBREST_DATACatalog initWithReader: reader];
  }
  NS_HANDLER
  {
    _rSBREST_DATACatalog = nil;
    [localException raise];
  }
  NS_ENDHANDLER

  [_rSBREST_DATACatalog autorelease];
  return _rSBREST_DATACatalog;
}

/**
 * Initialize this instance of RSBREST_DATACatalog according to
 * the XML being read from the reader.
 *
 * @param reader The reader.
 */
- (id) initWithReader: (xmlTextReaderPtr) reader
{
  return [super initWithReader: reader];
}

/**
 * Write the XML for this instance of RSBREST_DATACatalog to the writer.
 * Note that since we're only writing the XML type,
 * No start/end element will be written.
 *
 * @param reader The reader.
 */
- (void) writeXMLType: (xmlTextWriterPtr) writer
{
  [super writeXMLType:writer];
}

/**
 * Reads a RSBREST_DATACatalog from an XML reader. The element to be read is
 * "{http://rest.rsb.openanalytics.eu/types}catalog".
 *
 * @param reader The XML reader.
 * @return The RSBREST_DATACatalog.
 */
+ (id<JAXBElement>) readXMLElement: (xmlTextReaderPtr) reader {
  int status;
  RSBREST_DATACatalog *_catalog = nil;

  if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) {
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
    if (status < 1) {
      [NSException raise: @"XMLReadError"
                   format: @"Error advancing the reader to start element {http://rest.rsb.openanalytics.eu/types}catalog."];
    }
  }

  if (xmlStrcmp(BAD_CAST "catalog", xmlTextReaderConstLocalName(reader)) == 0
      && xmlStrcmp(BAD_CAST "http://rest.rsb.openanalytics.eu/types", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Attempting to read root element {http://rest.rsb.openanalytics.eu/types}catalog.");
#endif
    _catalog = (RSBREST_DATACatalog *)[RSBREST_DATACatalog readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"Successfully read root element {http://rest.rsb.openanalytics.eu/types}catalog.");
#endif
  }
  else {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATACatalog. Expected element {http://rest.rsb.openanalytics.eu/types}catalog. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
    }
    else {
      [NSException raise: @"XMLReadError"
                   format: @"Unable to read RSBREST_DATACatalog. Expected element {http://rest.rsb.openanalytics.eu/types}catalog. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
    }
  }

  return _catalog;
}

/**
 * Writes this RSBREST_DATACatalog to XML under element name "{http://rest.rsb.openanalytics.eu/types}catalog".
 * The namespace declarations for the element will be written.
 *
 * @param writer The XML writer.
 * @param _catalog The Catalog to write.
 * @return 1 if successful, 0 otherwise.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
  [self writeXMLElement: writer writeNamespaces: YES];
}

/**
 * Writes this RSBREST_DATACatalog to an XML writer.
 *
 * @param writer The writer.
 * @param writeNs Whether to write the namespaces for this element to the xml writer.
 */
- (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs
{
  int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "catalog", NULL);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing start element {http://rest.rsb.openanalytics.eu/types}catalog. XML writer status: %i\n", rc];
  }

  if (writeNs) {
#if DEBUG_ENUNCIATE > 1
    NSLog(@"writing namespaces for start element {http://rest.rsb.openanalytics.eu/types}catalog...");
#endif

    rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:rest_data", BAD_CAST "http://rest.rsb.openanalytics.eu/types");
    if (rc < 0) {
      [NSException raise: @"XMLWriteError"
                   format: @"Error writing attribute 'xmlns:rest_data' on '{http://rest.rsb.openanalytics.eu/types}catalog'. XML writer status: %i\n", rc];
    }
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully wrote namespaces for start element {http://rest.rsb.openanalytics.eu/types}catalog...");
#endif
  }

#if DEBUG_ENUNCIATE > 1
  NSLog(@"writing type {http://rest.rsb.openanalytics.eu/types}catalogType for root element {http://rest.rsb.openanalytics.eu/types}catalog...");
#endif
  [self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
  NSLog(@"successfully wrote type {http://rest.rsb.openanalytics.eu/types}catalogType for root element {http://rest.rsb.openanalytics.eu/types}catalog...");
#endif
  rc = xmlTextWriterEndElement(writer);
  if (rc < 0) {
    [NSException raise: @"XMLWriteError"
                 format: @"Error writing end element {http://rest.rsb.openanalytics.eu/types}catalog. XML writer status: %i\n", rc];
  }
}

//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
  void *_child_accessor;

  if ([super readJAXBAttribute: reader]) {
    return YES;
  }

  return NO;
}

//documentation inherited.
- (BOOL) readJAXBValue: (xmlTextReaderPtr) reader
{
  return [super readJAXBValue: reader];
}

//documentation inherited.
- (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader
{
  id __child;
  void *_child_accessor;
  int status, depth;

  if ([super readJAXBChildElement: reader]) {
    return YES;
  }
  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
    NSLog(@"Attempting to read choice {http://rest.rsb.openanalytics.eu/types}directory of type {http://rest.rsb.openanalytics.eu/types}catalogDirectory.");
#endif

     __child = [RSBREST_DATACatalogDirectory readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
    NSLog(@"successfully read choice {http://rest.rsb.openanalytics.eu/types}directory of type {http://rest.rsb.openanalytics.eu/types}catalogDirectory.");
#endif

    if ([self directories]) {
      [self setDirectories: [[self directories] arrayByAddingObject: __child]];
    }
    else {
      [self setDirectories: [NSArray arrayWithObject: __child]];
    }
    return YES;
  } //end "if choice"


  return NO;
}

//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
  return [super readUnknownJAXBChildElement: reader];
}

//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
  [super readUnknownJAXBAttribute: reader];
}

//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
  int status;

  [super writeJAXBAttributes: writer];

}

//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
  [super writeJAXBValue: writer];
}

/**
 * Method for writing the child elements.
 *
 * @param writer The writer.
 */
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
  int status;
  id __item;
  id __item_copy;
  NSEnumerator *__enumerator;

  [super writeJAXBChildElements: writer];

  if ([self directories]) {
    __enumerator = [[self directories] objectEnumerator];

    while ( (__item = [__enumerator nextObject]) ) {
      status = xmlTextWriterStartElementNS(writer, BAD_CAST "rest_data", BAD_CAST "directory", NULL);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing start child element {http://rest.rsb.openanalytics.eu/types}directory."];
      }

#if DEBUG_ENUNCIATE > 1
      NSLog(@"writing element {http://rest.rsb.openanalytics.eu/types}directory...");
#endif
      [__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
      NSLog(@"successfully wrote element {http://rest.rsb.openanalytics.eu/types}directory...");
#endif

      status = xmlTextWriterEndElement(writer);
      if (status < 0) {
        [NSException raise: @"XMLWriteError"
                     format: @"Error writing end child element {http://rest.rsb.openanalytics.eu/types}directory."];
      }
    } //end item iterator.
  }
}
@end /* implementation RSBREST_DATACatalog (JAXB) */

#endif /* DEF_RSBREST_DATACatalog_M */
