AS2Sender Bean
Properties Methods Events Configuration Settings Errors
The AS2Sender component implements an AS2 / EDI-INT client.
Syntax
InEDI.As2sender
Remarks
The AS2Sender component may be used to send EDI or other messages over HTTP/S, using the AS2 protocol. It may also be used to verify synchronous or asynchronous server responses.
A typical AS2 transaction is as follows:
(1) The sender sends an EDI document to the receiver using HTTP or HTTPS. Typically the document will be signed and encrypted (particularly if SSL is not used). A signed receipt will also be requested.
(2) The receiver decrypts the message and verifies the signature.
(3) The receiver sends a signed receipt back to the client. The signature is over the hash of an MDN, which contains a hash of the received message.
When sending an EDI message, the client should specify, at a minimum, AS2From and AS2To, URL, and EDIData. The Post method should then be invoked.
To secure the EDI transmission, the message may be signed and/or encrypted by setting the appropriate certificates. By default, the bean will apply message security if the appropriate certificates are specified. To sign the data, set SigningCert. To encrypt, set RecipientCerts. If the recipient uses different certificates for signing and encryption it will also be necessary to set ReceiptSignerCert.
SSL will also be used if the scheme in URL is "https". If your trading partner is using a self-signed certificate, it will be necessary to set SSLAcceptServerCert or trap the SSLServerAuthentication event to accept the certificate.
The message may also be compressed by setting CompressionFormat.
To request a receipt, or Message Disposition Notification (MDN), simply set the MDNTo property. The MDNOptions property may be used to customize the request. By default, the bean will request a signed MDN over an SHA1 hash.
The bean supports both synchronous and asynchronous MDN receipt delivery. By default, the bean requests synchronous MDN receipt delivery, and the MDN will be returned in the HTTP reply. To request asynchronous MDN delivery, set the MDNDeliveryOption to the URL where MDN's are to be delivered.
The HTTP reply will automatically be processed by the bean. If an MDN was requested, Post will validate the MDN and (if signed) establish non-repudiation of receipt. Any errors or warnings will cause the bean to throw an exception.
In either case, after the EDI transaction is processed successfully, the MDNReceipt will be populated with the appropriate values.
Validating Asynchronous MDNs
The bean may also be used to process and verify asynchronous MDNs. To do this, you should invoke ReadAsyncReceipt. This will read the receipt from the current HTTP context (or from MDNReceipt, if set manually), and allow you to determine your trading partner's identity and the message ID. You should then set ReceiptSignerCert and OriginalContentMIC, and finally invoke VerifyReceipt.
Property List
The following is the full list of the properties of the bean with short descriptions. Click on the links for further details.
AS2From | The AS2 Identifier of the sending system. |
AS2To | The AS2 Identifier of the receiving system. |
AS2Version | The version of AS2 being used. |
AsyncMDNInfoDir | Path to a directory to store data used in verifying AsyncMDNs. |
Attachments | Collection of files attached to the current message. |
CEMDetails | A collection of Certificate Exchange Messaging (CEM) details. |
CompressionFormat | The compression format (if any) to use. |
Cookies | Collection of cookies. |
EDIData | The EDI or other data to be sent. |
EncryptionAlgorithm | The algorithm used to encrypt the EDI data. |
Etag | The Etag of the file being sent. |
Firewall | A set of properties related to firewall access. |
From | The email address of the HTTP agent (optional). |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
LogDirectory | The path to a directory for logging. |
LogFile | The log file written. |
MDNDeliveryOption | A URL indicating how the receipt is to be delivered. |
MDNOptions | Used to indicate the options requested for the MDN receipt. |
MDNReceipt | The MDN receipt returned from the server. |
MDNTo | Used to indicate that a message disposition notification is requested. |
MessageId | The Id of the message. |
OriginalContentMIC | The Message Integrity Check(s) (one-way hash) of the outgoing message. |
Proxy | A set of properties related to proxy access. |
ReceiptSignerCert | The public key certificate for the MDN receipt signature. |
RecipientCerts | The public key certificates of the recipients for this message. |
RestartDirectory | The directory to log cached files when using AS2 restart functionality. |
RolloverSigningCert | Contains the certificate to use when signing messages. |
SignatureAlgorithm | Signature algorithm to be used in outgoing messages. |
SigningCert | Contains the certificate to use when signing messages. |
SSLAcceptServerCert | Instructs the component to unconditionally accept the server certificate that matches the supplied certificate. |
SSLCert | The certificate to be used during SSL negotiation. |
SSLServerCert | The server certificate for the last established connection. |
Subject | The subject of the message. |
Timeout | A timeout for the component. |
URL | The URL to which the request is made. |
UserAgent | Information about the user agent. |
Method List
The following is the full list of the methods of the bean with short descriptions. Click on the links for further details.
config | Sets or retrieves a configuration setting . |
doEvents | Processes events from the internal message queue. |
interrupt | Interrupt the current method. |
post | Post data to the AS2 server, and check the receipt. |
readAsyncReceipt | Reads an asynchronous MDN receipt from the current HTTP session. |
reset | Resets the state of the control. |
restart | Restart sending of the file specified by the Etag property. |
sendCEMRequest | Sends a Certificate Exchange Messaging (CEM) request. |
sendCEMResponse | Sends a Certificate Exchange Messaging (CEM) response. |
setRequestHeader | Allows the user to set or add arbitrary HTTP request headers. |
setTPInfo | A convenient way to set AS2 communication parameters using XML strings. |
verifyReceipt | Verifies an asynchronous MDN receipt. |
Event List
The following is the full list of the events fired by the bean with short descriptions. Click on the links for further details.
Connected | Fired immediately after a connection completes (or fails). |
Disconnected | Fired when a connection is closed. |
EndTransfer | Fired when a document finishes transferring. |
Error | Information about errors during data delivery. |
Header | Fired every time a header line comes in. |
Log | Fires with log information during processing. |
SetCookie | Fired for every cookie set by the server. |
SSLServerAuthentication | Fired after the server presents its certificate to the client. |
SSLStatus | Shows the progress of the secure connection. |
StartTransfer | Fired when a document starts transferring (after the headers). |
Transfer | Fired while a document transfers (delivers document). |
Configuration Settings
The following is a list of configuration settings for the bean with short descriptions. Click on the links for further details.
AuthScheme | The authorization scheme to be used when server authorization is to be performed. |
Authorization | The Authorization string to be sent to the server. |
User | A user name if authentication is to be used. |
Password | A password if authentication is to be used. |
AllowMDNWarnings | Whether to fail on MDN warnings. |
CompressFirst | Whether compression occurs before signing a message. |
EncodeToTempDir | Whether to use temporary files when creating messages. |
LogOptions | The information to be written to log files. |
MDNDisposition | Returns the Disposition header of the MDN. |
IncludeHeaders | Whether headers are included when posting to a file. |
MessageHeaders | Returns the headers of the message. |
PostToFile | Creates the message on disk. |
LogDebug | Whether to log debug data. |
NormalizeMIC | Whether to normalize line endings before calculating the MIC. |
UsePSS | Whether to use RSA-PSS when signing. |
LogFilename | The base name of the log file. |
UseOAEP | Whether to use Optimal Asymmetric Encryption Padding (OAEP) when encrypting the key with RSA. |
OAEPParams | The hex encoded OAEP parameters to be used when encrypting a key. |
OAEPMGF1HashAlgorithm | The MGF1 hash algorithm used when encrypting a key. |
OAEPRSAHashAlgorithm | The RSA hash algorithm used when encrypting a key. |
AcceptEncoding | Used to tell the server which types of content encodings the client supports. |
AllowHTTPCompression | This property enables HTTP compression for receiving data. |
AllowHTTPFallback | Whether HTTP/2 connections are permitted to fallback to HTTP/1.1. |
AllowNTLMFallback | Whether to allow fallback from Negotiate to NTLM when authenticating. |
Append | Whether to append data to LocalFile. |
Authorization | The Authorization string to be sent to the server. |
BytesTransferred | Contains the number of bytes transferred in the response data. |
EncodeURL | If set to true the URL will be encoded by the component. |
FollowRedirects | Determines what happens when the server issues a redirect. |
GetOn302Redirect | If set to true the component will perform a GET on the new location. |
HTTPVersion | The version of HTTP used by the component. |
HTTP2HeadersWithoutIndexing | HTTP2 headers that should not update the dynamic header table with incremental indexing. |
IfModifiedSince | A date determining the maximum age of the desired document. |
KeepAlive | Determines whether the HTTP connection is closed after completion of the request. |
LogLevel | The level of detail that is logged. |
MaxHeaders | Instructs component to save the amount of headers specified that are returned by the server after a Header event has been fired. |
MaxHTTPCookies | Instructs component to save the amount of cookies specified that are returned by the server when a SetCookie event is fired. |
MaxRedirectAttempts | Limits the number of redirects that are followed in a request. |
NegotiatedHTTPVersion | The negotiated HTTP version. |
OtherHeaders | Other headers as determined by the user (optional). |
ProxyAuthorization | The authorization string to be sent to the proxy server. |
ProxyAuthScheme | The authorization scheme to be used for the proxy. |
ProxyPassword | A password if authentication is to be used for the proxy. |
ProxyPort | Port for the proxy server (default 80). |
ProxyServer | Name or IP address of a proxy server (optional). |
ProxyUser | A user name if authentication is to be used for the proxy. |
TransferredData | The contents of the last response from the server. |
TransferredDataLimit | The maximum number of incoming bytes to be stored by the component. |
TransferredHeaders | The full set of headers as received from the server. |
UseChunkedEncoding | Enables or Disables HTTP chunked encoding for transfers. |
ChunkSize | Specifies the chunk size in bytes when using chunked encoding. |
UsePlatformHTTPClient | Whether or not to use the platform HTTP client. |
UserAgent | Information about the user agent (browser). |
KerberosSPN | The Service Principal Name for the Kerberos Domain Controller. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallListener | If true, the component binds to a SOCKS firewall as a server (IPPort only). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
ProxyExceptionsList | A semicolon separated list of hosts and IPs to bypass when using a proxy. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
UseIPv6 | Whether to use IPv6. |
UseNTLMv2 | Whether to use NTLM V2. |
CloseStreamAfterTransfer | If true, the component will close the upload or download stream after the transfer. |
TcpNoDelay | Whether or not to delay when sending packets. |
LogSSLPackets | Controls whether SSL packets are logged when using the internal security API. |
ReuseSSLSession | Determines if the SSL session is reused. |
SSLCipherStrength | The minimum cipher strength used for bulk encryption. |
SSLEnabledProtocols | Used to enable/disable the supported security protocols. |
SSLIncludeCertChain | Whether the entire certificate chain is included in the SSLServerAuthentication event. |
SSLProvider | The name of the security provider to use. |
SSLSecurityFlags | Flags that control certificate verification. |
SSLCACerts | A newline separated list of CA certificate to use during SSL client authentication. |
SSLContextProtocol | The protocol used when getting an SSLContext instance. |
SSLTrustManagerFactoryAlgorithm | The algorithm to be used to create a TrustManager through TrustManagerFactory. |
SSLEnabledCipherSuites | The cipher suite to be used in an SSL negotiation. |
TLS12SignatureAlgorithms | Defines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True. |
TLS12SupportedGroups | The supported groups for ECC. |
TLS13KeyShareGroups | The groups for which to pregenerate key shares. |
TLS13SupportedGroups | The supported groups for (EC)DHE key exchange. |
TLS13SignatureAlgorithms | The allowed certificate signature algorithms. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
GUIAvailable | Tells the component whether or not a message loop is available for processing events. |
UseDaemonThreads | Whether threads created by the component are daemon threads. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |