I have a web service with an XML response mapped to a List element. Works great when the service returns more than 2 items. When the service returns 0 items, I get an error in appery.js (SCRIPT5007: Unable to get property 'length' of undefined or null reference appery.js, line 1000 character 21 ) and the service hangs. Note, when no items are returned, the XML response does not include the node for the array that is mapped to the List element.
When the service returns 1 item, the List item does not get populated either but no errors are logged. Have javascript on the list item and it is never invoked, thus assuming the mapping is not honored when one item is returned. The record Count attribute in the response and the XML response on the wire confirms the XML contains one item.
All of this worked when I had the service mapped to a Grid.
Is there something special about List elements when mapped to a service response?
What is expected behavior if XML response does not have the "array" that is mapped to the List element? I would expect the "code-behind JS" on the fields that do exist (such as a record count field in the XML response header) to be executed so that the situation can be properly dealt with. And in this case, expect the service
to return success or complete, as long as it returns and doesn't hang.
Thank you for your attention to this matter.