Hello,

i have problem with several WSDLs, which are using complex types like this 
..  one of element contains anonymous inner definition of restriction of 
simpleType.

 <complexType name='MyType'>
  <sequence>
   <element name='ID' type='string'/>
   <element name='type'>
    <simpleType>
     <restriction base='int'>
      <enumeration value='1'/>
      <enumeration value='3'/>
      <enumeration value='4'/>
      <enumeration value='7'/>
      <enumeration value='11'/>
     </restriction>
    </simpleType>
   </element>
  </sequence>
 </complexType>


is there a possibility to define in binding (global binding or using SCD) 
to always force jaxB to generate java enum for it with some name (e.g. 
ComplexType name concatenated with element name)?

when i changed single definition to
<complexType
....
   <element name='type'>
    <simpleType>
<xsd:annotation>
     <xsd:appinfo>
        <jxb:typesafeEnumClass name="xx"/>
     </xsd:appinfo>
  </xsd:annotation> 
  <restriction base='int'>
....
i have an error
[INFO] Thrown by JAXB : Cannot generate a constant name from the 
enumeration value "1". Use <jaxb:typesafeEnumMember name="..."/> to 
specify one.

also this should be done somehow automatically .. e.g. in case of number 
type, enum constants could be e.g. _X (underscore + value) and it should 
take real value as constructor arg. of type int or whatever (depending on 
type from xml schema)



best regards
jano

Reply via email to