I'm trying to fill a grid with data returned from a web service. The service is being called and returning the expected data but the grid remains empty. I suspect it has to do with the recordXPath I'm using but it seems quite simple. Can anyone spot what I'm doing wrong. Here is the code.
I've stepped through it in debug and it all appears to work correctly, just nothing showing up in the grid. Here is the response from the web service call.
As you can see there are lots of Store elements in the response but the recordXPath of "//Store" doesn't seem to be finding them.
Code:
XMLTools.loadWSDL(wsdlURL, new WSDLLoadCallback() { public void execute(WebService service) { if(service == null) { SC.warn("WSDL not available from "+ wsdlURL, new BooleanCallback() { public void execute(Boolean value) { } }); } inputDS = service.getInputDS("getStandardScales"); OperationBinding fetchBinding = new OperationBinding(); fetchBinding.setRecordXPath("//Store"); resultsDS = service.getFetchDS("getStandardScales", "StandardScaleStore", fetchBinding); setHeight("90%"); setWidth("100%"); form.setDataSource(inputDS); searchButton = new IButton("Search"); searchButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { resultsDS.fetchData(form.getValuesAsCriteria()); } }); grid = new ListGrid(); grid.setDataSource(resultsDS); setMembers(form, searchButton, grid); } });
Code:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getStandardScalesResponse xmlns:ns2="http://services.allocation.ipms.islandpacific.com/"><result><statusCode>Success</statusCode><statusMessage>Request completed successfully</statusMessage><StandardScale><Id>ALLO</Id><Description>ALLOCATION PLAN MOCK UP </Description><Store><Id>10000</Id><Value>650</Value></Store><Store><Id>10001</Id><Value>1133</Value></Store><Store><Id>10002</Id><Value>380</Value></Store><Store><Id>10003</Id><Value>399</Value></Store><Store><Id>11000</Id><Value>421</Value></Store><Store><Id>11001</Id><Value>435</Value></Store><Store><Id>11100</Id><Value>467</Value></Store><Store><Id>11101</Id><Value>360</Value></Store><Store><Id>12000</Id><Value>888</Value></Store><Store><Id>12001</Id><Value>395</Value></Store><Store><Id>13000</Id><Value>488</Value></Store><Store><Id>13001</Id><Value>687</Value></Store><Store><Id>13100</Id><Value>699</Value></Store><Store><Id>13101</Id><Value>400</Value></Store><Store><Id>14001</Id><Value>210</Value></Store><Store><Id>14000</Id><Value>640</Value></Store><Store><Id>15001</Id><Value>1157</Value></Store><Store><Id>15000</Id><Value>467</Value></Store><Store><Id>40001</Id><Value>367</Value></Store><Store><Id>40000</Id><Value>487</Value></Store><Store><Id>40003</Id><Value>375</Value></Store><Store><Id>40002</Id><Value>457</Value></Store><Store><Id>41001</Id><Value>360</Value></Store><Store><Id>41000</Id><Value>488</Value></Store><Store><Id>41102</Id><Value>410</Value></Store><Store><Id>41101</Id><Value>410</Value></Store><Store><Id>30000</Id><Value>484</Value></Store><Store><Id>20000</Id><Value>365</Value></Store><Store><Id>44410</Id><Value>311</Value></Store><Store><Id>15002</Id><Value>460</Value></Store><Store><Id>44412</Id><Value>465</Value></Store><Store><Id>44413</Id><Value>389</Value></Store><Store><Id>40</Id><Value>151</Value></Store><Store><Id>44411</Id><Value>439</Value></Store><Store><Id>8</Id><Value>133</Value></Store><Store><Id>87654</Id><Value>420</Value></Store></StandardScale></result></ns2:getStandardScalesResponse></soap:Body></soap:Envelope>
Comment