0 Replies Latest reply on Jun 27, 2008 9:05 AM by anoweb

    XMLEncoder - how to stop it from using NaN for int's

    anoweb Level 1
      I am trying to invoke a webservice. I used the Flex Builder 3 service code generator. I have an object "Person" which has three fields: {id:int, firstName:String, lastName:String}

      I have a case where I invoke a method on a webservice that takes a person object. the person object in this case should only have a first and last name defined (no id, yet). I stepped through the flex source code to see what happens and basically when it encodes the Person object it gets to the "id" field whose value is NaN (b/c I never set it). The encoder eventually just decides that (NaN >= integer.min value) and passes it along so it gets into my SOAP message as <id>NaN</id>. This causes problems at the web service (java) side b/c it doesn't know how to unmarshall "NaN".

      So...any suggestions on how to prevent it from sending <id>NaN</id>. maybe even just <id /> would be ok.