0 Replies Latest reply on Nov 17, 2009 12:14 PM by liquid8x

    HTTPService returning only the header of xml

    liquid8x

      Hi all,

       

      Could someone advice me how to handle the following situation:

       

      I am sending a HTTPService-request which fetches xml-data via php-file.

      The php starts by printing the first xml-line:

       

      print "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<group_members>\n";

       

      After this it makes a database search via id-parameter (recieved from the request) and creates the xml-data with loop-structure.

      Then it closes the <group_members> -tag.

       

      In flex resulthandler the xml-result is then moved to an arraycollection simply like this:

       

      groupMembersData = event.result.group_members.member;

       

      Now this works fine IF php actually finds data for the recieved ID.

      How could I handle a situation where there is no data found?

      At the moment I am getting this error:

       

      "TypeError: Error #1009: Cannot access a property or method of a null object reference."    

       

      So the error appears if the recieved data is not structured correctly for an arraycollection.

      There is some data recieved (the header of xml and starting and ending <group_members>-tag)

       

      Any ideas?