> I have set up an MSN Gateway, I can send messages to the MSN account 
> and receive messages from that MSN account. But I am not able to 
> figure out how to show the user the response, other then letting the 
> gateway add it to the DB, and let the app pull it from the DB. But I 
> don't want to do that, because it is a lot of data to put in the DB.
> 
> Is there any other way?


You can, in theory, put the response into an application or server variable in 
the handler from the event gateway and have JS poll a CF page that looks for a 
response.

Heres a sample implementation.

User enters in question in form on webpage. Javascript submits question via 
XMLHTTP post to CF page.

CF Page posts question to MSN user and prefixes a UUID (or the users 
CFID/CFToken/JSessionID/any unique ID) to the  question. For example:

   WebsiteMSN_User: [987124] - Do you guys sell widgets?

And returns that unique as the response of the XMLHTTP request. Javascript 
holds that number in memory and polls a different page 
(getResponse.cfm?msgID=987124) every 5-10 seconds (or uses a hanging get, 
whatever you prefer) passing that number as a parameter to the page.

MSN user responds, prefixing the same code to his response

   MSNUser: [987124] - we do sell widgets, click on Cogs/Widgets on the top 
menu bar and you will see it

 You would add an application variable in your msn event gateway incoming 
message handler that would create a variable 

<cfset application.msnDialogue.987124 = "we do sell widgets, click on 
Cogs/Widgets on the top menu bar and you will see it">

Finally, the getResponse.cfm page would look for that variable and if it found 
it, return it and structDelete it so you dont have too many variables sitting 
in memory.

Its not elegant, but it will work without a DB.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278620
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