On Wed, Aug 3, 2011 at 11:18 PM, Andreas Veithen
<[email protected]>wrote:
> 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."
>
I also looked at the java doc. If you look at the user point of view, is it
useful only to have a method which builds that element? I think when you
access the element that builds itself isn't it?
And also if you look at the following code in AbstractMessage receiver
if ((!WSDLUtil.isOutputPresentForMEP(mep))
|| (replyTo != null && !replyTo.hasAnonymousAddress()))
{
AsyncMessageReceiverWorker worker = new
AsyncMessageReceiverWorker(
messageCtx);
messageCtx.getEnvelope().build();
messageCtx.getConfigurationContext().getThreadPool().execute(
worker);
return;
}
We can see It has meant to build all.
Anyway having a method for build all is a useful feature :).
> A workaround would be to request the first child (so that the
> OMSourcedElement is expanded and a builder is created) before calling
> build().
>
ok. But this assumes OMSourcedElement is in the immediate child.
thanks,
Amila.
>
> 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]
>
>
--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/