XML Deserialization Issue
Comments
-
I have an object “reward” with single property “rewardItemId” Int32 Allow Nulls.
When deserializing XML into the object, even though the property allows nulls, it fails if there is no value in the XML with the following exception.
System.InvalidOperationException: There is an error in XML document (3, 3). ---> System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderreward.Read3_NullableOfInt32(Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderreward.Read4_reward(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderreward.Read5_reward()
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
at DecisionsFramework.Design.Flow.CoreSteps.XML.XMLDeserializeStep.Run(StepStartData data) -
If youre using XML that is being built manually with string steps, it is encouraged that you use the Xml Serialize step from an object first. Then, use the output String from that in the following steps. This will ensure that required attributes are output correctly in the XML string.
Howdy, Stranger!
Categories
- 4.3K All Categories
- 70 General
- 11 Training
- 206 Installation / Setup
- 1.1K Flows
- 109 Rules
- 268 Administration
- 212 Portal
- 496 General Q & A
- 706 Forms
- 338 Reports
- 3 Designer Extensions
- 48 Example Flows
- 56 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 184 Pages
- 5 Process Mining
- New Features
- 182 Datastructures
- 69 Repository
- 228 Integrations
- 28 Multi-Tenant
- 27 SDK
- 81 Modules
- 57 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 130 Lunch And Learn Questions