7 Replies Latest reply on Dec 6, 2011 4:25 AM by Claudiu Ursica

    Handling ByteArray received through web service

    Abhay001

      Hi,

       

      I am calling a web service in my current desktop AIR application. That web service which takes the document or file ID as input returns the following

      • document name - String
      • document owner - String
      • date created - Date
      • document data - ByteArray
      • document size - int

       

      I have just put one line in the result handler ---- documentDetails = event.result as ArrayCollection

      How do I handle this ByteArray form data in the result handler of the web service. Before I do anything I am getting this error -

       

      ReferenceError: Error #1065: Variable ByteArray is not defined.

      at global/flash.utils::

      getDefinitionByName()
      at com.adobe.serializers.utility::TypeUtility$/assignProperty()[C:\depot\flex\ide_trunk\ide_ builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\utility\TypeUtil ity.as:593]
      at com.adobe.serializers.utility::TypeUtility$/convertToStrongType()[C:\depot\flex\ide_trunk \ide_builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\utility\Typ eUtility.as:562]
      at com.adobe.serializers.utility::TypeUtility$/convertListToStrongType()[C:\depot\flex\ide_t runk\ide_builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\utility \TypeUtility.as:518]
      at com.adobe.serializers.utility::TypeUtility$/convertResultHandler()[C:\depot\flex\ide_trun k\ide_builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\utility\Ty peUtility.as:431]
      at mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::processResult()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\rpc\soap\Operation.as:953]
        at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:313]
        at mx.rpc::Responder/result()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\rpc\Responder.as:5 6]
      at mx.rpc::AsyncRequest/acknowledge()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\rpc\AsyncR equest.as:84]
      at DirectHTTPMessageResponder/completeHandler()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\ messaging\channels\DirectHTTPChannel.as:451]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/onComplete()

       

      Any guidance/redirecting me to the right source of information would be highly appreciated. I have googled but not able to resolve this error.

      Please help!

       

      Regards,

      Abhay

       

      PS: I am using Flash Builder 4.5.1 with Flex 4.5 SDK