【问题标题】:Unexpected Element : CDATA while validating response意外元素:验证响应时的 CDATA
【发布时间】:2016-07-18 03:48:06
【问题描述】:

请在我的 json 回复下方找到

{"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 中验证时,我都会收到验证错误,因为 unexpected element : CDATA

你能指导一下吗

【问题讨论】:

    标签: json xml validation soap cdata


    【解决方案1】:

    您的 json 格式错误..如果您将回复粘贴到 jsonlint.com,您会看到..

    例如,

    birthday: 1991 - 09 - 09,
    familyName: abcdefg
    

    应该是:

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

    注意引号。所以重新格式化你的 json 看看会发生什么

    【讨论】:

    • 嗨,请找到更新的代码,我没有正确地将它上传到堆栈上。感谢您指出这一点,但是我仍然面临同样的问题
    • 您更新的 json 是有效的。所以问题根本不在于这个字符串。可以发一下其他相关代码吗?
    • 这是我唯一的回应。
    • 好的,但是在解析或发送时必须得到这个错误?
    • 不,我只是尝试在 SOAP 中验证它,所以当我右键单击并验证它时,我得到了错误
    猜你喜欢
    • 1970-01-01
    • 2011-11-23
    • 1970-01-01
    • 1970-01-01
    • 2010-11-27
    • 2018-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多