Thanks for the input, Radu. We are using Apache Axis and the services
generates the envelope without the namespace for troubled areas. Same
behavior with other web service engine such as IBM.

As a work around, I will use xmlCursor for the troubled areas. Thanks
again.

-Muthu 

-----Original Message-----
From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 01, 2008 3:24 PM
To: [email protected]
Subject: RE: Name/Value Pair Issue.

Well, the namespace URI is part of the name of the element, so really it
is an error on the part of the sender to send a document that doesn't
match the Schema in such a significant way. My advice would then be to
get the sender to fix their messages, or maybe you don't have the
correct Schema from the sender.

XmlBeans does have a method XmlOptions.setLoadSubstituteNamespaces()
that sometimes is able to work around namespace issues, but in your
case, not _all_ elements from the "urn:SkuInventory" need their
namespace changed, but only _some_ of them. I don't see how one could
tell which are correct and which need to change.

So if you can't get an updated Schema that matches the documents, you
need to switch to using DOM or XmlCursor when you reach the problematic
part. The good news is that XMLBeans implements DOM natively so there is
no "conversion" necessary to use DOM.

Hope this helps,
Radu

On Thu, 2008-01-31 at 18:42 -0800, Muthu Ramaswamy wrote:
> Radu-
> 
> You could give me some advise. The following file works with the 
> generated XMLBeans:
> 
> <?xml version="1.0" encoding="UTF-8"?> <getSkuInventoryListResponse 
> xmlns="urn:SkuInventory"
>                   xmlns:apachesoap="http://xml.apache.org/xml-soap"; 
>  
> xmlns:tns1="http://util.skuinventory.webservice.app.dd"; 
>  
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>       <getSkuInventoryListReturn>My Sample</getSkuInventoryListReturn>
>       <returnListQty>
>               <tns1:skuInvMap>
>                       <apachesoap:item>
>                               <apachesoap:key>Item1</apachesoap:key>
>                               <apachesoap:value>123</apachesoap:value>
>                       </apachesoap:item>
>                       <apachesoap:item>
>                               <apachesoap:key>Item3</apachesoap:key>
>                               <apachesoap:value>456</apachesoap:value>
>                       </apachesoap:item>
>               </tns1:skuInvMap>
>       </returnListQty>
> </getSkuInventoryListResponse>
> 
> However, the following file DOES NOT work with the generated xmlbeans:
> 
> <?xml version="1.0" encoding="UTF-8"?> <getSkuInventoryListResponse 
> xmlns="urn:SkuInventory"
>                   xmlns:apachesoap="http://xml.apache.org/xml-soap"; 
>  
> xmlns:tns1="http://util.skuinventory.webservice.app.dd"; 
>  
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>       <getSkuInventoryListReturn>My Sample</getSkuInventoryListReturn>
>       <returnListQty>
>               <tns1:skuInvMap>
>                       <item>
>                               <key>Item1</key>
>                               <value>123</value>
>                       </item>
>                       <item>
>                               <key>Item3</key>
>                               <value>456</value>
>                       </item>
>               </tns1:skuInvMap>
>       </returnListQty>
> </getSkuInventoryListResponse>
> 
> Note: The difference is, <item> is not prefixed by the namespace:
> <apachesoap:item>. This output is what I get from web services.
> 
> The request payload that I get from Web services doesn't prefix the 
> namespace. So, the name/value pair is null but I can see the content 
> through XMLCursor. Is there a way to ignore the namespace while 
> loading into xmlbeans for <tns1:skuInvMap>?
> 
> Appreciate your input. Thanks.
> 
> -Muthu
> 
>  
> 
> -----Original Message-----
> From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 28, 2008 5:34 PM
> To: [email protected]
> Subject: RE: Name/Value Pair Issue.
> 
> Yes, you can send it to me in private and I will take a look at it.
> 
> Radu
> 
> On Mon, 2008-01-28 at 17:29 -0800, Muthu Ramaswamy wrote:
> > Well, I used the same schema file to generate the java classes using

> > scomp and the same schema to generate a sample xml file. So, they 
> > both
> 
> > match.
> > 
> > Can I send you my xsd files for you to review? Thanks.
> > 
> > -Muthu
> > 
> > -----Original Message-----
> > From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED]
> > Sent: Monday, January 28, 2008 5:22 PM
> > To: [email protected]
> > Subject: Re: Name/Value Pair Issue.
> > 
> > Most likely, this is because your Schema (that you generated the 
> > Java classes from) doesn't match your payload. Check that the 
> > namespace URIs match.
> > 
> > Radu
> > 
> > On Mon, 2008-01-28 at 17:19 -0800, Muthu Ramaswamy wrote:
> > > Hi All-
> > > 
> > > I am new to XMlBeans. When I tried to use a sample XML file that 
> > > contains name/value pair, I can read the data only using
XmlCursor.
> > > When I use the java objects that got created using scomp, the 
> > > length
> 
> > > of array is 0 and the name/value pair cannot be retrieved as it is

> > > null. But, the dump method shows the xml content but the getter 
> > > methods using the java objects are not working. Any ideas?
> > > 
> > > XMlBeans Version: 
> > > ---------------------
> > > Apache Software Foundation, org.apache.xmlbeans.XmlBeans version
> > > 2.3.0-r540734
> > > 
> > > Sample Payload: 
> > > -------------------
> > > <p704:getSkuInventoryListResponse xmlns:p704="urn:SkuInventory">
> > > <p704:getSkuInventoryListReturn>123 Service Ack. 456 Service Ack.
> > > </p704:getSkuInventoryListReturn>
> > > <p704:returnListQty>
> > > <p909:skuInvMap
> > > xmlns:p909="http://util.skuinventory.webservice.app.dd";>
> > > <item>
> > > <key xsi:type="xsd:string">123</key> <value 
> > > xsi:type="xsd:string">101</value> </item> <item> <key 
> > > xsi:type="xsd:string">456</key> <value 
> > > xsi:type="xsd:string">101</value> </item> </p909:skuInvMap> 
> > > </p704:returnListQty> </p704:getSkuInventoryListResponse>
> > > 
> > > Here is the sample code: 
> > > //process response document
> > > GetSkuInventoryListResponseDocument response = 
> > > getSkuInventoryListResponseDocument(result);
> > > SkuInventoryMap resMap =
> > > response.getGetSkuInventoryListResponse().getReturnListQty();
> > > MapItem[] array = resMap.getSkuInvMap().getItemArray();
> > > System.out.println(array.length);
> > > Response.dump();
> > > 
> > > Here is the dump call output: 
> > > ROOT (USER) *:R:<cur>[0] (DocumentXobj) 
> > >     ELEM p704:[EMAIL PROTECTED]:SkuInventory
> > > (ElementXobj) 
> > >       ATTR xmlns:[EMAIL PROTECTED]://www.w3.org/2000/xmlns/
> > > Value( "urn:SkuInventory" ) (AttrXobj) 
> > >       ELEM p704:[EMAIL PROTECTED]:SkuInventory Value(
> > > "123
> > 
> > > Service Ack. 456 Service Ack. " ) (ElementXobj)
> > >       ELEM p704:[EMAIL PROTECTED]:SkuInventory (ElementXobj) 
> > >         ELEM
> > > p909:[EMAIL PROTECTED]://util.skuinventory.webservice.app.dd
> > > (ElementXobj) 
> > >           ATTR xmlns:[EMAIL PROTECTED]://www.w3.org/2000/xmlns/
> > > Value( "http://util.skuinventory.webservice...."; ) (AttrXobj) 
> > >           ELEM item (ElementXobj) 
> > >             ELEM key (ElementXobj) 
> > >               ATTR
> > > xsi:[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema-instance
> > > Value( "xsd:string" ) After( "123" ) (AttrXobj) 
> > >             ELEM value (ElementXobj) 
> > >               ATTR
> > > xsi:[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema-instance
> > > Value( "xsd:string" ) After( "101" ) (AttrXobj) 
> > >           ELEM item (ElementXobj) 
> > >             ELEM key (ElementXobj) 
> > >               ATTR
> > > xsi:[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema-instance
> > > Value( "xsd:string" ) After( "456" ) (AttrXobj) 
> > >             ELEM value (ElementXobj) 
> > >               ATTR
> > > xsi:[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema-instance
> > > Value( "xsd:string" ) After( "101" ) (AttrXobj)
> > > 
> > > 
> > > The array lenegth is 0 but when I say, response.dump(), I can see 
> > > the xml output on the screen.
> > > 
> > > Question? Why is the name/value pair null while the xmlcursor 
> > > shows the content is valid.
> > > 
> > > Appreciate your input. Thanks.
> > > 
> > > -Muthu
> > > 
> > 
> > Notice:  This email message, together with any attachments, may 
> > contain information  of  BEA Systems,  Inc.,  its subsidiaries  and 
> > affiliated entities,  that may be confidential,  proprietary, 
> > copyrighted  and/or legally privileged, and is intended solely for 
> > the
> 
> > use of the individual or entity named in this message. If you are 
> > not the intended recipient, and have received this message in error,

> > please immediately return this by email and then delete it.
> > 
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> > 
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> Notice:  This email message, together with any attachments, may 
> contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  
> affiliated entities,  that may be confidential,  proprietary,  
> copyrighted  and/or legally privileged, and is intended solely for the

> use of the individual or entity named in this message. If you are not 
> the intended recipient, and have received this message in error, 
> please immediately return this by email and then delete it.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to