This page is an archive of my old blog. Please visit DavidTucker.net for my current blog.
This site is no longer being maintained and commenting is disabled.
Currently Browsing: Coldfusion

Get a ColdFusion 8 License for Cheap

I am in the process of moving all of my servers to ColdFusion 9 Standard. That being said, I have an old ColdFusion 8 Standard license that I am currently selling on Ebay. I paid full price for this license ($1299) last year, and I can truly say that it was worth every penny. I know that many developers find the price of ColdFusion a roadblock to building client projects on CF, but hopefully this can help a lucky CF developer get rolling with a license for cheap. The starting bid is at $450 (and there is no reserve). You can use ‘Buy it Now’ for $750. I hope this helps someone!

Come Learn about CF9 with Flex and AIR at Adobe Max 2009

I must admit that my session is going to be pretty awesome. While some people get to speak for an hour – or maybe an hour and a half, I will be speaking for 8 hours (with some breaks of course). I will be presenting on Building ColdFusion Powered Flex and AIR Applications (see all of the labs here). While the preconference sessions are an extra cost ($595), you get an entire day of training from some amazing developers. If you look around at rates for a one-day training, you will see that this is a huge bargain. Normal sessions give you a taste of certain functionality, but at a preconference lab you can really learn it and take it back to your job.

In my session you can be sure that I will be covering:

  • Utilizing the new Data-Centric Development Features in Flash Builder 4 (with ColdFusion)
  • Working with the Proxy ActionScript classes that were introduced in ColdFusion 9
  • Configuring and Using the ColdFusion 9 AIR Offline Sync functionality
  • Working with ColdFusion Builder and configuring it to work with your development server
  • Defining a Complex Domain Model using the new Hibernate ORM Support in ColdFusion 9
  • Using the Hibernate ORM and its ColdFusion Builder Extension to create remote CRUD services
  • Creating new Script-style CFC’s (with annotations)

All in all – you won’t want to miss this session! If you have any questions – feel free to leave a comment!

Quick CF9 Remoting Tip

I was working with a CF9 + Flex 4 example last night. This was a new installation of CF9 - and I hadn't tweaked any of the remoting settings at all (more on that in a bit). I was setting up a data paging example - and noticed that the Flex application was going crazy. From the network monitor I noticed that it was making continuous calls - and eventually caused the application to hang. After further analysis in the network monitor, I determined that Flex was receiving the objects back from ColdFusion - but they didn't contain any data. I hadn't seen this issue before.

After rummaging through the remoting config files, I discovered the issue. My bean CFC was using ColdFusion 9's new implicit getters/setters. To get this to work properly, you have to change a setting in the remoting config( specifically in services-config.xml):

XML:
  1. <use-accessors>true</use-accessors>
  2. <use-implicit-accessors>true</use-implicit-accessors>

By setting use-implicit-accessors to true, ColdFusion then uses the new implicit getters and setters in CF9 for your remoting calls. With that quick fix (and a restart) everything was working perfectly.

Join Me at Adobe Max 2009

I can announce now that I am presenting a full-day pre-conference lab at Adobe Max 2009 in Los Angeles. If you build ColdFusion-powered Flex or AIR applications, you will definitely want to attend this session. We will be diving into some aspects of CF8 and also the upcoming version of ColdFusion (codenamed Centaur). Here is the official description:

Building ColdFusion Powered Flex and AIR Applications

ColdFusion 8 proved to be an ideal and powerful back end for Flex and AIR applications, and the next version of ColdFusion promises to go even further, improving integration and simplifying the building of data-centric AIR clients. In this session you'll get hands-on experience with the planned Flex and AIR support in the next release of ColdFusion.

Hope to see you there!

Don’t Miss Flex Camp Miami

Flex Camp Miami Badge

I took some time off from speaking at conferences last year for the birth of our twins, but I will be speaking at several conferences this year. Flex Camp Miami is the first of those conferences. It is happening on March 6th in sunny Miami on the campus of the University of Miami (at the Hurricane 100 Room). Registration for this one day Flex/AIR training event is only $30.

(more...)

Strange Coldfusion Issue

At work I push out all of the website updates (to our Farcry CMS) through ANT (using the scp task). I recently upgraded to Eclipse 3.3 / ANT 1.7. Now, every time I push the update out, Coldfusion (CF8) returns a " File not found" error for the index.cfm file (root of the site). The file is clearly there, and Apache can still serve files in the directory, but Coldfusion doesn't believe the file is there. I have tried clearing the template cache, but that doesn't seem to fix the issue. It is a Linux machine, but all of the permission/ownership settings are correct. Anyone run into this before?
For more information: I am running CF 8 on RHEL 5 in a multiple instance setup (using virtual hosts in Apache 2.2).

My New Developer Center Article

I recently completed an article for the Adobe AIR Developer Center on Managing AIR Updates with ColdFusion 8. Check it out and let me know what comments you have.

I will be extending the UpdateManager in the weeks ahead. I will be covering all of the details here. It will be the next blog series after I finish with Cairngorm.

AIR Tip 4 – Calling a SOAP Webservice

Getting information from multiple locations on the Internet for a single application is commonplace these days. It is one of many things that makes AIR such a great application platform.

To begin with, we are going to be dealing with a very simple Coldfusion component. The component contains one function "getStuff". If you pass in your name, it will return a string that says "Your Name is ...". If you place this somewhere in your web tree, you can expose it as a webservice by adding "?wsdl" to the end of the filename. That is all you have to do to expose your Coldfusion Component as a SOAP Webservice.

Reference: Coldfusion 8 and Web Services

NOTE: I am planning to write an article on Consuming Coldfusion Webservices with JavaScript. This article will only cover the basics of it.

Coldfusion:
  1. <cfcomponent>
  2.  
  3.         <cffunction name="getStuff" access="remote" returnType="String">
  4.                 <cfargument name="personName" required="true" type="string" />
  5.  
  6.                 <cfreturn "Your Name is " & personName />
  7.  
  8.         </cffunction>
  9.  
  10. </cfcomponent>

Calling the Webservice is drastically different between Flex and Javascript. In Flex, you simply use the tag. Inside of the tag you can define the "operations" that will be associated with the Webservice. In our case, we will define "getStuff" as one of the operations. We will also add the "onResult" function to the result event for the operation. The onResult function simply sends the result text to a Label on the stage.

mxml:
  1. <!--
  2. WEB SERVICES
  3. -->
  4. <mx:WebService
  5.     id="sampleService"
  6.     wsdl="http://yourDomain/SoapTest.cfc?wsdl">  
  7.     <mx :o peration name="getStuff" result="onResult(event)" />      
  8. </mx:WebService>

Actionscript:
  1. import mx.rpc.events.ResultEvent;
  2.            
  3. private function callService(e:MouseEvent):void {
  4.                
  5.      sampleService.getStuff.send(myName.text);
  6.                
  7. }
  8.            
  9. private function onResult(e:ResultEvent):void {
  10.                                
  11.     resultLabel.text = e.result as String;
  12.                
  13. }

With JavaScript, we are going to use the XMLHTTPRequest object just as we did in the last tip. Basically, we will have to add a couple of custom headers, and then craft the SOAP Envelope by hand.

Your reference for the SOAP Envelope will be the "wsdl" file. You can view the wsdl for our webservice in your browser by typing in the URL and adding "?wsdl" to the end of the file name. The wsdl is your guidebook to that specific webservice.

Reference: WSDL Tutorial

JavaScript:
  1. var xmlhttp;
  2. var appXML;
  3.  
  4. function callService() {   
  5.  
  6.     var myName = document.getElementById("myName").value;            
  7.    
  8.     var url = "http://yourDomain/SoapTest.cfc?wsdl";
  9.     xmlhttp = new XMLHttpRequest();
  10.     xmlhttp.open("POST", url, true);               
  11.    
  12.     xmlhttp.onreadystatechange=function(){
  13.        
  14.         if (xmlhttp.readyState==4) {
  15.            
  16.             var mainDiv = document.getElementById('result');
  17.             mainDiv.innerHTML = xmlhttp.responseText;
  18.            
  19.         }
  20.        
  21.     }
  22.    
  23.     xmlhttp.setRequestHeader("Content-Type", "text/xml");
  24.     xmlhttp.setRequestHeader('SOAPAction','http://yourDomain/SoapTest.cfc?wsdl');
  25.    
  26.     xmlhttp.send("<?xml version='1.0' encoding='UTF-8'?>"+"\n\n"+
  27.             '<soapenv:Envelope'+
  28.             ' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"'+
  29.             ' xmlns:xsd="http://www.w3.org/2001/XMLSchema"'+
  30.             ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'+
  31.             '<soapenv:Body>'+
  32.             '<ns1:getStuff xmlns:ns1="http://communications"'+
  33.             ' soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'+
  34.             '<personName xsi:type="xsd:string">' + myName + '</personName>'+
  35.             '</ns1:getStuff>'+
  36.             '</soapenv:Body>'+
  37.             '</soapenv:Envelope>');
  38.    
  39. }

This is one clear example of something that is much easier with Flex. However, to make things easier with JavaScript, here are a few tips to remember:

  • Case Matters. Be sure to watch your casing here - small inconsistencies will lead to errors.
  • You can write your function outside of AIR so that you can use tools like Firebug for debugging.
  • When calling a Coldfusion Webservice - if get the RDS Password page, you forgot to set the SOAPAction header.
  • You have to use "POST" in the xmlhttp.open() function.

Flex Example
Source Code

JavaScript Example
Source Code

Coldfusion Component
Source Code

Full Coverage of Adobe AirTour Atlanta

I am leaving the hotel now heading to the Fox Theatre for the Adobe AirTour. I will provide full coverage tonight including session recaps, photos, and some code samples. Check back tonight for it.

RHEL 4 as a Webserver – Part 2

Installing Coldfusion MX7 Enterprise on Redhat Enterprise 4 (64-bit) was more difficult than I would have imagined. Adobe has been a bit unclear about whether the 64-Bit of RHEL 4 is actually supported. However, with quite a bit of command line work and some bullying of the Java Virtual Machine - we can get it working properly.

(more...)