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

Reply via email to