def _compose_xml_response(self, code): xml = [] xml.append('<?xml version="1.0" encoding="UTF-8" ?>') xml.append('<RESULT>%s</RESULT>' % code) rv = app.make_response("".join(xml)) rv.mimetype = 'text/xml' return rv
def _compose_xml_result(self, params): xml = [] xml.append('<?xml version="1.0" encoding="UTF-8" ?>') xml.append('<ORDER>') xml.append('<NO>%s</NO>' % params['no']) xml.append('<SOURCE_STATION>%s</SOURCE_STATION>' % params['source_station']) xml.append('<SOURCE_COMPANY>%s</SOURCE_COMPANY>' % params['source_company']) xml.append('<DESTINATION_STATION>%s</DESTINATION_STATION>' % params['destination_station']) xml.append('<DESTINATION_COMPANY>%s</DESTINATION_COMPANY>' % params['destination_company']) xml.append('<STATUS>%s</STATUS>' % params['status']) xml.append('</ORDER>') rv = app.make_response("".join(xml)) rv.mimetype = 'text/xml' return rv