Writing your Server Page
Create a folder and copy the
OnRequestEnd.cfm files from the
scope), compute a response, and save your response in the ColdFusion variable
request.response. Your response could be a string, a number, a structure, an array, a query record set, or any other data structure.
If you like, you may use a ColdFusion component (CFC) as the server page. This is a good idea if you want to provide a range of different types of responses. Each method in the can handle one type of response. To use a , you must pass a
method parameter to your gateway. The
method specifies the method in the that will be invoked. Within your method, be sure to set
access="remote", and don't return data in the usual way with a
cfreturn tag. Instead, set a value for
request.response. Parameters passed to the server will be available within each method as
You could also use a Fusebox-style
switch statement to choose between a variety of different types of response. Most of the examples demonstrate this approach.