Update for ColdFusion UPS Package

I updated the CF UPS Package application a few minutes ago. There was an issue that was blocking the service rate CFC that is now corrected. If you are using the code (and remember it is still beta) you really need to update.

Archived Comments

Comment 1 by Francisco Mancardi posted on 1/11/2007 at 11:08 PM

hi!: great job, I'm using your code in one project (is saving me a lot of pain).
I've found the following problem:
I need to get tracking information using ReferenceNumber instead of TrackingNumber, it works but in the returned reply
'ShipmentIdentificationNumber' key is not present, then the code crashes.
I will try to contact UPS to understand is this is OK,
in the meantime i will do some simple workaround (structKeyExist?) and send you the code (if you want)

Regards

Comment 2 by Raymond Camden posted on 1/12/2007 at 6:18 AM

Hey Francisco - I'll give it a try when I get back in town. Ping me if you don't hear from me in a few days.

Comment 3 by Fred Wenger posted on 1/15/2007 at 7:13 AM

Have you had any luck getting the signature image data back from UPS to show it to a user? Thanks.

Comment 4 by Raymond Camden posted on 1/15/2007 at 7:17 AM

Dumb question - that would be in shipment tracking, right?

Comment 5 by Fred Wenger posted on 1/17/2007 at 2:01 AM

Yeah, the ship tracking. You can get back some Base64 data that's the signature image if you make a the request with a specific "request code". I wasn't sure what to do with the Base64 data. I don't have the UPS API doc in front of me so I'm not using theie exact terms, but if you want more details, feel free to email me and I'll get that out of the docs. Thanks.

Comment 6 by Raymond Camden posted on 1/17/2007 at 3:14 AM

This makes sense. This week is hell for me (2 presentations), but I'll look at it next week. I've got this, plus new Canvas, plus new Lighthose Pro, all in my "for free" slot.

Anyone want to offer to pay me to develop OS apps? :)

Comment 7 by Connie Decinko posted on 4/9/2007 at 9:49 AM

You might want to look at shipmenttracking.cfc. It appears some of the code is missing past the added code for shipmentidentificationnumber.

Comment 8 by Raymond Camden posted on 4/9/2007 at 3:29 PM

Can you be more specific? I don't quite get what you mean.

Comment 9 by Nick Sweeney posted on 9/29/2007 at 8:46 PM

Hi Ray - I am trying to use this handy tool - specifically the rates lookup - but I am on 6.1. You mentioned that "You could make the CFCs work in MX6 by removing this attribute and using the CFHTTP variable." Could you be more specific? I'm not exactly sure what you mean. Thanks!

- Nick

Comment 10 by Raymond Camden posted on 9/30/2007 at 2:30 AM

CF7 added a result attribute for cfhttp. Before that, the result of a cfhttp call was stored in a variable called cfhttp.

So you would need to remove result="..." from all CFHTTP tags, and where I used result.whatever (or whatever I named the result), change it to cfhttp.whatever.

Comment 11 by Nick Sweeney posted on 9/30/2007 at 4:07 AM

Thanks Ray -

I made the necessary switches, but now I get the error:
Cannot invoke method init on an object of type coldfusion.runtime.Struct with named arguments.
Use ordered arguments instead

line 93

91 :
92 : <cfset variables.serviceCodes = loadServiceCodes()>
93 : <cfset super.init(argumentCollection=arguments)>
94 : <cfreturn this>
95 : </cffunction>

?? Not sure what to do there. From this post http://www.1pixelout.net/20... it looks like a common problem in 6.1 - but I am not sure how to further address the fix.

Comment 12 by Raymond Camden posted on 9/30/2007 at 6:12 PM

Change that one line to something like this pseudo-code

<cfset super.init(a,b,c,d,e)

where a,b,c,d etc are the arguments. My use of argumentCollection=arguments was just a shortcut.

Comment 13 by Nick Sweeney posted on 9/30/2007 at 8:12 PM

Awesome! That did it - thank you so much, I really appreciate your help.

Btw - on a side note, now that I got it to work, I did a quick comparrison to the rates it provides and what UPS.com shows. The rates are slightly off... !?

Currently UPS is showing a fuel surcharge that doesn't show up. Should it be? Or will the cfc need to be modified/updated slightly to do that? (Can be quite expensive)

Also, I notice that the default shipping rate on UPS is around $1 more. (based on 1 package of 2-lbs from Wausau 54403 to Beverly Hills 90210) Although - obviously the rate fluctuates based on delivering to Residential vs Commercial. (Commercial is cheaper.) But it's still slightly variant even when setting "shiptoIsResidential=true".

Didn't know if these were known issues or if I am still missing something.

Thanks again - Nick

Comment 14 by Nate posted on 1/25/2008 at 11:33 PM

This code you have written is very very impressive... One thing I'm curious about is how to handle canadian zip codes? Currently canadian zip codes are not validated in the address verification cfc, right? How complicated is it to do that? And, is this even possible with the xml rate service that ups currently provides?

Comment 15 by Raymond Camden posted on 1/26/2008 at 10:28 PM

Nate, you would need to check with UPS on that. I don't think I have the docs handy.