cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Ma" <jim...@iona.com>
Subject XMLSchema and JAXB binding info
Date Mon, 05 Feb 2007 06:11:45 GMT
Hi all,

I pass the following schema to XMLSchemaCollection.read().  When I read the
element from XMLSchema,

I found  the jaxb binding info is lost.

<element name="MyProcess">
<simpleType>
    <annotation>
         <appinfo>
		<jaxb:typesafeEnumClass name="MyProcess">
			<jaxb:typesafeEnumMember name="BLUE" value="BLUE"/>
			<jaxb:typesafeEnumMember name="RED" value="RED"/>
			<jaxb:typesafeEnumMember name="GREEN" value="GREEN"/>
		</jaxb:typesafeEnumClass>
           </appinfo>
      </annotation>
       <restriction base="string">
		<enumeration value="BLUE"/>
		<enumeration value="RED"/>
		<enumeration value="GREEN"/>
       </restriction>
</simpleType>
</element>

This is the code I found this issue :

XmlSchema xmlSchema = schemaCol.read(schema);
Document[] docs = xmlSchema.getAllSchemas();
 for (int i = 0; i < docs.length; i++) {
         Element ele = docs[i].getDocumentElement();
         try {
                    DOMUtils.writeXml(ele, System.out);
         } catch (TransformerException e) {
                     //
         }
 }

I investigated the xmlSchema code and found XMLSchema does not handle  the
non-standard schema element like <jaxb: xxx>.
 When tools use the service model to generate code , it   can not get the
schemaInfo contains jaxb customization
to generate customized  types class.

So we need to get schema element from definition  instead of  getting the
schema element from xmlshemaCollection.
I will refactor the WSDLServuceBuilder  to extract the schema from element
and put the element list in service
model.

Thoughts?

Thanks

Jim


Mime
View raw message