12 Replies Latest reply on Feb 3, 2011 10:23 AM by JoshBeall

    empty JSON response can't be serialized

    carstephun Level 1

      Hi,

       

      FB4 B2

       

      I was getting an error from JSONSerializer object when the returned array has no elements inside. the returned JSON encoded raw data is a simple array representation: []. Is there anything I'm doing wrong, server side is php and I'm using PHP's json_encoder function. When I have elements inside the serializer works well.

       

      r. Sandor

       

      Error:

       

      Error: Error while Parsing

      at com.adobe.serializers.json::JSONDecoder/parseValue()[C:\perforceGAURAVP01\depot\flex\ide_ builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\json\JSONDecoder .as:249]

      at com.adobe.serializers.json::JSONDecoder/parseArray()[C:\perforceGAURAVP01\depot\flex\ide_ builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\json\JSONDecoder .as:431]

      at com.adobe.serializers.json::JSONDecoder/parseValue()[C:\perforceGAURAVP01\depot\flex\ide_ builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\json\JSONDecoder .as:221]

      at com.adobe.serializers.json::JSONDecoder/decode()[C:\perforceGAURAVP01\depot\flex\ide_buil der\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\json\JSONDecoder.as: 178]

      at com.adobe.serializers.json::JSONSerializationFilter/deserializeResult()[C:\perforceGAURAV P01\depot\flex\ide_builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serialize rs\json\JSONSerializationFilter.as:102]

      at mx.rpc.http::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::processResult()[E:\dev\gumbo_beta2\frameworks\ projects\rpc\src\mx\rpc\http\AbstractOperation.as:929]

      at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\gumbo_beta2\frameworks\ projects\rpc\src\mx\rpc\AbstractInvoker.as:313]

      at mx.rpc::Responder/result()[E:\dev\gumbo_beta2\frameworks\projects\rpc\src\mx\rpc\Responde r.as:56]

      at mx.rpc::AsyncRequest/acknowledge()[E:\dev\gumbo_beta2\frameworks\projects\rpc\src\mx\rpc\ AsyncRequest.as:84]

      at DirectHTTPMessageResponder/completeHandler()[E:\dev\gumbo_beta2\frameworks\projects\rpc\s rc\mx\messaging\channels\DirectHTTPChannel.as:446]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at flash.net::URLLoader/onComplete()