AS2EnvelopQuerySender¶
-
public class
AS2EnvelopQuerySender
extends EnvelopQuerySender¶ The
AS2EnvelopQuerySender
is a client service sender using HTTP protocol for query the message envelop (i.e EDI Header + payload) from the Hermes 2 Messaging Gateway. To use it you have to provide the configuration instance calledAS2AdminData
. it defines the URL end-point and credential for connecting to your Hermes 2 Restricted area. An Example for adding partnership :// Create an admin data for configuration. AS2AdminData adminData = new AS2AdminData(); adminData.setManagePartnershipEndpoint("Your H2O location"); adminData.setUsername("Your username for logging H2O"); adminData.setPassword("Your password for logging H2O"); AS2EnvelopQuerySender sender = new AS2EnvelopQuerySender(someLogger, adminData, pData); sender.setMessageCriteriaToDownload("The message id you want to query", "INBOX or OUTBOX"); sender.run(); InputStream ins = sender.getEnvelopStream(); // The envelop content ... process it.
Note for setting the manage partnership end-point You should add /admin/as2/partnership to your H2O host. For example, ‘http://localhost:8080/admin/as2/partnership‘. Note that the client service does not guarantee transactional behavior meaning you are always able to down-load the envelop when invoking the client. (Different from the receiver Web service).
Author: Twinsen Tsang See also:
hk.hku.cecid.corvus.ws.data.AS2AdminData
Constructors¶
AS2EnvelopQuerySender¶
-
public
AS2EnvelopQuerySender
(FileLogger logger, AS2AdminData ad)¶ Explicit Constructor. Create an instance of
AS2EnvelopQuerySender
.Parameters: - logger – The logger for log the sending process.
- ad – The
AS2AdminData
for locating the HTTP end-point the request send to.
Throws: - NullPointerException – When
p
is null. When the manage partnership end-point fromad
is null or empty.