How to use this API

Published Thu 9 Sep, 15:35 by smalot in Tutorial

View part:


Part 6 - Replay a transaction

 

When you receive a message from a Partner, all data are stored into '/messages/_rawincoming/' :

  1. <timestamp>_<partner_ip_address>.as2.header
    headers of the message (clear text)
  2. <timestamp>_<partner_ip_address>.as2
    content of the message (can be crypted)
  3. <timestamp>_<partner_ip_address>.as2.decrypted
    in case of crypted data, it contains decrypted data
  4. <timestamp>_<partner_ip_address>.as2.payload_<indice>
    contains final message

 

Here is a sample code to simulate a message reception :

 

include_once('include.inc');

// path to the raw headers
$file_header  = '../messages/_rawincoming/20100913080401432_101.102.103.104.as2.header';
// path to the raw content
$file_content = '../messages/_rawincoming/20100913080401432_101.102.103.104.as2';

// get formatted headers
$headers = AS2Header::parseText(file_get_contents($file_header));
// build request object
$request = new AS2Request(file_get_contents($file_content), $headers);

// similate request reception
AS2Server::handle($request);

0 Comments for "How to use this API"

There are currently no comments.

Leave a comment