I have no experience with JSON at all, but I unfortunately have a webservice that returns data to me. I need to format the data from JSON into XML so that I can import into our own system here.
I receive the data from the Web Service in this format:
{
"httpStatusCode": 200,
"messages": [],
"succesfulResponses": [
{
"position": 0,
"response": {
"dln": "AAAPY459037VB9SV",
"dvlaServiceVersion": "1",
"hubServiceVersion": "1.0.0.0",
"dvlaProcessingDate": "2014-12-22T14:03:43.557Z",
"hubProcessingDate": "2015-05-29T16:50:51.4364004+01:00",
"licence": {
"status": "FC",
"validFrom": "1986-01-22",
"validTo": "2017-09-02",
"directiveIndicator": 0,
"entitlements": [
{
"code": "A",
"validFrom": null,
"validTo": null,
"priorTo": false,
"type": "F",
"restrictions": []
}
],
"endorsements": []
},
"httpStatusCode": 200,
}
"messages": []
}
],
"errorResponses": []
}
I tried to use the following using the Newtonsoft JSON.NET Program:
Dim doc As XmlDocument = DirectCast(JsonConvert.DeserializeXmlNode(sAnswer, "root"), XmlDocument)
Unfortunately it returned this:
2000AAAPY459037VB9SV11.0.0.02014-12-22T14:03:43.557Z2015-05-29T16:59:08.6833762+01:00FC1986-01-222017-09-020AfalseF200
Which is of no use to me at all, I need it to format the XML complete the node name / elements so that I can import this correctly, is anyone able to point me in the right direction?
Cheers,
J