|
AS2 - Create message |
Declaration
<AMAS2 AS2MESSAGE="text" OVERWRITEFILE="YES/NO" AS2FROM="text" AS2TO="text" SUBJECT="text" MESSAGEID="text" CHARSET="text" HEADERENCODING="text (options)" DATAENCODING="text (options)" MESSAGEDATE="date/expression" DATAFILE="text" SENDAS="text" CONTENTTYPE="text" DATACREATED="date/expression" DATAMODIFIED="date/expression" RECEIPT="YES/NO" ASYNCURL="text" SIGNRECEIPT="YES/NO" DIGESTALGO="text (options)" DIGESTALGOONLY="YES/NO" DIGESTALGOREQUIRED="YES/NO" SIGNALGOREQUIRED="YES/NO" ENCRYPT="YES/NO" ENCRYPTALGO="text (options)" ENCRYPTENCODING="text (options)" SIGN="YES/NO"><ENCRYPT CERTIFICATE="text" PASSPHRASE="text (encrypted)" /></AMAS2>
Description
Creates an AS2 message. This message can be transported securely and reliably over the Internet in a subsequent step with the use of the Send AS2 Message activity.
Practical Usage
Commonly used to create a message designed to allow business transactions to move securely over the Internet.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
AS2 message file | Text | Yes | (Empty) | AS2MESSAGE="C:\folder\filename" | Specifies the location of the message file to be created. All AS2 messages must derive from a specific file. This file contains extra fields such as From, To, and Data File. The full path and file name can be entered manually in the provided field or you can click the Folder icon to navigate to the file. |
Overwrite existing file | Yes/No | No | Yes | OVERWRITEFILE="NO" | If selected, indicates that existing message files with the same name will be overwritten. If disabled, message files with the same name will not be overwritten, however, a runtime error will occur as a result. This property is selected by default. |
From | Text | Yes | (Empty) | AS2FROM="Clark Kent" | The
name of the individual in which the created AS2 message is being
sent from. This field must contain a valid AS2 name of the originator
of the message. NOTE: Only printable ASCII characters
are allowed in the AS2 name and the length must be between 1 and
128 characters. |
To | Text | Yes | (Empty) | AS2TO="Peter Parker" | The
name of the recipient in which the created AS2 message will be
sent to. This field must contain a valid AS2 name associated to
the recipient of the message. NOTE: Only printable ASCII characters
are allowed in the AS2 name and the length must be between 1 and
128 characters. |
Subject | Text | No | (Empty) | SUBJECT="Subject of Message" | Indicates the subject of the AS2 message being created. This can be any textual information that is being transferred similarly to subject lines used in email messages. |
Message ID | Text | No | (Empty) | MESSAGEID="UniquePart@HostName" | Specifies the message in form: <UniquePart@HostName>. If this property is left blank, the value is automatically generated during runtime. |
Charset | Text | No | (Empty) | CHARSET="CorrespondingCharset" | Specifies a charset name to be used to encode the message header. If any international characters are used in the Subject line, the corresponding charset must be specified. If this property is left blank, UTF-8 charset will be used. |
Header encoding | Text (options) | No | Auto |
|
Signifies
how the message header should be encoded. The available options
are:
NOTE: If any international characters
are used in the Subject
line, the corresponding transfer encoding must be specified. If
this property is set to Auto,
quoted-printable encoding will be used. |
Data encoding | Text (options) | No | Auto |
|
Signifies
how the data should be encoded. The available options are:
NOTE: For AS2 protocol, Binary
encoding is preferable since HTTP transport correctly handles
binary data. However, other encoding can be used if it's required
by the recipient software. |
Message date | Text | No | (Empty) | MESSAGEDATE="%DateAdd("h",-24,CStr(Now()))%" | If enabled, allows specification of the date and time (in local time zone) when a message is generated. Otherwise, the value is automatically set to the current date/time when a message is encoded. This parameter is disabled by default. Click the Custom button to select a pre-customized value. Enable the Expression checkbox to enter your own date/time expression. |
Data
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Data file | Text | Yes | (Empty) | DATAFILE="C:\foldername\filename" | Indicates the data file in which to send. The full path and file name can be entered manually or by clicking the Folder icon and navigating to the desired file. |
Send as | Text | No | (Empty) | SENDAS="D:\foldername\filename" | Specifies the file name to be referenced in the message. If this property is left empty, the original file name will be specified automatically. |
Content type | Text (options) | No | (Empty) |
|
Indicates
the data file content type. The value can be entered manually
or by selecting one of the available drop-down items. The available
items are:
|
Created | Yes/No | No | No | DATACREATED="%DateAdd("h",-24,CStr(Now()))%"
|
If
selected, allows specification of the data file's creation date/time.
If disabled (default),
this value is automatically set to the current date/time (in local
time zone) during runtime. Click the Custom button to select a pre-customized date/time value (selection of future date/time is supported). Enable the Expression option to enter your own date expression. |
Modified | Yes/No | No | No | DATAMODIFIED="%DateAdd("h",-24,CStr(Now()))%" | If selected, allows specification of the data files's last modified date/time. If disabled (default), this value is automatically set to the current date/time (in local time zone) during runtime. Click the Custom button to select a pre-customized value (selection of future date/time is supported). Enable the Expression option to enter your own date expression. |
Request receipt | Yes/No | No | No | RECEIPT="Yes" | If
selected, notification is requested upon successful delivery
of the message to the recipient's mailbox (disabled by default). NOTE: There are scenarios where
read receipts are not sent, including if the recipient's email
program does not support read receipts or if the recipient set
his/her email program to decline the sending of read receipts. |
Encryption
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Encrypt the message | Yes/No | No | No | ENCRYPT="YES" | If selected, denotes that the message should be encrypted (disabled by default). Setting this parameter to YES activates the parameters below. |
Encryption algorithm | Text (options) | No | 3DES |
|
Specifies
which encryption algorithm should be used to encrypt the message.
This parameter is active only if the
Encrypt the message parameter is selected. The available
options are:
|
Bits in key | Text | No |
|
KEYBITS="256" | Indicates a key length in bits to be used with RC2 and RC4 encryption algorithms. For RC2 and RC4 algorithms, encryption key length must be specified in bits (the value must be between 40 and 128 for RC2 and 40 and 256 for RC4). This parameter is active only if the Encrypt the message parameter is selected. |
Encryption encoding | Text (options) | No | (Empty) |
|
Indicates
how to encode the encrypted message. This parameter is active
only if the Encrypt the message
parameter is selected. The available options are:
NOTE: Binary encoding is preferable
because HTTP transport correctly handles binary data. Base64 encoding
is mainly used if it's required by the recipient software. |
Certificate | Text | No | (Empty) | CERTIFICATEPATH="C:\Temp\cert.pfx" | The AS2 certificate public key path to use. This action supports entry of multiple certificates. Multiple certificate/passphrase combinations can be entered. |
Passphrase | Text | No | (Empty) | PASSPHRASE="encrypted" | The passphrase (password that comprises a whole phrase) associated with the certificate. Multiple certificate/passphrase combinations can be entered. |
Signature
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Sign the message | Yes/No | No | No | SIGNRECEIPT="YES" | If selected, specifies that the receipt is to be digitally signed (disabled by default). Setting this option activates the properties below. |
Digest algorithm | Text (options) | No | SHA-1 |
|
Specifies
which digest algorithm should be used to encrypt the message.
The available options are:
|
Sign date | Text | No | (Empty) | SIGNDATE="%DateAdd("h",-24,CStr(Now()))% | If enabled, allows specification of the signature date/time (in local time zone). Otherwise, the value is automatically set to the current date/time when a message is encoded (disabled by default). Click the Custom button to select a pre-customized value or enable the Expression checkbox to enter your own date/time expression. |
Sign encoding | Text (options) | No | (Empty) |
|
Indicates
how to encode the signature data. The available options are:
|
Include certificate chains into signature | Yes/No | No | No | INCLUDECERTCHAIN="YES" | Specifies whether certificate chains should be added to the signature. If selected, certificate chains will be included into signature. Disabled by default. |
Certificate | Text | No | (Empty) | CERTIFICATEPATH="c:\temp\certificate.pfx" | The certificate file to add to the certificate store. |
Key | Text | No | (Empty) | KEY="certkey" | The private key that corresponds to the certificate. |
Passphrase | Text | No | (Empty) | PASSPHRASE="EncryptedData" | The passphrase (password that comprises a whole phrase) associated with the certificate. |
Example
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
Description
This sample task creates an AS2 message from a data file.
<AMAS2 AS2MESSAGE="C:\temp\SendMessage.as2m" AS2FROM="John" AS2TO="Jeff" SUBJECT="Bug Report" DATAFILE="C:\Users\ankur.patel\Desktop\Function\AS2\Files\a.xml" SENDAS="filename.xml" DATACREATED="%DateSerial(2019,11,27)+TimeSerial(14,09,08)%" DATAMODIFIED="%DateSerial(2019,11,27)+TimeSerial(14,09,08)%" />