コード例 #1
0
 def test_send_async_mdn_ok(self):
     headers = TestPartnerBase.mdn_headers
     body = TestPartnerBase.mdn_content
     pm = PartnerManager(headers, body)
     message = jsonserializer.deserialize(TestPartnerMdnMessage.message_json,
                                          AS2Message)
     pm.send_async_mdn(message)
コード例 #2
0
ファイル: mdn_svc.py プロジェクト: mars-aws01/work
def post_mdn_message_send(domain):
    logger.debug(
        'received mdn sent request from domain:{0} , uri:{1} ,query_string:{2}'
        .format(domain, request.url, request.query_string))
    try:
        headers = dict(request.headers)
        original_message = get_request_entity(AS2Message)

        mgr = PartnerManager(headers, None)

        message = mgr.send_async_mdn(original_message)

        return build_response(200,
                              resp_entity=MessageResponse(is_succeed=True,
                                                          message=message))
    except:
        logger.exception('mdn send failed')
        return build_response(500,
                              resp_entity=GeneralResponse(
                                  is_succeed=False,
                                  error_message=str(sys.exc_info()[1])))