This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- FlexNet Operations
- :
- FlexNet Operations Forum
- :
- Deserialization Issu
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Oct 19, 2020
08:42 PM
Deserialization Issu
Hi,
I am receiving a successful response both in Postman and using C# from Visual Studio, when polling for update information. However I can't seem to de-serialize the result from the "get " in C#.
The response is shown below. The associated classes were generated by the site https://json2csharp.com/ based on the response below from Postman. I made the classes Public.
In C# I use:
string uri = "uai/2.0/updates/" + retString; //retString value comes from the response of the Post for updates.
response = client.GetAsync(uri).Result;
var value = JsonConvert.DeserializeObject<MyRoot>(
response.Content.ReadAsStringAsync().Result);
The result is 202-ok, however the response in the structure is nulls. Do you know why?
Thank you,
Ken
Flexera Response
{
"updateItems": [
{
"commandLine": "",
"description": "We speak English!",
"expireDate": "10/04/2029",
"fromPackageId": "Revenera 2020 Base Test",
"updateId": "ReveneraTest",
"languageCode": 1033,
"updateName": "ReveneraTest",
"productName": "",
"startDate": "09/01/2020",
"title": "English",
"toPackageId": "Revenera 2020 test",
"manifestUUID": "424e21ee-ee83-4580-9819-bfa52d4d547e"
}
],
"error": {
"key": "",
"message": "",
"arguments": ""
}
}
namespace Revenera2 { public class MyRoot { public List<UpdateItem> updateItems { get; set; } public Error error { get; set; } } }
namespace Revenera2 { public class Error { public string key { get; set; } public string message { get; set; } public string arguments { get; set; } } }
namespace Revenera2 { public class UpdateItem { public string commandLine { get; set; } public string description { get; set; } public string expireDate { get; set; } public string fromPackageId { get; set; } public string updateId { get; set; } public int languageCode { get; set; } public string updateName { get; set; } public string productName { get; set; } public string startDate { get; set; } public string title { get; set; } public string toPackageId { get; set; } public string manifestUUID { get; set; } } }
(1) Reply