<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_message(self, data):
 """ Parsing data, and try to call responding message """

        # Trying to parse response
        data = json.loads(data)
        if not data["name"] is None:
            logging.debug("%s: receiving message %s" % (data["name"], data["data"]))
            fct = getattr(self, "on_" + data["name"])
            try:
                res = fct(Struct(data["data"]))
            except:
                # We try without Struct item (on transaction request this can happend)
                res = fct(data["data"])
            if res is not None:
                self.write_message(res)
        else:
            logging.error("SockJSDefaultHandler: data.name was null")