Search code examples
javaxmlapachexmlbeans

Write xsd:type attribute in Apache XmlBeans


About Apache XmlBeans. I use AnyType in scheme definition (xsd:anyType) as element in complex type. Example:

<request xmlns="">    
<xml>
  <input1>
    <string>str</string>
  </input1>
</xml>
</request>

in java code

final ProcessRequest processRequest = requestDocument.addNewRequest();
XmlObject xml = processRequest.addNewXml();
xml.changeType(operationType.type);
xml.set(operationType);

and i want to see

<xml xsd:type="*opeation1NSPrefix*:*operation1Type*>
...
</xml>

but i see only <xml/>. What i doing wrong?


Solution

  • stupid mistake: operation1 define as anonymous type <element><complexType>..</></> in wsdl. when i define "<element type=".."/><complexType name=".."/> the problem disappeared