Hi,

Only Axis2 1.7(current trunk) support the JDK 5 Enum[1] objects.

[1] https://issues.apache.org/jira/browse/AXIS2-3967

On Thu, Nov 17, 2011 at 8:51 PM, Public Network Services <
publicnetworkservi...@gmail.com> wrote:

> Hi...
>
> I am trying to convert a POJO with 3 simple fields (of type String, Enum
> and Object) into an AXIOM OMElement, using Axis2 1.6.1.
>
> The POJO serialization code, as suggested by related Axis2 sample code,
>  is as follows:
>
> public OMElement toXML()
> {
> XMLStreamReader reader = BeanUtil.getPullParser(this);
>  StreamWrapper parser = new StreamWrapper(reader);
> StAXOMBuilder stAXOMBuilder = (StAXOMBuilder)OMXMLBuilderFactory.
>   createStAXOMBuilder(
>   OMAbstractFactory.getOMFactory(), parser);
>  return stAXOMBuilder.getDocumentElement();
> }
>
> Running the above code results in the Enum field and some of the Object
> fields (e.g., Boolean objects) being converted to XML without a value. For
> instance, if the POJO class is called TestField, the output produced by
> calling toXML().toString() is
>
> <TestField><name>boolean</name><type /><value /></TestField>
>
>
> (The full code of the TestField class, plus more test output, can be found
> here<http://stackoverflow.com/questions/8167674/axis2-axiom-serialization>
> .)
>
> Any clues?
>
> Thanks!
>



-- 
Shameera Rathnayaka
Undergraduate
Department of Computer Science and Engineering
University of Moratuwa.
Sri Lanka.

Blog : http://shameerarathnayaka.blogspot.com/

Reply via email to