i know, but i don't want to customize all wsdls .. i'm looking for common global binding or extension thanks.
"Adrian Corcoran" <[EMAIL PROTECTED]> 04/29/2008 20:21 Bitte antworten an [email protected] An [email protected] Kopie Thema Re: global jaxb binding to force to generate java enum [Virus checked] you need to use <jaxb:typesafeEnumMember name="XX" value="1" /> for the enum member On Tue, Apr 29, 2008 at 5:25 PM, <[EMAIL PROTECTED]> wrote: > 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
