コード例 #1
0
ファイル: as2_svc.py プロジェクト: mars-aws01/work
def post_message_receive_by_id(domain, id):
    logger.debug(
        'received as2 message from domain:{0} , uri:{1} ,query_string:{2}'.
        format(domain, request.url, request.query_string))
    try:
        headers = dict(request.headers)
        body = get_request_body()

        mgr = PartnerManager(headers, body)

        headers, body = mgr.receive(id)

        return build_response(200, headers, body)
    except:
        logger.exception('message receive via agreement-id failed')
        return build_response(500, None, str(sys.exc_info()[1]))
コード例 #2
0
ファイル: mdn_svc.py プロジェクト: mars-aws01/work
def post_async_mdn_receive(domain):
    logger.debug(
        'received mdn from domain:{0} , uri:{1} ,query_string:{2}'.format(
            domain, request.url, request.query_string))
    try:
        headers = dict(request.headers)
        body = get_request_body()

        mgr = PartnerManager(headers, body)

        mgr.receive_async_mdn()

        return build_response(200, None, 'mdn received ok')
    except:
        logger.exception('mdn receive failed')
        return build_response(500, None, str(sys.exc_info()[1]))
コード例 #3
0
def post_message_save(domain):
    logger.debug(
        'received internal event-message from domain:{0} , uri:{1} ,query_string:{2}'
        .format(domain, request.url, request.query_string))
    try:
        message = get_request_entity(AS2Message)

        PartnerManager.save_event_message(message)

        return build_response(200,
                              resp_entity=GeneralResponse(is_succeed=True))
    except:
        logger.exception('event-message store failed')
        return build_response(500,
                              resp_entity=GeneralResponse(
                                  is_succeed=False,
                                  error_message=str(sys.exc_info()[1])))
コード例 #4
0
ファイル: as2_svc.py プロジェクト: mars-aws01/work
def post_message_send(domain):
    logger.debug(
        'received as2 sent request from domain:{0} , uri:{1} ,query_string:{2}'
        .format(domain, request.url, request.query_string))
    try:
        headers = dict(request.headers)
        body = get_request_body()

        mgr = PartnerManager(headers, body)

        message = mgr.send()

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