41
Views
8
Comments
Solved
[XML Records] XmlRecords - Error:Not able to deserialize type ...BasicTypeList`1[System.String]
Question
xml-records
Service icon
Forge component by Afonso Carvalho
Application Type
Service

I have an issue with the xmlRecords extention.

I need to deserialize a xml message with following content:

for example:

 

The structure I have is: 

The error I get is: 

Unable to convert xml value to structure type. Element: AddressLine; Value: Klappijstraat 12; Error:Not able to deserialize type OutSystems.HubEdition.RuntimePlatform.Db.BasicTypeList`1[System.String]

Thank you for helping me out.

I really appreciate it.

Kind regards

Johan

XMLAttributes.oml
Solution

Hello Johan,

I believe the issue is with the Address Line defined as a Text List. Take a look at the example module in this thread.

The issue there is slightly different than yours, but the logic to build the Structure required to parse your XML should be very similar - the RestaurantAreas/RestaurantAreaCodeId section is very similar to your MailAddress/AddressLine section.

Let me know if the Structure construction is still unclear.

Johan, I believe the issue presented in that thread is the solution, so I'm marking this post - but please let me know if it did not help you, or if the issue remains.

Hello Johan,

The fast way to do it is convert to JSON and then to RecordList.

Using the Forge Component XML to JSON


Leave the OML here, if this is not a solution, need more time to explore the error.

XMLAttributes.oml
Solution

Hello Johan,

I believe the issue is with the Address Line defined as a Text List. Take a look at the example module in this thread.

The issue there is slightly different than yours, but the logic to build the Structure required to parse your XML should be very similar - the RestaurantAreas/RestaurantAreaCodeId section is very similar to your MailAddress/AddressLine section.

Let me know if the Structure construction is still unclear.

Johan, I believe the issue presented in that thread is the solution, so I'm marking this post - but please let me know if it did not help you, or if the issue remains.

Hello @Afonso Carvalho,

I am facing the same issue I think with this xml:
<to_road>
<road> 
<road_code>13</road_code> 
<name lang="ru">Белорусская</name> 
<name lang="lv">Baltkrievijas</name>
<name lang="en">Belarusian</name>
<name lang="de">Belorussische</name>
</road> 
</to_road>
I want to retrieve the 3rd name at least, if not all. 
Any ideas of how could I achieve that?

Thank you in advance,
Vasilis

Hello Vasilis,

Have you checked the example module in this thread? Like I mentioned above, the situation is the opposite as described here, but the logic behind the solution should be the same.

If you could also share your implementation in a sample module, I can take a look and check your Structure.

Hello Afonso,

I did, and I saw that this is an example with static values while mine are dynamic and I am not so sure I got what you did exactly.
Sure, find the module below.

Vasilis

Sharable.oml

Hello Vasilis,

Here's a page to test it out: https://afonsobc.outsystemscloud.com/XMLRoads/XMLRoad.aspx

I've also attached an example module. I simplified the presentation on the screen so you'll only be able to see one road, but it should be able to recognize multiple roads and their name lists. Let me know if the example makes it more clear.

XMLRoads.oml

Thank you very much for your time and effort Afonso :)

Edited by a moderator on 20 Sep at 12:08
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.