def ConfirmDelivery(self, msgid): reply = self.soap_client.service.ConfirmDelivery(msgid) status = models.dmStatus(reply) if status.dmStatusCode == "0000": ok = True else: ok = False return Reply(status, ok)
def AuthenticateMessage(self, message_data): reply = self.soap_client.service.AuthenticateMessage(message_data) status = models.dmStatus(reply.dmStatus) if hasattr(reply, "dmAuthResult"): result = reply.dmAuthResult else: result = None return Reply(status, result)
def MarkMessageAsDownloaded(self, msgid): reply = self.soap_client.service.MarkMessageAsDownloaded(msgid) status = models.dmStatus(reply) if status.dmStatusCode == "0000": ok = True else: ok = False return Reply(status, ok)
def _extract_status(self, reply): if hasattr(reply, "dmStatus"): status = models.dmStatus(reply.dmStatus) code_attr = "dmStatusCode" message_attr = "dmStatusMessage" elif hasattr(reply, "dbStatus"): status = models.dbStatus(reply.dbStatus) code_attr = "dbStatusCode" message_attr = "dbStatusMessage" else: raise ValueError("Neither dmStatus, nor dbStatus found in reply:\n%s" % reply) status_code = getattr(status, code_attr) if status_code != "0000": status_message = getattr(status, message_attr) raise DSSOAPException(status_code, status_message) return status