• crawfish
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I am trying to run the example from the Apex documentation and I get an error stating that 'prefix cannot be null or empty'.  

 

If I use prefixes, it works, but I do not want to use prefixes.  Is there a workaround?  I already tried an empty string.

 

XmlStreamWriter w = new XmlStreamWriter();

w.writeStartDocument(null, '1.0');

w.writeProcessingInstruction('target', 'data');

w.writeStartElement('m', 'Library', 'http://www.book.com');

w.writeNamespace('m', 'http://www.book.com');

w.writeComment('Book starts here');

w.setDefaultNamespace('http://www.defns.com');

w.writeCData('<Cdata> I like CData </Cdata>');

w.writeStartElement(null, 'book', null);

w.writedefaultNamespace('http://www.defns.com');

w.writeAttribute(null, null, 'author', 'Manoj');

w.writeCharacters('This is my book');

w.writeEndElement(); //end book

w.writeEmptyElement(null, 'ISBN', null);

w.writeEndElement(); //end library

w.writeEndDocument();

String xmlOutput = w.getXmlString();

I am getting follwing error while creating Apex Code from WSDL

Apex generation failed

Error: Unsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType

What could be the reason....?

 

Thanks in advance