AS1Receiver Component
Properties Methods Events Configuration Settings Errors
The AS1Receiver component is used to process AS1 messages and generate receipts.
Syntax
nsoftware.IPWorksEDI.As1receiver
Remarks
The AS1Receiver component allows you to receive AS1 messages as specified in RFC 3335. The component can act as an email client, decrypt and verify incoming messages, generate receipts including Message Disposition Notifications (MDNs), and send them over SMTP/S.
Basic Operation
You should first log in to your mail server by setting MailServer, User, and Password, and invoking Connect. You may then navigate your mail inbox by setting MailMessageNumber, and inspecting properties such as MailMessageFrom, etc. When you find the desired file you may download it by invoking ReadRequest. Alternatively, you may acquire the AS1 data by other means and directly set Request and RequestHeaders.
ReadRequest (or ParseHeaders) will determine information such as From and SendTo, which will allow you to set the appropriate certificates. You may specify your certificate with the Certificate property, and your trading partner's (signing) certificate with the SignerCert property.
Then, invoke ProcessRequest to process the request and generate the MDN receipt as specified in RFC 3335. If the request was processed successfully, EDIData will contain the transmitted EDI data. If a problem occurred, EDIData will not be populated and an exception will be thrown. In either case MDNReceipt will contain the RFC-compliant receipt, which should be returned to the client.
The MDNReceipt may be returned over SMTP/S by invoking SendResponse. In case the server address for incoming mail is different than that for outgoing mail you should use Config to configure this.
To create log files, set LogDirectory prior to invoking ProcessRequest. This will log all incoming and outgoing data, and will also write the received EDI files to disk.
Example
AS1Receiver1.User = "myusername" AS1Receiver1.Password = "mypassword" AS1Receiver1.MailServer = "1.2.3.4" AS1Receiver1.Connect() // You may need to search the server for received files at this point AS1Receiver1.MessageNumber = 1; // You may check properties such as MailMessageFrom, etc. AS1Receiver1.ReadRequest() AS1Receiver1.Certificate = new Certificate(CertStoreTypes.cstPFXFile, "\\my_server_directory\\my_pfx_file.pfx", "my password", "CN=Me"); AS1Receiver1.SignerCert = (base 64 encoded certificate); AS1Receiver1.LogDirectory = "c:\\my_server_directory\\my_log_directory"; AS1Receiver1.ProcessRequest(); AS1Receiver1.SendResponse(); AS1Receiver1.Disconnect();Additional functionality allows the user to examine details of the client's request, to permit certain types of errors, or to customize the outgoing MDN. See the property and method list for details.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
Attachments | Collection of files attached to the current message. |
Certificate | The decryption and receipt signing certificate. |
CompressionFormat | The compression format used on the incoming message. |
Connected | Shows whether the component is connected. |
EDIData | The EDI data sent in Request . |
Firewall | A set of properties related to firewall access. |
From | The sender of the original message. |
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. |
MailMessageCc | The value of the Cc header of the mail message. |
MailMessageCount | The number of messages waiting in the mailbox. |
MailMessageDate | The message date for the currently selected message. |
MailMessageFrom | The sender of the mail message. |
MailMessageHeaders | The message headers for the currently selected message. |
MailMessageNumber | The message number on the incoming mail server. |
MailMessageReplyTo | The value of the ReplyTo header of the mail message. |
MailMessageSize | The size of the mail message. |
MailMessageSubject | The subject of the mail message. |
MailMessageText | The text of the mail message. |
MailMessageTo | The recipient of the mail message. |
MailMessageUID | The unique id of the mail message. |
MailServer | The address of your mail server. |
MDNReceipt | The MDN-based receipt generated by the component. |
MDNTo | The recipient for the Message Disposition Notification (MDN). |
MessageId | The message ID of the incoming message. |
Password | The password for your incoming mail server. |
Request | The AS1 request to be processed. |
RequestHeaders | The headers in the AS1 request. |
RequestHeadersString | The headers in the AS1 request. |
ScanResult | The result of invoking ParseRequest . |
SendTo | The recipient of the original message. |
SignerCert | Your trading partner's certificate. |
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. |
SSLStartMode | Determines how the component starts the SSL negotiation. By default, SSL will not be used. |
User | The username for your incoming mail server. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
Connect | Connects to the incoming mail server. |
CreateMDNReceipt | Creates MDNReceipt . |
DeleteMessage | Deletes the message specified by MailMessageNumber . |
Disconnect | Disconnects from the incoming mail server. |
ParseRequest | Parses the EDI message and determines the EDIData . |
ProcessQueue | Send the messages queued for sending. |
ProcessRequest | Processes the EDI data, and generates the receipt. |
Queue | Prepares and queues the message to the specified directory. |
ReadRequest | Reads the AS1 request from the mail server. |
Reset | Resets the state of the control. |
SendResponse | Sends the 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.
ConnectionStatus | Fired to indicate changes in connection state. |
EndTransfer | Fired when the message text completes transferring. |
Error | Information about errors during data delivery. |
Header | Fired for every message header being retrieved. |
Log | Fired with log information while processing a message. |
PITrail | Traces the commands sent to the mail server, and the respective replies. |
SignerCertInfo | Fired during verification of the signed message. |
SSLServerAuthentication | Fired after the server presents its certificate to the client. |
SSLStatus | Shows the progress of the secure connection. |
StartTransfer | Fired when the message text starts transferring (on either a send or receive). |
Transfer | Fired while the message text gets transferred to or from MailServer . |
Configuration Settings
The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.
filename | The filename of the EDI Data. |
LogFilename | The base name of the log file. |
POPPort | The POP mail port to be used, if different than MailServer. |
POPServer | The POP server to be used, if different than MailServer. |
SMTPAuthMechanism | The authentication mechanism used to connect to the SMTP server. |
SMTPPassword | The password used for authentication. |
SMTPPort | The SMTP mail port to be used, if different than MailServer. |
SMTPServer | The SMTP server to be used, if different than MailServer. |
SMTPSSLStartMode | Determines how SSL negotiation starts with the SMTP server. |
SMTPUser | The user name used for authentication. |
CACertFilePaths | The paths to CA certificate files when using Mono on Unix/Linux. |
LogSSLPackets | Controls whether SSL packets are logged when using the internal security API. |
ReuseSSLSession | Determines if the SSL session is reused. |
SSLCACerts | A newline separated list of CA certificate to use during SSL client authentication. |
SSLCheckCRL | Whether to check the Certificate Revocation List for the server certificate. |
SSLCipherStrength | The minimum cipher strength used for bulk encryption. |
SSLEnabledCipherSuites | The cipher suite to be used in an SSL negotiation. |
SSLEnabledProtocols | Used to enable/disable the supported security protocols. |
SSLEnableRenegotiation | Whether the renegotiation_info SSL extension is supported. |
SSLIncludeCertChain | Whether the entire certificate chain is included in the SSLServerAuthentication event. |
SSLNegotiatedCipher | Returns the negotiated ciphersuite. |
SSLNegotiatedCipherStrength | Returns the negotiated ciphersuite strength. |
SSLNegotiatedCipherSuite | Returns the negotiated ciphersuite. |
SSLNegotiatedKeyExchange | Returns the negotiated key exchange algorithm. |
SSLNegotiatedKeyExchangeStrength | Returns the negotiated key exchange algorithm strength. |
SSLNegotiatedVersion | Returns the negotiated protocol version. |
SSLProvider | The name of the security provider to use. |
SSLSecurityFlags | Flags that control certificate verification. |
SSLServerCACerts | A newline separated list of CA certificate to use during SSL server certificate validation. |
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. |
TLS13SignatureAlgorithms | The allowed certificate signature algorithms. |
TLS13SupportedGroups | The supported groups for (EC)DHE key exchange. |
BuildInfo | Information about the product's build. |
GUIAvailable | Tells the component whether or not a message loop is available for processing events. |
LicenseInfo | Information about the current license. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |