That is related to the fact that the OMElement is actually an OMSourcedElement. If the element is not expanded, then there is no builder and build() is a no-op. Whether this is the expected behavior in this particular case is subject to interpretation, given that the Javadoc of the method is limited to "Builds itself."
A workaround would be to request the first child (so that the OMSourcedElement is expanded and a builder is created) before calling build(). Andreas On Wed, Aug 3, 2011 at 14:14, Amila Suriarachchi <[email protected]> wrote: > I did the following test with an generated ADBBean. > > MyInfo myInfo = new MyInfo(); > myInfo.setAge(23); > myInfo.setName("amila"); > > try { > OMElement omElement = myInfo.getOMElement(GetMyInfo.MY_QNAME, > OMAbstractFactory.getOMFactory()); > omElement.build(); > } catch (ADBException e) { > e.printStackTrace(); > } > > although I call build it does not call to serialize method at the ADBBean. > But if I call cloneOMElement it calls that. > > is there any other way to build the whole OMElement without traversing one > by one. > > thanks, > Amila. > > -- > Amila Suriarachchi > WSO2 Inc. > blog: http://amilachinthaka.blogspot.com/ > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
