kcjoon / as3corelib

Automatically exported from code.google.com/p/as3corelib
0 stars 0 forks source link

cannot decode my JSON string ,which worked well on Extjs #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
JSON.decode(the blow string) will produce the error:
JSONParseError: Unexpected s encountered
    at
com.adobe.serialization.json::JSONTokenizer/parseError()[/Users/mesh/src/as3core
lib/src/com/adobe/serialization/json/JSONTokenizer.as:579]
    at
com.adobe.serialization.json::JSONTokenizer/getNextToken()[/Users/mesh/src/as3co
relib/src/com/adobe/serialization/json/JSONTokenizer.as:168]
    at
com.adobe.serialization.json::JSONDecoder/nextToken()[/Users/mesh/src/as3corelib
/src/com/adobe/serialization/json/JSONDecoder.as:83]
    at
com.adobe.serialization.json::JSONDecoder/parseObject()[/Users/mesh/src/as3corel
ib/src/com/adobe/serialization/json/JSONDecoder.as:139]
    at
com.adobe.serialization.json::JSONDecoder/parseValue()[/Users/mesh/src/as3coreli
b/src/com/adobe/serialization/json/JSONDecoder.as:202]
    at
com.adobe.serialization.json::JSONDecoder()[/Users/mesh/src/as3corelib/src/com/a
dobe/serialization/json/JSONDecoder.as:61]
    at
com.adobe.serialization.json::JSON$/decode()[/Users/mesh/src/as3corelib/src/com/
adobe/serialization/json/JSON.as:78]
    at test1/onJSONLoad()[D:\Documents and Settings\gzg\My Documents\Flex
Builder 3\test1\src\test1.mxml:15]
    at test1/__service_result()[D:\Documents and Settings\gzg\My
Documents\Flex Builder 3\test1\src\test1.mxml:42]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
mx.rpc.http.mxml::HTTPService/http://www.adobe.com/2006/flex/mx/internal::dispat
chRpcEvent()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\http\mxml\HTT
PService.as:290]
    at
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandle
r()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:193
]
    at
mx.rpc::Responder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc
\Responder.as:43]
    at
mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0\frameworks\projects\rpc\sr
c\mx\rpc\AsyncRequest.as:74]
    at
DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.2.0\frameworks\proje
cts\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:403]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

{success:true,message:'',total:4,fieldDefs:
[{name:'dataId',type:'string',dataIndex:'dataId',header:'dataId',hidden:true},
{name:'userName',type:'string',dataIndex:'userName',header:'userName'},
{name:'realName',type:'string',dataIndex:'realName',header:'realName'},
{name:'applicationName',type:'string',dataIndex:'applicationName',header:'applic
ationName'},
{name:'email',type:'string',dataIndex:'email',header:'电子邮件地址'},
{name:'ipAddress',type:'string',dataIndex:'ipAddress',header:'ipAddress'},
{name:'comment',type:'string',dataIndex:'comment',header:'说明'},
{name:'password',type:'string',dataIndex:'password',header:'口令'},
{name:'passwordQuestion',type:'string',dataIndex:'passwordQuestion',header:'pass
wordQuestion'},{name:'passwordAnswer',type:'string',dataIndex:'passwordAnswer',h
eader:'passwordAnswer'},{name:'isApproved',type:'string',dataIndex:'isApproved',
header:'isApproved'},{name:'lastActivityDate',type:'date',dataIndex:'lastActivit
yDate',header:'lastActivityDate'},{name:'lastLoginDate',type:'date',dataIndex:'l
astLoginDate',header:'lastLoginDate'},{name:'lastPasswordChangedDate',type:'date
',dataIndex:'lastPasswordChangedDate',header:'lastPasswordChangedDate'},{name:'c
reationDate',type:'date',dataIndex:'creationDate',header:'creationDate'},{name:'
isOnLine',type:'string',dataIndex:'isOnLine',header:'isOnLine'},{name:'isLockedO
ut',type:'string',dataIndex:'isLockedOut',header:'isLockedOut'},{name:'lastLocke
dOutDate',type:'date',dataIndex:'lastLockedOutDate',header:'lastLockedOutDate'},
{name:'failedPasswordAttemptCount',type:'string',dataIndex:'failedPasswordAttemp
tCount',header:'failedPasswordAttemptCount'},{name:'failedPasswordAttemptWindowS
tart',type:'date',dataIndex:'failedPasswordAttemptWindowStart',header:'failedPas
swordAttemptWindowStart'},{name:'failedPasswordAnswerAttemptCount',type:'string'
,dataIndex:'failedPasswordAnswerAttemptCount',header:'failedPasswordAnswerAttemp
tCount'},{name:'failedPasswordAnswerAttemptWindowStart',type:'date',dataIndex:'f
ailedPasswordAnswerAttemptWindowStart',header:'failedPasswordAnswerAttemptWindow
Start'}],data:[{"applicationName":"","comment":"","creationDate":"Tue
Oct 14 2008 14:00:00
CST","dataId":"ab088490-f4c1-47d2-8180-604a31f9fe8f","email":"sss","failedPasswo
rdAnswerAttemptCount":0,"failedPasswordAnswerAttemptWindowStart":"null","failedP
asswordAttemptCount":0,"failedPasswordAttemptWindowStart":"null","ipAddress":"",
"isApproved":"0","isLockedOut":"1","isOnLine":"
","lastActivityDate":"null","lastLockedOutDate":"null","lastLoginDate":"null","l
astPasswordChangedDate":"null","password":"002","passwordAnswer":"","passwordQue
stion":"","realName":"dff","userName":"1we"},{"applicationName":"","comment":"",
"creationDate":"Tue
Oct 7 2008 00:00:00
CST","dataId":"baa04cdc-ddd5-49cf-9cf3-3d7d50eb00ef","email":"301","failedPasswo
rdAnswerAttemptCount":0,"failedPasswordAnswerAttemptWindowStart":"null","failedP
asswordAttemptCount":0,"failedPasswordAttemptWindowStart":"null","ipAddress":"",
"isApproved":"1","isLockedOut":"1","isOnLine":"
","lastActivityDate":"null","lastLockedOutDate":"null","lastLoginDate":"null","l
astPasswordChangedDate":"null","password":"301","passwordAnswer":"","passwordQue
stion":"","realName":"
首长301","userName":"202"},
{"applicationName":"","comment":"","creationDate":"Tue Nov 11 2008 10:37:02
CST","dataId":"974d8c62-da14-4989-b94a-1400dc989a77","email":"asd","failedPasswo
rdAnswerAttemptCount":0,"failedPasswordAnswerAttemptWindowStart":"Tue
Nov 11 2008 10:37:02
CST","failedPasswordAttemptCount":0,"failedPasswordAttemptWindowStart":"Tue
Nov 11 2008 10:37:02
CST","ipAddress":"","isApproved":"1","isLockedOut":"1","isOnLine":"
","lastActivityDate":"Tue Nov 11 2008 10:37:02
CST","lastLockedOutDate":"Tue Nov 11 2008 10:37:02
CST","lastLoginDate":"Tue Nov 11 2008 10:37:02
CST","lastPasswordChangedDate":"Tue Nov 11 2008 10:37:02
CST","password":"1","passwordAnswer":"","passwordQuestion":"","realName":"dsf","
userName":""},{"applicationName":"","comment":"","creationDate":"Wed
Nov 12 2008 00:00:00
CST","dataId":"b52d033a-2b33-4bcd-910f-247eeee8d9f6","email":"lixuexin@yinghuan.
com","failedPasswordAnswerAttemptCount":0,"failedPasswordAnswerAttemptWindowStar
t":"Wed
Nov 12 2008 15:24:03
CST","failedPasswordAttemptCount":0,"failedPasswordAttemptWindowStart":"Wed
Nov 12 2008 15:24:03
CST","ipAddress":"","isApproved":"1","isLockedOut":"0","isOnLine":"
","lastActivityDate":"Wed Nov 12 2008 15:24:03
CST","lastLockedOutDate":"Wed Nov 12 2008 15:24:03
CST","lastLoginDate":"Wed Nov 12 2008 15:24:03
CST","lastPasswordChangedDate":"Wed Nov 12 2008 15:24:03
CST","password":"lxx","passwordAnswer":"","passwordQuestion":"","realName":"lxx"
,"userName":"leeson"}]}

Original issue reported on code.google.com by guzhig...@gmail.com on 5 Dec 2008 at 7:18

GoogleCodeExporter commented 8 years ago
The JSON string you're trying to decode does not conform to the syntax 
specified at
json.org.  Specifically, { success:true } should have been encoded as {
"success":true } per the spec.

Original comment by darron.schall on 10 Dec 2008 at 4:46

GoogleCodeExporter commented 8 years ago
Thanks for your time! I know it.

Original comment by guzhig...@gmail.com on 25 Dec 2008 at 7:19

GoogleCodeExporter commented 8 years ago
hi can u please find the error in this Json result i could not able to trace 
out.

{ "SrchResults":[ {"FeatCount":"1"},{
"DESCRIPTION":"","PHOTOURL":"","HYPERLINK":"","ADDRESSTYPE":"","ADDRESSBLOCKHOUS
ENUMBER":"6","ADDRESSSTREETNAME":"Palm
Road","ADDRESSFLOORNUMBER":"","ADDRESSUNITNUMBER":"","ADDRESSBUILDINGNAME":"","A
DDRESSPOSTALCODE":"456441","LANDXADDRESSPOINT":"","LANDYADDRESSPOINT":"","NAME":
"Siglap
South Community Centre
Hall","XY":"38836.53569571,32865.17891036","ICON_NAME":"auditorium.png"}]}

Original comment by rajh...@gmail.com on 21 Jan 2010 at 10:02