def __init__(self, xmlFile): self.xmlFile = xmlFile self.parser = ResponseParser(xmlFile) litleResponseXml = self.parser.getNextTag('litleResponse') litleResponseXml = responseUtil.addNamespace(litleResponseXml) self.litleResponse = litleXmlFields.CreateFromDocument( litleResponseXml)
def __init__(self, parser): self.parser = parser self.allTransactionRetrieved = False batchResponseXML = self.parser.getNextTag("batchResponse") batchResponseXML = responseUtil.addNamespace(batchResponseXML) self.batchResponse = litleXmlFields.CreateFromDocument( batchResponseXML)
def getNextTransaction(self): if self.allTransactionRetrieved: raise NoTransactionException("All transactions from this batch have already been retrieved") try: self.txnXML = self.parser.getNextTag("transactionResponse") except: self.allTransactionRetrieved = True raise NoTransactionException("All transactions from this batch have already been retrieved") self.txnXML = responseUtil.addNamespace(self.txnXML) self.transaction = litleXmlFields.CreateFromDocument(self.txnXML) return self.transaction
def _processResponse(self, responseXml): temp = self._addNamespace(responseXml) try: response = litleXmlFields.CreateFromDocument(temp) except Exception, e: raise Exception("Error Processing Response", e)