2 Replies Latest reply on Jul 13, 2011 12:43 PM by Daniel Pride

    Soap Null Error

    Daniel Pride Level 1

      The following response handled with the code below causes the error at the bottom when no records are in the response.

      Is this a problem with the XML or the code?

      How do I get around it?

      Thanks

       

      ********************************

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope
        SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <SOAP-ENV:Body>
          <ns1:WbSc_Repr_RepairDetailResponse xmlns:ns1="http://www.4d.com/namespace/default">
            <RepairDetails xsi:type="xsd:anyType"/>
          </ns1:WbSc_Repr_RepairDetailResponse>
        </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

       

      ********************************

      protected function WbSc_Repr_RepairDetailResult_resultHandler(event:ResultEvent):void
                  {   
                     
                       if (event.result.RepairDetails is ArrayCollection){
                          repairDetails =  event.result.RepairDetails as ArrayCollection;
                      } else
                      {
                          repairDetails =  new ArrayCollection([event.result.RepairDetails]);
                      }
                  }

      **********************************

       

      ReferenceError: Error #1069: Property RepairDetails not found on String and there is no default value.
          at components::Onsite/WbSc_Repr_RepairDetailResult_resultHandler()
          at components::Onsite/__WbSc_Repr_RepairDetailResult_result()
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.rpc::CallResponder/result()
          at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()
          at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
          at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
          at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
          at mx.rpc::Responder/result()
          at mx.rpc::AsyncRequest/acknowledge()
          at DirectHTTPMessageResponder/completeHandler()
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at flash.net::URLLoader/onComplete()