   console.dir req.body
   Q.ninvoke xml2js, 'parseString', req.body
   .then (parsed) ->
-    toUser = parsed.xml['FromUserName'][0]
-    fromUser = parsed.xml['ToUserName'][0]
+    fromUser = parsed.xml['FromUserName'][0]
+    toUser = parsed.xml['ToUserName'][0]
     createTime = (new Date()).getTime() // 1000
     sendResponse = (content) ->
       ret = "
         <xml>
-          <ToUserName><![CDATA[#{toUser}]]></ToUserName>
-          <FromUserName><![CDATA[#{fromUser}]]></FromUserName>
+          <ToUserName><![CDATA[#{fromUser}]]></ToUserName>
+          <FromUserName><![CDATA[#{toUser}]]></FromUserName>
           <CreateTime>#{createTime}</CreateTime>
           <MsgType><![CDATA[text]]></MsgType>
           <Content><![CDATA[#{content}]]></Content>

  .done()

rpcCall = (tag, payload, sendResponse) ->
  if tag == 'GET'
    sendResponse "echo #{payload.request}"
  else
    sendResponse "invalid tag #{tag}"


xml2js = require 'xml2js'
Q = require 'q'
utils = require '../utils'
database = require '../database'

logger = utils.logging.newConsoleLogger module.filename

redisConnection = database.getConnection()

authenticationHandler = (req, res, next) ->
  token = 'EastIndiaCompany'
