How to fix a problem with the order of strings in a JSON response for a CFHTTP request?

Good morning, guys! (It's 10:50 a.m. in Brazil)
First of all, I'm still new at CF and my questions may seem too much silly and my English's not the best, so, please be patient with me. hehe
Well, I'm accessing a link via CFHTTP that gives me a JSON response. I'm not familiar with JSON yet, so I'm working it as a string and using string functions (Find,RemoveChars,Replace,etc), but it happens to me that I'm receiving a certain kind of order of the strings list from the JSON when I access it directly from the browser and other kind of order totally different when I access it from the CFHTTP.
I only figured it out because I was working at home with my code and there everything went just fine as expected. Then I brought to my job to develop a little bit more as soon as I get a free time and here my code doesn't work anymore. When I took a look at the JSON by a CFOUTPUT, I realized the strings were in a different order.
Does anyone know why is it happening?
Link to the JSON: http://sigmine.dnpm.gov.br/ArcGIS/rest/services/extra/dados_dnpm/MapServer/0/query?text=83 0620/2012&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelInter sects&where=&returnGeometry=true&outSR=&outFields=FID,Shape,PROCESSO,ID,NUMERO,ANO,AREA_HA ,FASE,ULT_EVENTO,NOME,SUBS,USO,UF&f=pjson
Basic code simplified to find out that the order of strings were coming different when access by CFHTTP:
<cfhttp url="#URLAbove#" method="get" result="DadosDoDNPM" charset="utf-8" timeout="10000" />
<cfset DadosJSON = deserializeJSON(DadosDoDNPM.FileContent) />
<cfif arrayLen(DadosJSON.features)>
    <cfset CodigoFonteJSON = ToString(serialize(DadosJSON.features)) />   
    <cfoutput> #CodigoFonteJSON# </cfoutput>
</cfif>
Is there a way to fix it and to make my code work everywhere?
If it matters, I use Railo at home and at my job.
Since now, I thank you.

When you deserialize JSON data, ColdFusion converts it into native structures and arrays (roughly equivalent to JavaScript objects and arrays).  In ColdFusion, structures are unordered (that is, they don't maintain keys in any particular ordered sequence).
This really shouldn't be a problem though, at least not if you just want to work with the data contained in the deserialized JSON structure.  So DadosJSON should be a native ColdFusion structure, and you can interact with it like any other structure in ColdFusion.  In fact, you should not have to re-serialize it at all unless you need to send it to an external application using JSON.
Why are you reserializing the data?  And why use serialize() instead of serializeJSON()?
-Carl V.

Similar Messages

  • How to fix a problem with the discharge rate of the battery in the iPhone

    Hi I have a question namely how to fix the problem of discharging the battery in the iPhone 4 with ios7.1

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • How to fix a problem with my book pro that has a gray screen with a folder with a question mark on it

    does any one know how to fix a problem with my book pro that has a gray screen with a folder with a question mark on it?

    Hello Mokhtary123 and welcome to Apple Support Communities,
    It will help us diagnose your problem to know the exact model, size, year built, RAM installed and OS you're running.
    But basically your system can't find the boot disk. Usually this is a symptom of a dead/dying/corrupted hard drive;
    A flashing question mark or globe appears when you start your Mac - Apple Support
    OS X Recovery
    http://support.apple.com/en-us/HT4718

  • I want to upgrade from Tiger to Snow Leopard on my 2008 MacPro. How do I avoid problems with the upgrade process?

    I want to upgrade from Tiger to Snow Leopard on my 2008 MacPro. How do I avoid problems with the upgrade process?

    #1 Do a complete bootable backup of your drive before upgrading. That way should anything happen you can revert back to the start and try again.
    Make sure you meet Snow Leopard 10.6 Technical Requirements - http://support.apple.com/kb/SP575
    You might also want to make sure you don't have software issues with SL:
    A Mac OS X 10.6 Snow Leopard Application Compatibility List - http://snowleopard.wikidot.com/

  • Problems with the order

    once more I have problems with the order in iTunes:
    Titel number 8 is on top and the first one is on place 10. The only difference in the information is
    Titel number 8 has titel number 8 and the titel on place 10 has the titelnumber 1, all the other informations are eqaul..
    See the screenshots:

    applewoi wrote:
    the album has got 17 files in 2 CDs. Shall I write therefore
    Titelnummer
    1 von 17
    2 von 17
    and so on?
    all in 1 CD
    I suggest you set
    CD-Nummer
    1 von 2
    2 von 2
    Then the tracks
    CD-Nummer 1
    Titelnummer
    1 von 9 (or however many tracks there are per CD)
    2 von 9
    CD-Nummer 2
    Titelnummer
    1 von 8
    2 von 8

  • Windows 64Bit Itunes Error : "THERE IS A PROBLEM WITH THE WINDOWS INSTALLER PACKAGE. A PROGRAM REQUIRED FOR THIS INSTALL TO COMPLETE COULD NOT BE RUN CONTACT YOUR SUPPORT PERSONNEL OR PACKAGE VENDOR."

    I have a brand new HP laptop windows 64bit that is having issues installing Itunes 10.6.3. Whenever attempting to install, I get the error message : "THERE IS A PROBLEM WITH THE WINDOWS INSTALLER PACKAGE. A PROGRAM REQUIRED FOR THIS INSTALL TO COMPLETE COULD NOT BE RUN CONTACT YOUR SUPPORT PERSONNEL OR PACKAGE VENDOR." I thought this was an issue with the new version, and attempted to retrieve/install older versions of Itunes and same issue occurs. I have tried other forums and resolution tips from : https://discussions.apple.com/docs/DOC-3551 and nothing still. It appears that apple installs bonjour and nothing else. I have tried extracting the itunes package and installing the executables seperately, but everytime the error stil arises. I cannot repair the apple software update as it cannot install from the error mentioned above. Looking through the logs, it shows error : 1721, problem with windows installer package.Does anyone have any suggestions on what to try?

    There are so many different error and problems peopl are having.
    This is a link to mine
    https://discussions.apple.com/thread/3467825
    I think it has to be something on Apples end.
    Hopefully they fix it soon. Ive used a few GB redownloading and Im going crazy
    hope this settles you a bit

  • HT1926 can't install quicktime or itunes on windows 7 get the error message There is a problem with the windows installer package. A program required for this install to complete could not be run

    please help. Can't install quictime player or itunes on windows 7. Get the error message There is a problem with the windows installer package. A program required for this install to complete could not be run. Have followed all the steps suggested and still no luck.

    thank you for trying to help. I do not have apple software update on my computer. I have tried to install several programs so i could install it but every installation will not finish and rolls back and says no changes were made to my computer so i can't install the update. I even tried to force install as administrator but nothing works. Any help would be greatly appreciated. I have windows 7 64 bit.

  • I have the problem with the eFax Create Account button being grayed out for my newly purchased 6525.

    I have the problem with the eFax Create Account button being grayed out for my newly purchased 6525.
    Can you help?

    Hi Marv13, disregard my last post. The 6520 does have eFax capabilities and the support document I provided a link to needs updating. If you contact HP Cloud Services phone support they will be able to resolve this issue for you. The number and available times are posted below:
    HP Cloud Services
    1-855-785-2777
    Hours of Operation
    Monday-Friday 8am-11pm ET
    Saturday 10am-6:30pm ET
    Best.
    If my reply helped you, feel free to click on the Kudos button (hover over the "thumbs up").
    If my reply solved your problem please click on the Accepted Solution button so other Forum users may benefit from viewing the post.
    I am an HP employee.

  • How to fix underscan problem with footage

    I am trying to help a friend fix a problem with some footage he shot. A client was standing in front of a painted matte. The footage was shot,(and cannot be re-shot) and once back in the studio he found that a the edge of the matte that is not painted is showing up beyond the TV safe area. It can be seen on a computer screen and if shown thru a projector. The viewfinder of his camcorder did not show this problem.
    So how can we fix it? It is a narrow band of white on the left side of the screen. The problem is that part of some leaves cross over it and out of frame. We have tried just simply scaling it up to get beyond the white edge but the picture quality begins to degrade. We have to fix this using FCP since that is all that is available to us. The clip is fairly long so we probably won't have the time to fix it in Photoshop.
    Any help is greatly appreciated.
    He is using FCP4.5 on a dual processor G5.
    Thanks!
    Ymir

    The cropping would leave a black bar. Something I was thinking about doing has cropping involved. I thought about duplicating the clip and stacking it over the original clip. Then crop it as suggested and then scaling the clip underneath and apply a Gausian blur. This would eliminate the white edge. Problem is, I have a hard line where the cropping took place. If there was some way to just feather the left edge of the crop.
    My friend thinks some type of masking needs to take place where we could just re-color the white bar but as of yet we haven't discovered how to go about it.
    Thanks for the suggestion,
    Ymir

  • Problem with the order of inserted PDFs...

    I work with archiving records in chronological order and am having problems getting the files to insert correctly. When I go to insert files, everything is fine when only one file is being inserted. Also what works fine is if I'm trying to insert multiple files that are already in order (by using the Shift key to select them all at the same time) - i.e. file1, file2, file3 - and I know that I can select the last one first to invert the order - i.e. file3, file2, file1. The problem I'm having is if I'm trying to insert file3, file1, then file2 without having to do multiple insertions. Obviously this isn't a issue when dealing w/ 3 out of order, but not 10+. I have tried using the Control key to select them in order but the order is ALWAYS messed up when I hit OK.
    Thanks to anyone that can solve my problem.
    -Lance

    Don't think there is anything you can do about that, unless you write a script or something. The ordering is typically set by the way they appear, not the order you select them. Some people have more success dragging from Explorer into Acrobat, rather than using insert pages. However, you are still stuck with the order the of the files in the window, not the order you select them. To the best of my knowledge, there is no way to change this behavior. Using a script are such is the only way I can think that what you want might be done.

  • How can I report problems with the Mozilla support website?

    Of course this is a problem with the website, not with Firefox, but "other products" is a dead end. I have sensory disabilities, so these are some of the bugs I've noticed, I don't know what bugs other people have noticed:
    1. There are too many animations. They hurt.
    2. Searching for "accessibility" turns up questions and answers using the word "access," which usually have jack to do with accessibility problems, accessibility solutions, accessibility tools for Firefox, etc. for disabled users.

    '''[https://addons.mozilla.org/en-US/firefox/addon/flashblock/ Flash block]''' {web link}
    Never be annoyed by a Flash animation again! Blocks Flash so it
    won't get in your way, but if you want to see it, just click on it
    This is probably a good site to be aware of
    http://www.accessfirefox.org/Firefox_Accessibility_Extensions.php
    It is a semi official mozilla community run site.
    IIRC the site and many of its addons were caught out by Australis.
    That is probably one site we should reach out to in advance if for instance making anything less distinct smaller, or lower contrast.

  • Problem with the order of colums in query

    Hi!
    We work with SAP 2007 and patch 44. When we want to do a query, in the result, the colums aren't in same order that I have defined in the query.
    Someone have already met the same problem?
    Thank you to take in consideration my problem
    Best regards,
    Séverine

    Hi Séverine,
    Most new PL for 2007 has this problem.  Hope the fix could be coming soon.
    BTW, do you have the same problem when you run the saved query?
    Thanks,
    Gordon

  • How to fix ASA problem with Error message id 713231, 713232 ?

    Dear all,
    It's been two day with this problem and it's not possible to stablish vpn with peer yet. ASA is reporting error with messages id: 713231 & 713232. Before this the vpn was working perfectly. I did a reload of the ASA, but the problem continues:
    713232    Group = x.x.158.254, IP = x.x.158.254, SA lock refCnt = 0, bitmask = 00000000, p1_decrypt_cb = 0, qm_decrypt_cb = 0, qm_hash_cb = 0, qm_spi_ok_cb = 0, qm_dh_cb = 1, qm_secret_key_cb = 0, qm_encrypt_cb = 0
    713231    Group = x.x.158.254, IP = x.x.158.254, Internal Error, ike_lock trying to unlock bit that is not locked for type SA_LOCK_P1_SA_CREATE
    ASA 5510 version 8.3 (1)
    Is there anybody who knows how to fix this?
    Thanks in advance.

    Firstly ASA version 8.3 isn't that stable. I would advice you to upgrade to 8.4(5).
    Did you do a search in google? This is wat I found:
    http://www.cisco.com/en/US/docs/security/asa/asa80/system/message/logmsgs.html#wp4776301
    Posted by WebUser Erik Boss from Cisco Support Community App

  • How to fix Frame problems with fonts

    When I try to "Save as book" to PDF, I get a font error that prevents the file opening for printing.
    When I view the file, I get:
    The "Myriad Pro Light" Font is not available.
      "MyriadPro-Regular" will be used in this session.
    The print error does not specify which font, but I assume it is the one mentioned in the first line above.
    The font is in the Windows font directory, but FM is not seeing it.  How do I fix this?
    Unstructered FM12, Win8.1, HP printers (no choice about that)

    I am hoping somebody here can say what bits of Acrobat FrameMaker 12 includes. I don't know, because I am using Tech Comm Suite, which includes full-on Acrobat.
    At the least, FrameMaker solo should include the PDF printer driver and Distiller. With these, Save as PDF from FrameMaker should work fine, and if you have the fonts you should be able to print and embed them in a PDF.
    In my experience, font issues for Adobe products happen this way:
    You have certain fonts installed. There is no problem with these.
    You set as default a printer that has its own resident fonts. Those fonts now become available.
    You use the printer resident fonts in your document, which is fine, until ...
    ... You change printers, perhaps to PDF printer, and now the printer-resident fonts you thought you had are no longer there.
    Note, some printers are set to substitute fonts. So, you might specify a certain font but your HP printer actually has a font substitution table that is swapping your chosen font for Times New Roman, or sommat. Watch out for that, too.
    So, double check you have the fonts you think you do; view them in Character Map, for example.
    Cheers,
    Sean

  • Problem with the order of the columns of a ALV

    I have a problem with a ALV, variants we keep this ALV does not record the order of the columns
    Thank you

    I suppose you want to change the sequence of columns of a ALV. If you can change it by clicking 'settings' of right-top corner of ALV. After done you can save the new settings into a new. If you find some abnormal behaviour, please check the settings by WDA component "wd_analyze_config_user".
    FYI.
    [http://help.sap.com/saphelp_nw70/helpdata/en/32/f26f73d81e11d1a26f0000e8a5a614/frameset.htm]

Maybe you are looking for

  • HTTP 1.0/1.1 support

    Does iWS 4.1support both http 1.0 and 1.1 or just 1.1 ?

  • Illustator files with OT Fonts Flagged as T1 in InDesign CS4

    Is this a bug in InDesign CS4 where Illustrator files flag all OT fonts as T1? I'm attempting to setup in the menu Window/Output/Preflight and using a custom profile that flags all fonts as not allowed except OT fonts. For some reason InDesign thinks

  • When tried to download Firefox 5.0 for Mac, would not open, now have NO SOUND on my Mac!!

    Firefox upgrade to 5.0 for Mac loaded, but symbol had 0 with a line thru it, and now the sound on my Mac is showing the same symbol! I cannot get the sound back!! HELP please! Had no idea trying to upgrade could screw up my computer!!!

  • Tax Fields for GST,HST and PST

    Hi, I am on a project in Canada and we have following tax numbers which has to be printed on customer Invoice. The question is in which field we should populate these numbers (legal requirement) to enable it to print on the invoice. 1. GST 2. HST 3.

  • Linux Tools 4.0.0 is released

    I am pleased to announce that the 4.0.0 major release is now available from our update site. Details available in the N&N page [1]. This release is the Linux Tools contribution for Mars SR0. The tag v4.0.0 maps to commit e3de351ca7ffd1bf722c9f0e2e869