You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by pattabi <Pa...@aig.com> on 2009/05/19 02:30:26 UTC
Problem accessing child attributes
Hi,
I am populating my Xmlbean as follows:
ReqPayLoadType pyload = ReqPayLoadType.Factory.parse(payload);
When I save the bean to the outputstream, I am able to see the XML but when
I access,
pyload.getDecisionServiceRq(), I am getting Nullpointer Exception. Guess it
is not a unique problem. Could anyone help me solve this? Thanks
<ds1:payLoadRq xsi:schemaLocation="http://decisionserviceapp
DecisionServices.xsd" xmlns:ds1="http://decisionserviceapp"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ds1:DecisionServiceRq>
<ds1:Addr>
<ds1:LocationID>String</ds1:LocationID>
<ds1:Addr1>String</ds1:Addr1>
<ds1:Addr2>String</ds1:Addr2>
<ds1:Addr3>String</ds1:Addr3>
<ds1:Addr4>String</ds1:Addr4>
<ds1:City>String</ds1:City>
<ds1:StateProvCd>String</ds1:StateProvCd>
<ds1:PostalCode>String</ds1:PostalCode>
</ds1:Addr>
<ds1:effectiveDate>2001-12-17T09:30:47.0Z</ds1:effectiveDate>
<ds1:action>list</ds1:action>
</ds1:DecisionServiceRq>
</ds1:payLoadRq>
--
View this message in context: http://www.nabble.com/Problem-accessing-child-attributes-tp23607645p23607645.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org
Re: Problem accessing child attributes
Posted by Christian Kaltepoth <ch...@kaltepoth.de>.
Hi,
you could try to use the corresponding document class for parsing the document
instead of ReqPayLoadType. Something like this:
ReqPayLoadDocument doc = ReqPayLoadDocument.Factory.parse(payload);
DecisionServiceReqType decReq = doc.getReqPayLoad().getDecisionServiceRq();
The exact class name depends on you schema.
Kind regards
Christian
On Tuesday 19 May 2009 11:29:50 pattabi wrote:
> I found that get_store().find_element_user is returning null.
> I even tried setLoadSubstituteNamespaces but with no luck.
>
> pattabi wrote:
> > Hi,
> > I am populating my Xmlbean as follows:
> >
> > ReqPayLoadType pyload = ReqPayLoadType.Factory.parse(payload);
> >
> > When I save the bean to the outputstream, I am able to see the XML but
> > when I access,
> > pyload.getDecisionServiceRq(), I am getting Nullpointer Exception. Guess
> > it is not a unique problem. Could anyone help me solve this? Thanks
> >
> > <ds1:payLoadRq xsi:schemaLocation="http://decisionserviceapp
> > DecisionServices.xsd" xmlns:ds1="http://decisionserviceapp"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> > <ds1:DecisionServiceRq>
> > <ds1:Addr>
> > <ds1:LocationID>String</ds1:LocationID>
> > <ds1:Addr1>String</ds1:Addr1>
> > <ds1:Addr2>String</ds1:Addr2>
> > <ds1:Addr3>String</ds1:Addr3>
> > <ds1:Addr4>String</ds1:Addr4>
> > <ds1:City>String</ds1:City>
> > <ds1:StateProvCd>String</ds1:StateProvCd>
> > <ds1:PostalCode>String</ds1:PostalCode>
> > </ds1:Addr>
> > <ds1:effectiveDate>2001-12-17T09:30:47.0Z</ds1:effectiveDate>
> > <ds1:action>list</ds1:action>
> > </ds1:DecisionServiceRq>
> > </ds1:payLoadRq>
--
Christian Kaltepoth
Blog: http://chkal.blogspot.com/
Twitter: http://twitter.com/chkal
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org
Re: Problem accessing child attributes
Posted by pattabi <Pa...@aig.com>.
I found that get_store().find_element_user is returning null.
I even tried setLoadSubstituteNamespaces but with no luck.
pattabi wrote:
>
> Hi,
> I am populating my Xmlbean as follows:
>
> ReqPayLoadType pyload = ReqPayLoadType.Factory.parse(payload);
>
> When I save the bean to the outputstream, I am able to see the XML but
> when I access,
> pyload.getDecisionServiceRq(), I am getting Nullpointer Exception. Guess
> it is not a unique problem. Could anyone help me solve this? Thanks
>
> <ds1:payLoadRq xsi:schemaLocation="http://decisionserviceapp
> DecisionServices.xsd" xmlns:ds1="http://decisionserviceapp"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <ds1:DecisionServiceRq>
> <ds1:Addr>
> <ds1:LocationID>String</ds1:LocationID>
> <ds1:Addr1>String</ds1:Addr1>
> <ds1:Addr2>String</ds1:Addr2>
> <ds1:Addr3>String</ds1:Addr3>
> <ds1:Addr4>String</ds1:Addr4>
> <ds1:City>String</ds1:City>
> <ds1:StateProvCd>String</ds1:StateProvCd>
> <ds1:PostalCode>String</ds1:PostalCode>
> </ds1:Addr>
> <ds1:effectiveDate>2001-12-17T09:30:47.0Z</ds1:effectiveDate>
> <ds1:action>list</ds1:action>
> </ds1:DecisionServiceRq>
> </ds1:payLoadRq>
>
--
View this message in context: http://www.nabble.com/Problem-accessing-child-attributes-tp23607645p23612738.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org