Hello,
I have two applications, one acting as client and the other as server. In server application I generate ObjectFactory and classes using xjc from Eclipse. As a result, one of this classes is called widgetEvenCall. From the xsd:
...
<xs:element name="widgetEventCall">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" ref="tns:widgetEventDescriptor" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="tns:widgetParameter" />
</xs:sequence>
</xs:complexType>
</xs:element>
JAXB xjc generates the classes WidgetEventCall, WidgetEventDescriptor and WidgetParameter, with their getters and setters.
The client application, which don't have neither those classes nor the ObjectFactory, calls remotely a service on server application, getting as result one XML like:
. . .
<widgetEventCall>
<widgetEventDescriptor> ... </widgetEventDescriptor>
<widgetParameter>...</widgetParameter>
<widgetParameter>...</widgetParameter>
. . .
</widgetEventCall>
Luckily, client application has access to the .xsd definition. My question is: Is possible, having the xml content and the xsd definition, to create the objects for widgetEventCall, widgetEventDescriptor and widgetParameter like if they were created by xjc, including getters and setters, keeping the client application with no knowledge about them, using exclusively reflection? Is there one automated way to reach this?
my goal is to use this result into a JSP file, i.e. putting the object into request and accessing it like widgetEventCall.widgetParameter[0].someProperty, so I need the getters to be generated.
Thanks in advance.
Joan.