-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebService call converting string into Infinity integer #3268
Comments
Interesting one! That doesn't appear to happen within the XML handling of the runtime, so presumably is related more to the service call and deserialisation / conversion of the data into the object there. Although checking the AMF serialisation, this also works fine... When you say the 'XML returned' is that string with the 9e999 value, how are you showing that string i.e. where do you get the information from? Is that from something like
(If not, can you check that value?) I don't suppose you're able to set up a test case/environment for this? My guess is that this could be a Flex issue itself, but we can try to get a reproduction of it and see whereabouts the data goes wrong.. thanks |
Yes were using Flex. `protected function initLogging():void { }` and call it at the start of the app. I also can confirm the data returned in the Network Monitor in Flash Builder. One thing we have found is if we add a period to the end of the offending data its converted OK and shows OK in the app. As soon as we remove the period, it goes back to showing Infinity. I will try to set up a test for this and get back to you. |
Here is a test app that calls for some test XML from our website. It's a Flash Builder project with a HTTP web service. |
Thanks for the test case. Reproduced here, and tracked back where a "9e999" string is being converted to a number.. it happens within the below class:
And the conversion itself is in Pseudocode:
The problem being, "9e999" is a valid string representation of a number, so "Number(val)" returns a valid number (albeit too large to fit in a double floating point hence 'infinity') and "isNaN" of this returns false. So we drop into the final block and convert it to the number, 9 x 10^999 = near enough infinity... I guess your options here would be: Interesting case! thanks |
Before reporting this issue:
Problem Description
Describe your problem in detail. Include the following information:
Steps to Reproduce
Use a web service to retrieve XML from a server and when the string "9e999" is received the result array treats it as an Integer and sets it to Infinity.
Give us a minimal example:
Web service call
downloadResult.addEventListener(ResultEvent.RESULT,dataDownloadSuccess); downloadResult.token = MyWebService.getDownload(itemID);
XML Returned
<items> <item> <id>123</id> <name>9e999</name> </item> </items>
dataDownloadSuccess Method
if (event.result.result == 'success') { if (event.result.items!= null && event.result.items.item != null) { var tmp:Object = event.result.items.item[0]; var displayData:String = tmp['name'] } }
displayData will have the word "Infinity" in it instead of the string "9e999"
The text was updated successfully, but these errors were encountered: