2016-03-30 62 views
0

請找我下面的JSON響應意外元素:CDATA在驗證響應

{"birthday": "1991-09-09","familyName": "abcdefgh", "profiles": [], "title": "Mr","id": 123456,"middleName": null,"emailVerified": "2016-01-27 15:45:03 +0000", "primaryAddress": {"company": null, "address2": null,"stateAbbreviation": null,"zipPlus4": null,"city": null,"address1": null,"phone": null, "zip": null,"mobile": null,"country": null},"gender": null,"lastUpdated": "2016-02-22 05:31:30.678332 +0000","assignedRoles":[{"relatedManagedObject": "/abcdefgh/abcdefgh/123456789","roleType": "EndUser","createdDateTime": "2014-03-07 15:43:00 +0000","managedObject": "/abcdefgh/subscribers/44123456789","id": 11010,"label": "44123456789","endDate": null},{"roleType": "LegalOwner","createdDateTime": "2016-03-07 15:43:00 +0000","managedObject": "/abcdefgh/abcdefgh/123456789","id": 11010,"label": "123456789","endDate": null}],"password": null,"photos": [],"email": "abcd.in","givenName": "abcd","currentLocation": null,"deactivateAccount": null,"lastLogin": null,"created": "2016-02-24 19:18:54.415972 +0000","displayName": null,"uuid": "fgisdufuidsfgrughkurhgkufhghfughdfklh","aboutMe": null,"display": null,"statuses": []} 

每當我試圖在SOAP驗證我得到驗證錯誤爲意想不到的元素:CDATA

可否請你指導這

回答

0

你的json格式是錯誤的..如果你粘貼你的回覆jsonlint.com,你會看到..

例如,

birthday: 1991 - 09 - 09, 
familyName: abcdefg 

應該是:

"birthday": "1991-09-09", 
"familyName": "abcdefg" 

注意引號。所以重新格式化你的JSON,看看會發生什麼

+0

嗨 請找到更新的代碼, 我的壞,我沒有沒有正確地上傳它在堆棧上。 感謝您指出,但我仍然面臨同樣的問題 – wilfredclement7

+0

您更新的json是有效的..所以問題不在於這個字符串。你能發表其他相關的代碼嗎? –

+0

這是我的唯一回應。 – wilfredclement7