IPWorks EDI 2020 Delphi Edition

Questions / Feedback?

AS2Sender Component

Properties   Methods   Events   Configuration Settings   Errors  

The AS2Sender component implements an AS2 / EDI-INT client.

Syntax

TibeAS2Sender

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 component 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 component will request a signed MDN over an SHA1 hash.

The component supports both synchronous and asynchronous MDN receipt delivery. By default, the component 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 component. 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 component 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 component 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 component with short descriptions. Click on the links for further details.

AS2FromThe AS2 Identifier of the sending system.
AS2ToThe AS2 Identifier of the receiving system.
AS2VersionThe version of AS2 being used.
AsyncMDNInfoDirPath to a directory to store data used in verifying AsyncMDNs.
AttachmentsCollection of files attached to the current message.
CEMDetailsA collection of Certificate Exchange Messaging (CEM) details.
CompressionFormatThe compression format (if any) to use.
CookiesCollection of cookies.
EDIDataThe EDI or other data to be sent.
EncryptionAlgorithmThe algorithm used to encrypt the EDI data.
EtagThe Etag of the file being sent.
FirewallA set of properties related to firewall access.
FromThe email address of the HTTP agent (optional).
LocalHostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
LogDirectoryThe path to a directory for logging.
LogFileThe log file written.
MDNDeliveryOptionA URL indicating how the receipt is to be delivered.
MDNOptionsUsed to indicate the options requested for the MDN receipt.
MDNReceiptThe MDN receipt returned from the server.
MDNToUsed to indicate that a message disposition notification is requested.
MessageIdThe Id of the message.
OriginalContentMICThe Message Integrity Check(s) (one-way hash) of the outgoing message.
ProxyA set of properties related to proxy access.
ReceiptSignerCertEncodedThe certificate (PEM/base64 encoded).
ReceiptSignerCertStoreThe name of the certificate store for the client certificate.
ReceiptSignerCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
ReceiptSignerCertStoreTypeThe type of certificate store for this certificate.
ReceiptSignerCertSubjectThe subject of the certificate used for client authentication.
RecipientCertCountThe number of records in the RecipientCert arrays.
RecipientCertEncodedThe certificate (PEM/base64 encoded).
RecipientCertStoreThe name of the certificate store for the client certificate.
RecipientCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
RecipientCertStoreTypeThe type of certificate store for this certificate.
RecipientCertSubjectThe subject of the certificate used for client authentication.
RestartDirectoryThe directory to log cached files when using AS2 restart functionality.
RolloverSigningCertEncodedThe certificate (PEM/base64 encoded).
RolloverSigningCertStoreThe name of the certificate store for the client certificate.
RolloverSigningCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
RolloverSigningCertStoreTypeThe type of certificate store for this certificate.
RolloverSigningCertSubjectThe subject of the certificate used for client authentication.
SignatureAlgorithmSignature algorithm to be used in outgoing messages.
SigningCertEncodedThe certificate (PEM/base64 encoded).
SigningCertStoreThe name of the certificate store for the client certificate.
SigningCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
SigningCertStoreTypeThe type of certificate store for this certificate.
SigningCertSubjectThe subject of the certificate used for client authentication.
SSLAcceptServerCertEncodedThe certificate (PEM/base64 encoded).
SSLCertEncodedThe certificate (PEM/base64 encoded).
SSLCertStoreThe name of the certificate store for the client certificate.
SSLCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
SSLCertStoreTypeThe type of certificate store for this certificate.
SSLCertSubjectThe subject of the certificate used for client authentication.
SSLServerCertEncodedThe certificate (PEM/base64 encoded).
SubjectThe subject of the message.
TimeoutA timeout for the component.
URLThe URL to which the request is made.
UseOAEPWhether to use Optimal Asymmetric Encryption Padding (OAEP).
UsePSSWhether to use RSA-PSS during signing and verification.
UserAgentInformation about the user agent.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
DoEventsProcesses events from the internal message queue.
InterruptInterrupt the current method.
PostPost data to the AS2 server, and check the receipt.
ReadAsyncReceiptReads an asynchronous MDN receipt from the current HTTP session.
ResetResets the state of the control.
RestartRestart sending of the file specified by the Etag property.
SendCEMRequestSends a Certificate Exchange Messaging (CEM) request.
SendCEMResponseSends a Certificate Exchange Messaging (CEM) response.
SetRequestHeaderAllows the user to set or add arbitrary HTTP request headers.
SetTPInfoA convenient way to set AS2 communication parameters using XML strings.
VerifyReceiptVerifies an asynchronous MDN receipt.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ConnectedFired immediately after a connection completes (or fails).
DisconnectedFired when a connection is closed.
EndTransferFired when a document finishes transferring.
ErrorInformation about errors during data delivery.
HeaderFired every time a header line comes in.
LogFired with log information while processing a message.
SetCookieFired for every cookie set by the server.
SSLServerAuthenticationFired after the server presents its certificate to the client.
SSLStatusShows the progress of the secure connection.
StartTransferFired when a document starts transferring (after the headers).
TransferFired while a document transfers (delivers document).

Configuration Settings


The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.

AllowMDNWarningsWhether to fail on MDN warnings.
AuthorizationThe Authorization string to be sent to the server.
AuthSchemeThe authorization scheme to be used when server authorization is to be performed.
EncodeToTempDirWhether to use temporary files when creating messages.
IncludeHeadersWhether headers are included when posting to a file.
LogDebugWhether to log debug data.
LogFilenameThe base name of the log file.
LogOptionsThe information to be written to log files.
MDNDispositionReturns the Disposition header of the MDN.
MessageHeadersReturns the headers of the message.
NormalizeMICWhether to normalize line endings before calculating the MIC.
OAEPMGF1HashAlgorithmThe MGF1 hash algorithm used when encrypting a key.
OAEPParamsThe hex encoded OAEP parameters to be used when encrypting a key.
OAEPRSAHashAlgorithmThe RSA hash algorithm used when encrypting a key.
PasswordA password if authentication is to be used.
PostToFileCreates the message on disk.
RequiredSignatureAlgorithmsSpecifies a list of acceptable signature algorithms.
UserA user name if authentication is to be used.
AcceptEncodingUsed to tell the server which types of content encodings the client supports.
AllowHTTPCompressionThis property enables HTTP compression for receiving data.
AllowHTTPFallbackWhether HTTP/2 connections are permitted to fallback to HTTP/1.1.
AppendWhether to append data to LocalFile.
AuthorizationThe Authorization string to be sent to the server.
BytesTransferredContains the number of bytes transferred in the response data.
ChunkSizeSpecifies the chunk size in bytes when using chunked encoding.
CompressHTTPRequestSet to true to compress the body of a PUT or POST request.
EncodeURLIf set to true the URL will be encoded by the component.
FollowRedirectsDetermines what happens when the server issues a redirect.
GetOn302RedirectIf set to true the component will perform a GET on the new location.
HTTP2HeadersWithoutIndexingHTTP2 headers that should not update the dynamic header table with incremental indexing.
HTTPVersionThe version of HTTP used by the component.
IfModifiedSinceA date determining the maximum age of the desired document.
KeepAliveDetermines whether the HTTP connection is closed after completion of the request.
KerberosSPNThe Service Principal Name for the Kerberos Domain Controller.
LogLevelThe level of detail that is logged.
MaxRedirectAttemptsLimits the number of redirects that are followed in a request.
NegotiatedHTTPVersionThe negotiated HTTP version.
OtherHeadersOther headers as determined by the user (optional).
ProxyAuthorizationThe authorization string to be sent to the proxy server.
ProxyAuthSchemeThe authorization scheme to be used for the proxy.
ProxyPasswordA password if authentication is to be used for the proxy.
ProxyPortPort for the proxy server (default 80).
ProxyServerName or IP address of a proxy server (optional).
ProxyUserA user name if authentication is to be used for the proxy.
SentHeadersThe full set of headers as sent by the client.
StatusLineThe first line of the last response from the server.
TransferredDataThe contents of the last response from the server.
TransferredDataLimitThe maximum number of incoming bytes to be stored by the component.
TransferredHeadersThe full set of headers as received from the server.
TransferredRequestThe full request as sent by the client.
UseChunkedEncodingEnables or Disables HTTP chunked encoding for transfers.
UseIDNsWhether to encode hostnames to internationalized domain names.
UserAgentInformation about the user agent (browser).
CloseStreamAfterTransferIf true, the component will close the upload or download stream after the transfer.
ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the component whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the component binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
ProxyExceptionsListA semicolon separated list of hosts and IPs to bypass when using a proxy.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
TcpNoDelayWhether or not to delay when sending packets.
UseIPv6Whether to use IPv6.
LogSSLPacketsControls whether SSL packets are logged when using the internal security API.
OpenSSLCADirThe path to a directory containing CA certificates.
OpenSSLCAFileName of the file containing the list of CA's trusted by your application.
OpenSSLCipherListA string that controls the ciphers to be used by SSL.
OpenSSLPrngSeedDataThe data to seed the pseudo random number generator (PRNG).
ReuseSSLSessionDetermines if the SSL session is reused.
SSLCACertsA newline separated list of CA certificate to use during SSL client authentication.
SSLCheckCRLWhether to check the Certificate Revocation List for the server certificate.
SSLCipherStrengthThe minimum cipher strength used for bulk encryption.
SSLEnabledCipherSuitesThe cipher suite to be used in an SSL negotiation.
SSLEnabledProtocolsUsed to enable/disable the supported security protocols.
SSLEnableRenegotiationWhether the renegotiation_info SSL extension is supported.
SSLIncludeCertChainWhether the entire certificate chain is included in the SSLServerAuthentication event.
SSLNegotiatedCipherReturns the negotiated ciphersuite.
SSLNegotiatedCipherStrengthReturns the negotiated ciphersuite strength.
SSLNegotiatedCipherSuiteReturns the negotiated ciphersuite.
SSLNegotiatedKeyExchangeReturns the negotiated key exchange algorithm.
SSLNegotiatedKeyExchangeStrengthReturns the negotiated key exchange algorithm strength.
SSLNegotiatedVersionReturns the negotiated protocol version.
SSLProviderThe name of the security provider to use.
SSLSecurityFlagsFlags that control certificate verification.
SSLServerCACertsA newline separated list of CA certificate to use during SSL server certificate validation.
TLS12SignatureAlgorithmsDefines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True.
TLS12SupportedGroupsThe supported groups for ECC.
TLS13KeyShareGroupsThe groups for which to pregenerate key shares.
TLS13SignatureAlgorithmsThe allowed certificate signature algorithms.
TLS13SupportedGroupsThe supported groups for (EC)DHE key exchange.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Delphi Edition - Version 20.0 [Build 8203]