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.4K All Categories
- 78 General
- 13 Training
- 209 Installation / Setup
- 1.1K Flows
- 110 Rules
- 270 Administration
- 213 Portal
- 497 General Q & A
- 709 Forms
- 345 Reports
- 3 Designer Extensions
- 48 Example Flows
- 58 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 186 Pages
- 5 Process Mining
- New Features
- 186 Datastructures
- 70 Repository
- 229 Integrations
- 29 Multi-Tenant
- 27 SDK
- 81 Modules
- 59 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 143 Lunch And Learn Questions