Пример #1
0
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
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_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])))