ColdFusion 9.0 Resources |
Sending outgoing messagesContents [Hide]Your ColdFusion application sends a message to a Flex application by doing the following actions:
In outgoing messages sent from CFML, the following structure members are translated to the Flex message:
In addition, the Data Services Messaging event gateway automatically provides values for the following Flex message fields:
Note: A single instance of the Data Services Messaging
event gateway can send messages to any destination that is registered
with the ColdFusion Event Gateway Adapter. However, if the destination
is configured in the Data Services Messaging gateway configuration
file, the destination in the message is ignored.
Sending outgoing message exampleThe following example from a CFM page creates a structure that contains the message. The destination is the destination ID specified in the flex-services.xml file for the instance of the Data Services Messaging event gateway to send the message to. The body is the body of the message. The sendGatewyMessage CFML function sends the message to the instance of the gateway. <cfset success = StructNew()> <cfset success.msg = "E-mail was sent at " & Now()> <cfset success.Destination = "gateway1"> <cfset ret = SendGatewayMessage("Flex2CF2", success)> To ensure that properties maintain the correct case, define Flex-related information as follows: myStruct['mySensitiveProp']['myOtherSensitiveProp'] The following is an example of using headers to send to a specific subtopic of the destination: <cfset var msg = structnew()> <cfset msg.destiNation = 'ColdFusionGateway'> <cfset msg.body = 'somebody'> <cfset msg['headers']['DSSubtopic'] = 'somesubtopic'> <cfset sendgatewaymessage('CF2FLEX2' , msg)> |