0 Replies Latest reply on Sep 12, 2007 2:02 PM by bitwyse

    e4x question

    bitwyse Level 1
      I have a webservice that returns some data as e4x. I have code in the result handler that pulls some values. for example:
      public function wsResultHandler() : void
      var firstName : String;

      if( someWebService.someFetchFunction.lastResult..firstName == null )
      firstName = "default name";
      firstName = someWebService.someFetchFunction.lastResult..firstName;


      If the webservice doesn't return any data firstName is null yet when I test if it's null it fails and goes to the else condition.

      When I debug the code and check the lastResult this is what I see:
      <FetchfrmContactResponse xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:DefaultNamespace">
      <FetchfrmContactReturn xsi:nil="true"/>

      any thoughts? How can I test if the webservice doesn't return any data?