def post(self):
        try:
            # Getting body
            xml = etree.XML(self.request.body.decode('utf-8'))

            # Getting configs
            configs = PartnerService.get_mms_mt_notification_configs(self.settings)

            # Parse XML to Json
            json = BackendService.parse_response_to_json(xml, 'sync')

            # Processing request
            try:
                PartnerService.notify_mms_mt.delay(configs=configs, headers=None, body=json)
                return self.success({"success": "1", "message": "MMS MT notification successfully received."})
            except Exception as e:
                log.error("Internal Server Error: {0}. "
                          "Operation Hash: {1}."
                          .format(e, self.MMS_MT_NOTIFICATION_HASH))
                return self.error({"success": "0", "message": "Could not send request. Internal error."}, 500)

        except Exception as e:
            log.error("Internal Server Error: {0}. "
                      "Operation Hash: {1}."
                      .format(e, self.MMS_MT_NOTIFICATION_HASH))
            return self.error({"success": 0, "message": "Internal Server Error"}, 500)
    def post(self):
        try:
            # Getting body
            body = json_decode(self.request.body)

            # Getting vars
            wml_push_code = body['wml_push_code']
            wml_push_code = self.service.get_xml(wml_push_code)
            msisdn = body['msisdn']
            mode = body['mode']

            # Getting access configs
            configs = self.service.get_configs(self.application.settings)

            # Building request object
            request_url = self.service.get_url(configs, wml_push_code, msisdn,
                                               mode)
            request = self.service.get_request(request_url)

        except Exception as e:
            log.error("Internal Server Error: {0}".format(e))
            return self.error(
                {
                    "message": "Internal Server Error",
                    "success": 0
                }, 500)

        # Sending request to Claro asynchronously
        try:
            response = yield AsyncHTTPClient().fetch(request)

        except HTTPError as httpe:
            try:
                response_code = httpe.response.code
            except:
                response_code = 500
            log.error("Could not send WIB PUSH request to partner. "
                      "Request URL: {0}."
                      "Error: {1}."
                      "Operation Hash: {2}.".format(request_url, httpe,
                                                    self.WIB_PUSH_HASH))
            return self.error(
                {
                    "message":
                    "Could not access Claro service: {0}".format(httpe),
                    "success": 0
                }, response_code)

        except Exception as e:
            log.error("Could not send WIB PUSH request to partner. "
                      "Request URL: {0}."
                      "Error: {1}."
                      "Operation Hash: {2}.".format(request_url, e,
                                                    self.WIB_PUSH_HASH))
            return self.error(
                {
                    "message": "Could not access Claro service: {0}".format(e),
                    "success": 0
                }, 500)

        # Get Signature response text and parse it to XML
        try:
            response_xml = etree.XML(response.body)

        except Exception as e:
            log.error("Claro sent an invalid response XML: {0}."
                      "Request URL: {1}."
                      "Error: {2}."
                      "Operation Hash: {3}.".format(response.body, request_url,
                                                    e, self.WIB_PUSH_HASH))
            return self.error(
                {
                    "message":
                    "Claro sent an invalid response XML: {0}".format(
                        response.body),
                    "success":
                    0
                }, 500)

        # Build json return
        try:
            backend_response = BackendService.parse_response_to_json(
                response_xml)

        except Exception as e:
            log.error("Could not parse XML Response: {0}."
                      "Reason: {1}."
                      "Request URL: {2}."
                      "Operation Hash: {3}.".format(response.body, e,
                                                    request_url,
                                                    self.WIB_PUSH_HASH))
            return self.error(
                {
                    "message": "Could not parse XML Response",
                    "success": 0
                }, 500)

        # Sending response
        log.info("WIB PUSH request sent to partner. "
                 "Request URL: {0}."
                 "Response code: {1}."
                 "Response body: {2}."
                 "Operation Hash: {3}.".format(request_url, response.code,
                                               response.body,
                                               self.WIB_PUSH_HASH))
        return self.success({
            "message": backend_response,
            "success": backend_response["status"]
        })