@samuelr7 , I set up a CFML gateway and ran your exact code. You will be glad to hear that it works. 🙂
The steps I followed are:
1. Create the directories C:\rave7\temp\smsdev and \cfusion\wwwroot\gatewayTest.
2. Create the following CFM and CFC files in the gatewayTest directory:
<!--- gatewayCaller.cfm --->
<cfscript>
status = false;
props = structNew();
props.Message = "yo #now()#";
status = SendGatewayMessage("vorText SMS", props);
if (status IS True) WriteOutput('Event Message "#props.Message#" has been sent.');
</cfscript>
<!--- my.cfc --->
<cfcomponent output="false">
<cffunction name="onIncomingMessage">
<cfargument name="CFEvent" type="struct" required="yes">
<cfset filewrite( "c:\rave7\temp\smsdev\yo.txt", "oooooo")>
<cfreturn true>
</cffunction>
</cfcomponent>
3. Open the ColdFusion Administrator and go to the Gateway Instances page. If you see an existing gateway named "vorText SMS", delete it. The idea is that we now want to set up "vorText SMS" from fresh.
Ensure that the form fields are filled as follows:
Gateway ID: vorText SMS
Gateway Type: CFML - Handles asynchronous events through CFCs
CFC Path: C:\ColdFusion2016\cfusion\wwwroot\gatewayTest\my.cfc
Press the button Add Gateway Instance. ColdFusion should then create a new gateway, named vorText SMS.
4. If the status of this gateway is not Running, then you will have to start the gateway. To do so, click on its play-button. See attached images.
5. Launch the gateway calling page in the browser: http://127.0.0.1:8500/gatewayTest/gatewayCaller.cfm
6. Finally, check whether the text file has been written to the directory C:\rave7\temp\smsdev


