Home > Uncategorized > How to consume CFaaS using Flex client ?

How to consume CFaaS using Flex client ?

Hi All,

Welcome Back!

Here is a brief explanation on how services exposed by Coldfusion(CFAAS) can be consumed using Flex client.

FYI, Coldfusion9 has exposed few utlities as services, namely :

Charting (CFCHART) ,Document Services (CFDOCUMENT) , PDF Utilities (CFPDF) ,Image Manipulation (CFIMAGE) , Mail (CFMAIL)  & Pop (CFPOP)

Here i would like to explain how one of  the most common CF service(CFMail) can be accessed using Flex.

a) In CF9 administrator, under Mail section please type your server name, username and password. Check the ‘ Verify mail server connection’

checkbox and click ‘Submit Changes’. Make sure you get the message ‘Connection Verification Successful’.

b) Under Security-> ‘User Manager’ section in CF9 administration,  add an user using ‘Add User’ with the following info:

username, password, confirm password , check both RDS and administrative access and add ‘Exposed Services’ by selecting the required services.

eg: Mail Service and click ‘Add User’.

c) Go to ‘Security->Allow IP Address in CF9 administrator and enter your IP address and say ‘Add’.

d) After add the following tag in addition to CF:Mail,

<cf:Config  cfServer=”” cfPort=”8501″ servicePassword=”” serviceUserName=”” />(the values entered here should be same as the ones configured under ‘Add User’ and ‘Allow IP address’ section).

e) Create a flex project using Flash Builder and add the ‘CFService.swc’  which would be available under D:\ColdFusionCentaur\wwwroot\CFIDE\scripts\air (subject to CF9 installed location) to your build path (Project->Flex Build Path->Add SWC).

Also find the Flex code required to access the CFMail service below:

<cf:Mail to=”{to1.text}” from=”{from1.text}”  subject=”Test” content=”{myContent.text}” type=”html” id=”cfmail”  result=”cfmail_resultHandler(event)” />
<mx:Label text=”From”/>
<mx:TextInput id=”from1″ />
<mx:Label text=”To” width=”33″/>
<mx:TextInput id=”to1″ />
<mx:RichTextEditor id=”myContent”>

<mx:Button id=”myButton” label=”Send” click=”cfmail.execute()”/>


We request you guys to take a look at these workflows and send your feedback on the same 🙂

Thank You!

Categories: Uncategorized
  1. November 27, 2009 at 3:02 pm

    Interesting article, thanks for posting

  1. June 9, 2010 at 6:04 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: