IPWorks EDI 2020 Node.js Edition

Questions / Feedback?

SetTPInfo Method

A convenient way to set AS2 communication parameters using XML strings.

Syntax

as2receiver.setTPInfo(profile, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

SetTPInfo offers a convenient way to set AS2 communication parameters using XML strings. The format of the XML is the same as provided by the method GetTPInfo of AS2ProfileMgr.

An example usage scenario is shown below.

  AS2Receiver as2receiver = new AS2Receiver();
  
  AS2Profilemgr mgr = new AS2Profilemgr();
  mgr.DataDir = "C:\as2data";
  
  as2receiver.setTPInfo(mgr.getTPInfo("self"));
  as2receiver.readRequest();
  
  as2sender.setTPInfo(mgr.getTPInfo(as2receiver.getAS2From()));
  
  as2receiver.processRequest();
  as2receiver.sendResponse();

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Node.js Edition - Version 20.0 [Build 8203]