Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a contractor working for me on a Flex application. He retrieves recordset for a intersect query from the web service published in house. But he is getting some ids as negative random number instead of integer (generally 9-10 digits). He says it is at our end but when I query from REST service, I get everything fine. He is using the query to display results in app. I don't know his code in details because I have tasks to develop server side functionalities and have my plate full. The mapping service, in question, is a query layer and retrieving data from ORACLE database. Has anyone else noticed similar behavior? or any suggestion on this?

Thanks

share|improve this question
    
We checked against Oracle database and in REST URL these are mostly the numbers greater than 300,000,000. But numbers greater than 800,000,000 are fine. We tried converting one of the negative numbers to some other number range (e.g. 11155666), then it was working. We are not sure what is causing this problem. –  Deep Aug 24 '12 at 13:55
    
It might be a integer overflow error. What is the data type that you are using for storing these numbers? –  Devdatta Tengshe Sep 23 '12 at 8:44
    
@user8732, ..does your comment imply that you isolated the problem as occurring server-side, or are the remarks in your question still correct—specifically, when you query from REST service, [you] get everything fine? –  elrobis Dec 22 '12 at 17:12
    
This was solved long back; Sorry I forgot to update here. I added the ID variable casted as 'String' in my WMS and used in Flex app. ESRI recognized this issue and apparently ESRI has fixed this problemin new version of Flex API. –  Deep Jan 16 '13 at 16:46

2 Answers 2

up vote 0 down vote accepted

Here are a few thoughts to help you move forward.

1. Prove once and for all to everyone that the problem is unquestionably server-side:

If I were the Flex dev, I would use Fiddler (or any other traffic sniffer) and show you a screenshot proving the errant values are emitting from your service layer before they get into Flex. In other words, make them prove it. ( ..surely they've already done this, right? But if they haven't, they may very well prove to themselves that the problem occurs when the data hits Flex. I hope you're not in that situation. :/ )

2A. Cast the id values as String, server-side: My recommendation? Just do this and be done with it. Assuming you prove Flex is the bad guy in #1, I'd cut to the chase and cast your id values to String server-side, like this guy, and this guy. If you do that, it eliminates every variety of "Flex-wierd-number-stuff".

2B. Configure return data types, client-side: ..alternatively, your Flex dev can "configure the return data type" for the id values, forcing the Flex client to receive them as String values. This saves you some trouble server-side, but personally, I'm not a big fan of this approach for the reason that if I have to delete/recreate my service connection in Flex, I have to remember all the specific return types I've configured. (And sometimes this is necessary if anything is refactored or heavily revised server-side.) But this is just personal preference based on my experiences.

2C. Implement a unique solution, client-side, to handle large integer values: This is an option, but it's not necessary to get where you want to be. Nevertheless your Flex dev could experiment with this so-called BigInt class (or anything else like it, plucked from the web). I rank this as option 2C because, well—you'd be involving a class someone created and put on their blog. :) Nothing wrong with that, but casting to String removes all guess-work.

The truth is I love Flex for the stuff it does well, like rendering rich, visual content—and that's perfect for online maps. But I avoid doing serious arithmetic or buisness logic in Flex. Not to be pessimistic, but if you see clean data when you poll the service layer directly, I automatically suspect the issue begins when the data hits Flex. There's just no shortage of conversation about this and similar issues if you do some looking..

Best of luck. /E

share|improve this answer

I didn't have that problem but did have an issue with dates. You can use numeric formatting that may solve the problem (if not already doing so).

<field name="mydate_stat" alias="Date submitted" visible="true">
        <format dateformat="shortDate" useutc="true"/>
        </field>

This code doesn't apply but gives an example of how field formatting in flex is used.
Here is how I format to get no comma and no decimals.

<field name="meter_id" alias="Meter ID" visible="true">
        <format usethousandsseparator="false" precision="0"/>  

Adobe has some information here.
for the mx.formatters.formatter class with more here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.