0

If I can invoke the api Car Availability with a locationDescription.name that have more than three letters the api send me the following errors:

"18|Presentation|Serializing/Deserializing error: [type = DataElement] [name = name] [Error = Invalid length for data element]."

Could you help, please? Thanks

Hamed Moghadasi
  • 1,523
  • 2
  • 16
  • 34
  • Hi, it is not a problem with serialitation but probablu it's a problem for the object filled to invoke amadeus when a city is not a iata code (more than three letters) so I need the correct object to fill – Dario Zangara Feb 24 '20 at 16:55

1 Answers1

1

Seems like your class does not have public default constructor.

Refer : https://support.microsoft.com/en-in/help/330592/error-message-when-you-serialize-a-class-by-using-the-xmlserializer-cl

When you try to use the XmlSerializer class to serialize a class that does not have a public default constructor, you may receive the following System.InvalidOperationException exception error message: An unhandled exception of type 'System.InvalidOperationException' occurred in system.xml.dll Additional information: There was an error reflecting 'class'. where class indicates the class that the XmlSerializer class tried to serialize.

Anand Chapla
  • 172
  • 5