User Guide

Table Of Contents
Developing an event gateway application 1033
The ColdFusion MX installer creates a mapping in the ColdFusion MX Administrator for the
gateway\cfc directory.
Client scope
The Client scope can store long-term information associated with a message sender’s ID. For
example, it can store information about an IM buddy.
To use Client variables across multiple connections, your gateway type must use the same client
ID for all interactions with a particular client. For many technologies and gateways, such as the
IM and SMS gateways, this is not an issue.
Note: To use Client scope variables with gateways, you must store the Client scope variables in a
data source or the registry. You cannot store the variables in cookies, because gateways do not use
cookies.
Session scope
The Session scope can store information required across multiple interactions. For example, an
interactive IM or SMS application that uses a drill-down menu to select a service can store the
information about the menu selections in the Session scope.
Event gateway sessions terminate when they time out. Because the identifiers for event sessions
and clients differ from those used for request-driven sessions and clients, you cannot use the same
Session or Client scope on a standard CFM page that sends an outgoing message and in a listener
CFC that might handle an incoming response to that message.
For an example of using the Session scope, see the example Menu application in the gateway\cfc\
examples\menu directory.
Note: ColdFusion cannot create a session if an initiator application uses a SendGatewayMessage
method to start an interaction with a client, such as an SMS user. In this case, the sending code must
keep track (for example, in a database) of the messages it sends and their destinations. When a
response event arrives, it can look up the origniatorID to determine whether it was in response to an
outgoing message.
Debugging event gateway CFCs
When an event gateway CFC responds to an event, it cannot display debugging information in
the response page, as CFM pages do. As a result, many of the normal ColdFusion debugging
techniques, including the
cfdump tag, are not available. When you develop event gateway CFCs,
you should consider the following debugging techniques:
Put trace variables in the Application scope. These variables persist, and you can specify an
application name for your CFC, as described in Application scope” on page 1032. You can
inspect the Application scope contents, including your trace variables, in any CFML page that
has the same application name as your CFC.
Use cflog tags to help you trace any errors by logging significant events to a file. Also,
carefully inspect the eventgateway.log and exceptions.log files that ColdFusion MX maintains.
For more information on using the eventgateway.log file, see “The eventgateway.log file”
on page 1026.