cfscript and cfc not working

I have a line

variables.usps = New usps(isProduction=true, isSecure=false, uspsUserID=variables.uspsUserID);

variables.RateV4 = variables.usps.RateV4(
	Service = 'FIRST CLASS',
	FirstClassMailType = 'PARCEL',
	ZipOrigination = '99212',
	ZipDestination = '22193',
	Pounds = '0',
	Ounces = '3.5'

Open in new window

that works just fine in development (which is CF9) but when I load this to live it doesn't work (which is CF8).    Why doesn't that work on CF8??
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is it throwing an error, if so on what line - and what's the error message?

My first guess would be that the "new" keyword didn't exist in CF8. So you need to replace it with createObject and a call to init()

EDIT: I don't know if CF8 supports chaining, so I broke this out into 2 separate calls:

     // not tested
     variables.usps = createObject("component", "");
     variables.usps = variables.usps.init(isProduction=true, isSecure=false, uspsUserID=variables.uspsUserID);

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Any error messages you can share?
digitalwiseAuthor Commented:
As usual - thanks for the help!   Wandering between CF10 and this old CF8 site is a huge pain!    Completely missed it.   Now the problem is the CFC was written for CF9 so I have to fix that stuff too!
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

I hear you! I really wish they would make older versions available for developers, so they don't have to depend on the "publish-it-and-hope-it-doesn't-break" method ;-)
Here is an unofficial repo containing all the old cf installer downloads.
digitalwiseAuthor Commented:
So I am working through this mess and getting the error:  Variable SETURLTEST is undefined.

<cffunction name="init" access="public" returntype="USPS" output="false" hint="Initializes the USPS CFC">
		<cfargument name="isProduction" type="boolean" required="false" default="#getIsProduction()#">
		<cfargument name="isSecure" type="boolean" required="false" default="#getIsSecure()#">
		<cfargument name="uspsUserID" type="string" required="false" default="#getUspsUserID()#">
			// set constants (CF9 fix)

			// set production and secure flags

			// configure url based on flags

			return this;

Open in new window

Which line is throwing the error? I don't see anything that looks CF9 specific, so I'm guessing the problem is in one of the functions.  Any chance this CFC is public btw - so I could look a the whole thing?
digitalwiseAuthor Commented:
<cfproperty name="isProduction" type="boolean">
<cfproperty name="isSecure" type="boolean">
<cfproperty name="uspsUserID" type="string">
<cfproperty name="url" type="string">
<cfproperty name="URLTEST" type="string">
<cfproperty name="URLTESTSECURE" type="string">
<cfproperty name="URLPROD" type="string">
<cfproperty name="URLPRODSECURE" type="string">

Open in new window

Hm... I wonder if it's cfproperty stuff.  I know in later versions it creates the setters/getters automatically. I don't remember how it behaved in CF8.

Edit: Yeah, that's the problem. You'll have to create the getters/setters manually.
Edit: Yeah, that's the problem. In CF9+ cfproperty creates the getter/setter's automatically. Not so much in CF8 :/. You have to create those methods manually.

<cffunction name="setURLTEST" access="public" returntype="void">
    <cfargument name="value" type="String" required="true">
    <cfset variables.URLTEST = arguments.value />

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.