We recently built an API in ColdFusion to tie in multiple applications.

It can be called/accessed either as a Web Service or as a "normal".

We created a wrapper which acts as the interface between the actual cfc's.
We defined our own XML in and out packets which are validated on entry by an
XSD.  

Essentially the API can be accessed by any language which can call a web
service and send/recieve XML.  

The XML (in) contains the component you want to call, the method and the
required arguments for that method (you get warned if you try and pass in
bad or required ones) - the gateway then concerts that call into a
ColdFusion object, does the necessary object instantiation and sends the
results back in the required/defined XML format - which essentially the
original call, but with the status of the call and the results appended. 

It is fully portable in that anyone could effectively run with it now just
by adding their own CFCs to the library.

Only pitfalls we ran into were off Application.cfc oddities and having to
pass XML as string objects so other languages could call the WS.


Hth













"This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Stephen Adams
To: CF-Talk
Sent: Tue Sep 12 10:33:21 2006
Subject: Creating an API with coldfusion

Hi,

I'm thinking of developing an API for all the coldfusion work I'm doing at
work. I want to have a series of base components which I can reuse in
multiple projects.
For example I want to have a baseLogin.cfc, which handles some common
functionality for all logins. Then in a clients site I want to have a
clientLogin.cfc which extends baseLogin.cfc.
Has anyone done anything similar? What problems are there to look out for,
how did you structure your API?

I'm looking to see if anyone has any tips on doing this. I've searched
around for articles and blog posts on this subject, but I can't find much.

Stephen



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:252824
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to