JAXB doesn't generated classes for Elements.   It generates classes for types.  
 
If a type happens to be an anonymous type of an element, it will take on the 
name of the element, but it's still generated from the type definition.    

In the case of:
<xsd:element name="GriddedClimatology"/>
the "type" is xsd:anyType which JAXB maps to java.lang.Object.   Thus, there 
isn't anything to generate.

You might be able to try some of the jaxb customizations.   There is a 
generateElementClasses attribute on the globalBindings thing that might do 
it.   I'm not really sure.   I've never tried it.


Dan



On Friday 05 December 2008 11:56:25 am plester3738 wrote:
> I have a schema, that I do not control, that has the following structures:
>       <xsd:element name="GriddedData">
>               <xsd:annotation>
>                       <xsd:documentation>
>             Definition:
>                           A request for METOC grid data.
>
>            </xsd:documentation>
>               </xsd:annotation>
>               <xsd:complexType>
>                       <xsd:sequence>
>                               <xsd:choice>
>                                       <xsd:element 
> ref="GriddedAnalysisForecast"/>
>                                       <xsd:element ref="GriddedClimatology"/>
>                               </xsd:choice>
>                               <xsd:element ref="ConstraintParameters" 
> minOccurs="0"/>
>                               <xsd:element ref="Location"/>
>                               <xsd:element ref="Time" minOccurs="0"/>
>                               <xsd:element ref="Process" minOccurs="0"/>
>                               <xsd:element ref="GridParameter" 
> maxOccurs="unbounded"/>
>                               <xsd:element ref="ReProjection" minOccurs="0"/>
>                       </xsd:sequence>
>               </xsd:complexType>
>       </xsd:element>
>
> The elements in bold, GriddedAnalysisForecast and GriddedClimatology, are
> required, but are mere placeholders for future development and are defined
> as follows:
>
>       <xsd:element name="GriddedClimatology"/>
>       <xsd:element name="GriddedAnalysisForecast"/>
>
> Whenever I run wsdl2java against this XSD, all class files are generated,
> except for these two.  I can get the files to create if I go in, change the
> XSD to put bogus attributes into the elements, but this is not
> maintainable, as I have no control over the XSD.
>
> Is there a switch, or some method that I could use to make sure the
> wsdl2java generates ALL elements, including the empty ones?



-- 
Daniel Kulp
[EMAIL PROTECTED]
http://dankulp.com/blog

Reply via email to