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>

Related Topics   

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
  • HEADERENCODING="auto"
  • HEADERENCODING="7Bit"
  • HEADERENCODING="8Bit"
  • HEADERENCODING="base64"
  • HEADERENCODING="quotedprintable"
Signifies how the message header should be encoded. The available options are:
  • Auto (default)
  • 7Bit
  • 8Bit
  • Base64
  • QuotedPrintable
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
  • DATAENCODING="auto"
  • DATAENCODING="7Bit"
  • DATAENCODING="8Bit"
  • DATAENCODING="base64"
  • DATAENCODING="quotedprintable"
Signifies how the data should be encoded. The available options are:
  • Auto (default)
  • 7Bit
  • 8Bit
  • Binary
  • Base64
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)
  • DATACONTENTTYPE="application/octet-stream"
  • DATACONTENTTYPE="application/edifact"
  • DATACONTENTTYPE="application/edi-x12"
  • DATACONTENTTYPE="application/xml"
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:
  • application/octet-stream
  • application/edifact
  • application/edi-x12
  • application/xml
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
  • ENCRYPTALGO="RC4"
  • ENCRYPTALGO="des"
  • ENCRYPTALGO="3des"
  • ENCRYPTALGO="RC2"
  • ENCRYPTALGO="aes128"
  • ENCRYPTALGO="aes192"
  • ENCRYPTALGO="aes256"
  • ENCRYPTALGO="blowfish"
  • ENCRYPTALGO="twofish"
  • ENCRYPTALGO="camellia"
  • ENCRYPTALGO="cast128"
  • ENCRYPTALGO="idea"
  • ENCRYPTALGO="serpent"
  • ENCRYPTALGO="twofish128"
  • ENCRYPTALGO="twofish192"
  • ENCRYPTALGO="twofish256"
  • ENCRYPTALGO="camellia128"
  • ENCRYPTALGO="camellia192"
  • ENCRYPTALGO="camellia256"
  • ENCRYPTALGO="serpent128"
  • ENCRYPTALGO="serpent192"
  • ENCRYPTALGO="serpent256"
  • ENCRYPTALGO="seed"
  • ENCRYPTALGO="rabbit"
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:
  • RC4
  • 3DES (default)
  • DES
  • RC2
  • AES128
  • AES192
  • AES256
  • BLOWFISH
  • TWOFISH
  • CAMELLIA
  • CAST128
  • IDEA
  • SERPENT
  • TWOFISH128
  • TWOFISH192
  • TWOFISH256
  • CAMELLIA128
  • CAMELLIA192
  • CAMELLIA256
  • SERPENT128
  • SERPENT192
  • SERPENT256
  • SEED
  • RABBIT
Bits in key Text No
  • 192 (RC4)
  • 128 (RC2) 
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)
  • ENCRYPTENCODING="binary"
  • ENCRYPTENCODING="base64"
Indicates how to encode the encrypted message. This parameter is active only if the Encrypt the message parameter is selected. The available options are:
  • Binary (default) - The message will be encrypted using binary encoding.
  • Base64 - The message will be encrypted using Base64 encoding.
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
  • DIGESTALGO="SHA1"
  • DIGESTALGO="MD5"
  • DIGESTALGO="SHA224"
  • DIGESTALGO="SHA256"
  • DIGESTALGO="SHA384"
  • DIGESTALGO="SHA512"
  • DIGESTALGO="SHA3_24"
  • DIGESTALGO="SHA3_256"
  • DIGESTALGO="SHA3_384"
  • DIGESTALGO="SHA3_512"
  • DIGESTALGO="BLAKE2S_128"
  • DIGESTALGO="BLAKE2S_160"
  • DIGESTALGO="BLAKE2S_224"
  • DIGESTALGO="BLAKE2S_256"
  • DIGESTALGO="BLAKE2B_160"
  • DIGESTALGO="BLAKE2B_256"
  • DIGESTALGO="BLAKE2B_384"
  • DIGESTALGO="BLAKE2B_512"
Specifies which digest algorithm should be used to encrypt the message. The available options are:
  • SHA-1 (default)
  • MD5
  • SHA224
  • SHA256
  • SHA384
  • SHA512
  • SHA3_224
  • SHA3_256
  • SHA3_384
  • SHA3_512
  • BLAKE2S_128
  • BLAKE2S_160
  • BLAKE2S_224
  • BLAKE2S_256
  • BLAKE2B_160
  • BLAKE2B_256
  • BLAKE2B_384
  • BLAKE2B_512
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)
  • SIGNENCODING="binary"
  • SIGNENCODING="base64"
Indicates how to encode the signature data. The available options are:
  • Binary (default) - Preferable for AS2 protocol since HTTP transport correctly handles binary data.
  • Base64 - Use Base64 encoding if it is required by the recipient software.
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.  

Description

Error Causes

On Error

Example

NOTE:
  • 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.

Copy
<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)%" />