Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
EnergyFed #1
Array Issue I Think?
I am trying to return rates from the UPS site, and I got it working for the
most part. However, if I have a zip code that starts with a 0 in it, I get an
error:
column 1
detail Error at line 1, column 17
errorcode [empty string]
errorlogfile C:\BlueDragon_Server_62\.\work\temp\rtelogs\bderro r6448.html
extendedinfo [empty string]
line 42
message TNTData.TimeInTransitResponse.TransitResponse.Serv iceSummary doesn't
exist.
scriptline 0
tagcontext array
1 struct
column 1
id CFLOOP
line 42
template C:/Inetpub/wwwroot/shipping/transite_work.cfm
type Application
How do I get my array loop to include the 0? Here is the code:
<cfhttp url="https://www.ups.com/ups.app/xml/TimeInTransit" port="443"
method="POST" throwonerror="yes">
<cfhttpparam name="requestTNT" type="XML" value="#TNT#">
</cfhttp>
<cfset TNTData = XmlParse(CFHTTP.FileContent)>
<cfloop from="1"
to="#ArrayLen(TNTData.TimeInTransitResponse.Transi tResponse.ServiceSummary)#"
index="i">
<cfset services=structnew()>
<cfset
services.code=TNTData.TimeInTransitResponse.Transi tResponse.ServiceSummary.Servi
ce.Code.xmlText>
<cfset
services.type=TNTData.TimeInTransitResponse.Transi tResponse.ServiceSummary.Servi
ce.Description.xmlText>
<cfset
services.tt=TNTData.TimeInTransitResponse.TransitR esponse.ServiceSummary.Estimat
edArrival.BusinessTransitDays.xmlText>
<cfset
services.arrivaldate=TNTData.TimeInTransitResponse .TransitResponse.ServiceSummar
y.EstimatedArrival.Date.xmlText>
<cfset
services.arrivaltime=TNTData.TimeInTransitResponse .TransitResponse.ServiceSummar
y.EstimatedArrival.Time.xmlText>
</cfloop>
Any help with this would be great, thanks.
Chris
EnergyFed Guest
-
Issue with a mailer and a data array
Hi there, I hope someone can help me with this, I am fairly new to PHP and am struggling to get a simple order form to send a mail message form... -
[newbie]saving and reading array of associative array
i'm looking for examples of saving to file and reading back an array of associative array, in a ruby like way. saying i have something like : ... -
GD: Graph Data Array Issue
Hi All. I'm relatively new to Perl, and have been somewhat successful using the GD::Graph and Graph3d modules. I'm using this procedure as a... -
array data matches but array created in loop doesn't work
I have the exact same data in two arrays, but only the array created like so will work: $spaw_imglibs = array( array( 'value' =>... -
#24897 [Com]: array_multisort() will reindex the array but not if array length is 1
ID: 24897 Comment by: franklin_se at hotmail dot com Reported By: chro at sokrates dot uio dot no Status: ... -
EnergyFed #2
Re: Array Issue I Think?
Never mind I got this to work, sort of! The only problem I am running into
now, is that zip codes throw a lot of errors due to different city spellings
and towns sharing zips. I added a city field and it works good like that.
However, I wanted to make this as simple as possible and just use the zip
code. Is there a way to maybe use a <cfif> if the form.city is blank? Or is
there another way to insert the right info?
Thanks,
Chris
EnergyFed Guest



Reply With Quote

