AS2 - Create Message

Declaration

<AMAS2 AS2MESSAGE="text" AS2FROM="text" AS2TO="text" SUBJECT="text" MESSAGEID="text" CHARSET="text" HEADERENCODING="text (options)" DATAENCODING="text (options)" DATAFILE="text" SENDAS="text" DATACONTENTTYPE="text (options)" RECEIPT="YES/NO" />

See Also

AS2 - Create Message | AS2 - Decode/Verify Message | AS2 - Send Message | AS2 - Verify Receipt | Send Email | Send IM | Get Email

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

Used to create a message designed to allow business transactions to move securely over the Internet.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

AS2 Message File

Text

Yes

(Empty)

AS2MESSAGE="C:\folder1\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 set to YES, indicates that if a message file with the same name already exists, it will be overwritten. This property is set to YES 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 e-mail 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="7Bit"

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="8Bit"

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 Properties

Property

Type

Req'd

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"

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 set to YES, allows specification of the data file's creation date/time. If set to NO (default), this value is automatically set to the current date/time (in local time zone) during runtime (disabled by default).

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 set to YES, allows specification of the data files's last modified date/time. If set to NO (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 set to YES, 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 e-mail program does not support read receipts or if the recipient set his/her e-mail program to decline the sending of read receipts.

Encryption Properties

Property

Type

Req'd

Default

Markup

Description

Encrypt the message

Yes/No

No

No

ENCRYPT="YES"

If set to YES, denotes that the message should be encrypted (set to NO by default). Setting this parameter to YES activates the properties below.

Encryption Algorithm

Text (options)

No

3DES

ENCRYPTALGO="RC2"

Specifies which encryption algorithm should be used to encrypt the message. The available options are:

  • 3DES (default)

  • DES

  • RC2

  • RC4

  • AES

  • Blowfish

  • Camellia

  • Serpent

  • Twofish

Bits in Key

Text

No

192

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 32 and 256).

Encryption Encoding

Text (options)

No

(Empty)

ENCRYPTENCODING=BASE64

Indicates how to encode the encrypted message. The available options are:

  • Binary (default)

  • Base64

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"

Specifies 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"

Specifies the passphrase (password that comprises a whole phrase) associated with the certificate. Multiple certificate/passphrase combinations can be entered.

Signature Properties

Property

Type

Req'd

Default

Markup

Description

Sign the message

Yes/No

No

No

SIGNRECEIPT="YES"

If set to YES, specifies that the receipt is to be digitally signed (set to NO by default). Setting this option activates the properties below.

Digest Algorithm

Text (options)

No

SHA-1

DIGESTALGO="MD5"

Specifies which digest algorithm should be used to encrypt the message. The available options are:

  • SHA-1 (Default)

  • MD5

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="Base64"

Indicates how to encode the signature data. For AS2 protocol, binary encoding is preferable since HTTP transport correctly handles binary data. Use Base64 encoding if it is required by the recipient software. The available options are:

  • Binary (default)

  • Base64

Include certificate chains into signature

Yes/No

No

No

INCLUDECERTCHAIN="YES"

Specifies whether certificate chains should be added to the signature.

Certificate

Text

No

(Empty)

CERTIFICATEPATH="c:\temp\cert.pfx"

Specifies the certificate file to add to the certificate store.

Key

Text

No

(Empty)

KEY="certkey"

Specifies the private key that corresponds to the certificate.

Passphrase

Text

No

(Empty)

PASSPHRASE="encrypteddata"

Specifies the passphrase (password that comprises a whole phrase) associated with the certificate.  

 

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: Create AS2 message "C:\AS2\Files\SendMessage.as2m" from data file "C:\Users\ankur.patel\Desktop\Function\AS2\Files\a.xml". AS2 message From "Batman". AS2 message To "Robin".

 

<AMAS2 AS2MESSAGE="C:\AS2\Files\SendMessage.as2m" AS2FROM="Batman" AS2TO="Robin" SUBJECT="Bug Report" DATAFILE="C:\Users\ankur.patel\Desktop\Function\AS2\Files\a.xml" SENDAS="data.xml" DATACONTENTTYPE="application/xml" DATACREATED="%DateSerial(2010,07,28)+TimeSerial(09,00,31)%" DATAMODIFIED="%DateSerial(2010,07,28)+TimeSerial(09,00,31)%" />

 

↑ Top of Page