The Net Tools Company - 800.225.4190
Search: 
Available in: EDI | EDI/AS2
AS2Receiver Component [IP*Works! EDI V8]

Properties   Methods   Events   Configuration Settings  

The AS2Receiver component is used to process EDI messages and generate receipts.

NOTE: What follows is a very short description of the component interfaces. For more information, please consult the help files that come with the respective package.

Remarks

The AS2Receiver implements server-side processing of EDI messages, as specified in [AS2] and RFC 3335. It can be used to decrypt and verify incoming messages and to generate receipts including Message Disposition Notifications (MDNs). The component is designed to be easily incorporated into an HTTP server, and features custom functionality for server environments such as ASP.NET.

BASIC OPERATION

When an AS2 request comes in, you should first invoke ReadRequest. This will populate AS2From and AS2To, and based on this information, you may then 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 [AS2] and 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 by invoking SendResponse. The receipt will be returned either synchronously in the HTTP reply, or asynchronously over a separate HTTP, HTTPS, or SMTP connection, as requested by the client.

To create log files, set LogDirectory prior to invoking ProcessRequest. This will log all incoming and outgoing data.

The following example illustrates how to use the component from an ASP.NET page. Note that in Java it will be necessary to provide an HTTPServletRequest as an argument to ReadRequest before processing the request.

EXAMPLE

AS2Receiver1.ReadRequest();
// At this point, you should check the values of AS2From and AS2To.
AS2Receiver1.Certificate = new Certificate(CertStoreTypes.cstPFXFile, "c:\\my_server_directory\\my_pfx_file.pfx", "my password", "CN=Me");
AS2Receiver1.SignerCert = new Certificate("c:\\my_server_directory\\my_partner_cer_file.cer");
AS2Receiver1.LogDirectory = "c:\\my_server_directory\\my_log_directory";
AS2Receiver1.ProcessRequest();
AS2Receiver1.SendResponse();
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.

ADVANCED FUNCTIONALITY

Advanced functionality is provided to allow the user to break down the AS2 process, and to allow finer control over the operation of the server. Where ProcessRequest automates the entire process, additional methods are also provided to handle each step separately.

Parsing Incoming Data

To process an EDI message, invoke ReadRequest to process the headers from the server, or alternatively, manually set Request to the contents of the HTTP request. It may contain both headers and body, or the headers may be specified separately in RequestHeaders. This will provide more information about the client's request, without attempting to read the underlying EDI data.

After invoking ReadRequest, the AS2From, AS2To, and MessageId properties will contain the appropriate values. MDNTo will contain a nonempty string if an MDN is requested; RequestedSigningProtocol, RequestedMICAlgorithms, and ReceiptDeliveryOption provide more information about the client's request. Finally, RequestHeaders contains the complete list of HTTP/AS2 headers.

Next, invoke ParseRequest. The certificate used to decrypt and sign should be specified with the Certificate property, and your partner's signing certificate should be specified with SignerCert. This will process the headers, decompress and/or decrypt the message (if applicable), and verify the signature (if present). EncryptionType, SignatureType, and CompressionFormat describe whether and how the data was encrypted, signed, and compressed, respectively.

ParseRequest will populate EDIType and EDIData.

Error Handling

If any errors occur an exception will be thrown and EDIData will not be populated. Information about the exception will be provided through the exception's error code and message and also through ScanResult. An MDN receipt reporting the error may still be generated; it is recommended that server software trap the error and invoke CreateMDNReceipt to report the error to the client.

The ErrorProcessingFlags property may be configured to allow predetermined types of errors. If ErrorProcessingFlags is set when ParseRequest (or ProcessRequest) is invoked, the errors specified will be allowed, an exception will not be thrown, and EDIData will still be determined. However, ScanResult will still report the error, as will the receipt generated by CreateMDNReceipt. To avoid reporting the errors in the receipt, set the ErrorReportingFlags property.

Creating an MDN-based Receipt

An MDN-based receipt may be created by invoking CreateMDNReceipt. Regardless of the success or failure of ProcessRequest, the receipt may be created as specified in RFCs 3335 and 2298. If no errors occurred when ProcessRequest was invoked, the receipt will report success and will be suitable for non-repudiation of receipt (NRR) if signed. If errors occurred, the MDN will report that an error occurred and that the EDI data was not processed. It is strongly recommended that server software trap any errors thrown by ProcessRequest and return the receipt in this case as well.

The MDNReceipt will consist of the MDN itself, a human-readable message, MIME headers and footers, and a signature if applicable. The receipt may be generated by invoking CreateMDNReceipt and customized further by setting the parameters to CreateMDNReceipt.

The Message parameter to CreateMDNReceipt may be used to customize the human-readable message in the receipt. If it is set to an empty string, an appropriate message will automatically be written whenever MDNReceipt is regenerated.

The receipt will be signed using the protocol specified by ReceiptSigningProtocol, if any. The certificate used to sign the receipt is specified by Certificate. By default the receipt will be signed if explicitly requested by the client, and unsigned otherwise.

Error reporting may be controlled by configuring ErrorReportingFlags. By default, any errors will cause MDNReceipt to report a failure to process the message (either "failed/Failure" or "processed/Error" will be reported, according to the specification and the type of error). Setting ErrorReportingFlags will cause the MDNReceipt to overlook the chosen types of errors. If all errors are overlooked, the MDNReceipt will report success and calculate a MIC on the original message as usual. A warning may be reported by setting the MDNWarning configuration setting.

Additional Server-Side Functionality

When used in a server environment such as ASP.NET, the component may be used to interface directly with the underlying HTTP context. If Request is not set by the user, ParseRequest and ProcessRequest will first get the request from the underlying HTTP environment, if possible. SendResponse will send the reply in this environment if able; otherwise the reply will be directed to standard out.

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.
AttachmentCountThe number of records in the Attachment arrays.
AttachmentContentTypeThe MIME content-type of this ediattachment.
AttachmentFileNameThe file name where the attachment data is stored.
AttachmentHeadersThe component fills out Headers each time any of the other properties for that ediattachment are changed.
CertEffectiveDateThe date which this certificate becomes valid.
CertEncodedThe certificate (PEM/base64 encoded).
CertExpirationDateThe date the certificate expires.
CertExtendedKeyUsageA comma-delimited list of extended key usage identifiers.
CertIssuerThe issuer of the certificate.
CertKeyPasswordThe password for the certificate's private key (if any).
CertPrivateKeyThe private key of the certificate (if available).
CertPrivateKeyAvailableShows whether a PrivateKey is available for the selected certificate.
CertPrivateKeyContainerThe name of the PrivateKey container for the certificate (if available).
CertPublicKeyThe public key of the certificate.
CertPublicKeyAlgorithmTextual description of the public key algorithm of the certificate.
CertPublicKeyLengthThe length of the certificate public key (in bits).
CertSerialNumberThe serial number of the certificate encoded as a string.
CertSignatureAlgorithmTextual description of the signature algorithm of the certificate.
CertStoreThe name of the certificate store for the client certificate.
CertStorePasswordIf 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.
CertStoreTypeThe type of certificate store for this certificate.
CertSubjectThe subject of the certificate used for client authentication.
CertSubjectAltNamesA comma-separted lists of alternative subject names of the certificate.
CertThumbprintMD5MD5 hash of the certificate.
CertThumbprintSHA1SHA1 hash of the certificate.
CertUsageTextual description of UsageFlags .
CertUsageFlagsFlags that show intended use for the certificate.
CertVersionThe certificate's version number.
CompressionFormatThe compression format used on the incoming message.
EDIDataThis property contains the EDI payload of the transmission.
EDIEDITypeThe Content-Type of the EDI message.
EDIFileNameIn a sender, if FileName is specified, the file specified will be used for the EDI payload of the transmission.
EDINameName is the final name to be associated with the contents of either the Data or FileName properties.
FirewallAutoDetectThis property tells the component whether or not to automatically detect and use firewall system settings, if available.
FirewallTypeThis property determines the type of firewall to connect through.
FirewallHostThis property contains the name or IP address of firewall (optional).
FirewallPasswordThis property contains a password if authentication is to be used when connecting through the firewall.
FirewallPortThis property contains the TCP port for the firewall Host .
FirewallUserThis property contains a user name if authentication is to be used connecting through a firewall.
IncomingDirThe directory to be used to store incoming messages.
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.
MDNContentThis contains the entire content of the MDN Receipt.
MDNHeadersReceiptHeaders contains the AS2 headers of the MDN Receipt.
MDNMDNMDN will contain the entire machine readable text of the Message Disposition Notification in the receipt.
MDNMessageThe human-readable portion of the MDN receipt.
MDNMICValueThe Message Integrity Check(s) (one-way hash) of the original EDI message.
MDNSigningProtocolThis property contains the MIME type of the signature used, if any (i.
MDNToThe recipient for the Message Disposition Notification (MDN).
MessageIdThe message ID of the incoming message.
ReceiptDeliveryOptionA URL indicating how the receipt is to be delivered.
RequestThe HTTP request to be processed.
RequestHeaderCountThe number of records in the RequestHeader arrays.
RequestHeaderFieldThis property contains the name of the HTTP header (same case as it is delivered).
RequestHeaderValueThis property contains the header contents.
RequestHeadersStringThe HTTP headers in the AS2 request.
ScanResultThe result of invoking ParseRequest.
SignerCertEffectiveDateThe date which this certificate becomes valid.
SignerCertEncodedThe certificate (PEM/base64 encoded).
SignerCertExpirationDateThe date the certificate expires.
SignerCertExtendedKeyUsageA comma-delimited list of extended key usage identifiers.
SignerCertIssuerThe issuer of the certificate.
SignerCertKeyPasswordThe password for the certificate's private key (if any).
SignerCertPrivateKeyThe private key of the certificate (if available).
SignerCertPrivateKeyAvailableShows whether a PrivateKey is available for the selected certificate.
SignerCertPrivateKeyContainerThe name of the PrivateKey container for the certificate (if available).
SignerCertPublicKeyThe public key of the certificate.
SignerCertPublicKeyAlgorithmTextual description of the public key algorithm of the certificate.
SignerCertPublicKeyLengthThe length of the certificate public key (in bits).
SignerCertSerialNumberThe serial number of the certificate encoded as a string.
SignerCertSignatureAlgorithmTextual description of the signature algorithm of the certificate.
SignerCertStoreThe name of the certificate store for the client certificate.
SignerCertStorePasswordIf 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.
SignerCertStoreTypeThe type of certificate store for this certificate.
SignerCertSubjectThe subject of the certificate used for client authentication.
SignerCertSubjectAltNamesA comma-separted lists of alternative subject names of the certificate.
SignerCertThumbprintMD5MD5 hash of the certificate.
SignerCertThumbprintSHA1SHA1 hash of the certificate.
SignerCertUsageTextual description of UsageFlags .
SignerCertUsageFlagsFlags that show intended use for the certificate.
SignerCertVersionThe certificate's version number.
SSLAcceptServerCertEffectiveDateThe date which this certificate becomes valid.
SSLAcceptServerCertEncodedThe certificate (PEM/base64 encoded).
SSLAcceptServerCertExpirationDateThe date the certificate expires.
SSLAcceptServerCertExtendedKeyUsageA comma-delimited list of extended key usage identifiers.
SSLAcceptServerCertIssuerThe issuer of the certificate.
SSLAcceptServerCertKeyPasswordThe password for the certificate's private key (if any).
SSLAcceptServerCertPrivateKeyThe private key of the certificate (if available).
SSLAcceptServerCertPrivateKeyAvailableShows whether a PrivateKey is available for the selected certificate.
SSLAcceptServerCertPrivateKeyContainerThe name of the PrivateKey container for the certificate (if available).
SSLAcceptServerCertPublicKeyThe public key of the certificate.
SSLAcceptServerCertPublicKeyAlgorithmTextual description of the public key algorithm of the certificate.
SSLAcceptServerCertPublicKeyLengthThe length of the certificate public key (in bits).
SSLAcceptServerCertSerialNumberThe serial number of the certificate encoded as a string.
SSLAcceptServerCertSignatureAlgorithmTextual description of the signature algorithm of the certificate.
SSLAcceptServerCertStoreThe name of the certificate store for the client certificate.
SSLAcceptServerCertStorePasswordIf 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.
SSLAcceptServerCertStoreTypeThe type of certificate store for this certificate.
SSLAcceptServerCertSubjectThe subject of the certificate used for client authentication.
SSLAcceptServerCertSubjectAltNamesA comma-separted lists of alternative subject names of the certificate.
SSLAcceptServerCertThumbprintMD5MD5 hash of the certificate.
SSLAcceptServerCertThumbprintSHA1SHA1 hash of the certificate.
SSLAcceptServerCertUsageTextual description of UsageFlags .
SSLAcceptServerCertUsageFlagsFlags that show intended use for the certificate.
SSLAcceptServerCertVersionThe certificate's version number.
SSLCertEffectiveDateThe date which this certificate becomes valid.
SSLCertEncodedThe certificate (PEM/base64 encoded).
SSLCertExpirationDateThe date the certificate expires.
SSLCertExtendedKeyUsageA comma-delimited list of extended key usage identifiers.
SSLCertIssuerThe issuer of the certificate.
SSLCertKeyPasswordThe password for the certificate's private key (if any).
SSLCertPrivateKeyThe private key of the certificate (if available).
SSLCertPrivateKeyAvailableShows whether a PrivateKey is available for the selected certificate.
SSLCertPrivateKeyContainerThe name of the PrivateKey container for the certificate (if available).
SSLCertPublicKeyThe public key of the certificate.
SSLCertPublicKeyAlgorithmTextual description of the public key algorithm of the certificate.
SSLCertPublicKeyLengthThe length of the certificate public key (in bits).
SSLCertSerialNumberThe serial number of the certificate encoded as a string.
SSLCertSignatureAlgorithmTextual description of the signature algorithm of the certificate.
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.
SSLCertSubjectAltNamesA comma-separted lists of alternative subject names of the certificate.
SSLCertThumbprintMD5MD5 hash of the certificate.
SSLCertThumbprintSHA1SHA1 hash of the certificate.
SSLCertUsageTextual description of UsageFlags .
SSLCertUsageFlagsFlags that show intended use for the certificate.
SSLCertVersionThe certificate's version number.

Method List


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

AckRequestOptional. Acknowledges the incoming request.
ConfigSets or retrieves a configuration setting.
CreateMDNReceiptCreates MDNReceipt.
ParseRequestParses the EDI message and determines the EDIData.
ProcessRequestProcesses the EDI data, and generates the receipt.
ReadRequestReads the AS2 request from the HTTP session.
SendAsyncMDNSends the MDNReceipt to the URL specified.
SendResponseIn a server environment, responds to the requesting client with MDNReceipt.
SetTPInfoA convenient way to set AS2 communication parameters using XML strings.

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.

ErrorInformation about errors during data delivery.
SSLServerAuthenticationFor asynchronous HTTPS MDNs, fired after the server presents its certificate.
SSLStatusShows the progress of the secure connection.

Configuration Settings


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

AcceptAnySignerCertUsed to accept trust any signing certificate unconditionally.
AcceptAnyServerCertUsed to accept trust any SSL certificate unconditionally.
AS2VersionIncomingThe version of AS2 that was used in the incoming message.
AS2VersionOutgoingThe version of AS2 to be used in the outgoing message.
AssumeEncryptedForces the decryption of the incoming document.
AssumeSignedForces the verification of the incoming document.
AsyncMDNClientAuthWhen performing asynchronous MDN delivery, whether or not to perfor client authentication to the server specified in the asynchronous MDN URL.
UserThe username to use for HTTP client authentication.
PasswordThe password to use for HTTP client authentication.
AuthSchemeThe authorization scheme to use for HTTP client authentication.
DecodeToTempDirA temporary directory to write incoming requests to before they are processed.
DecodeQuotedPrintableWhether or not to perform Quoted-Printable decoding of the EDI payload.
EncryptionAlgorithmThe encryption algorithm used to encrypt the incoming data.
EncryptionTypeThe MIME type of the encrypted data.
ErrorProcessingFlagsFlags controlling how errors affect ProcessRequest.
ErrorReportingFlagsFlags controlling how errors affect the MDNReceipt.
LogOptionsThe information to be written to log files.
MDNMessageIDThe MessageID used in the returned MDN.
MDNMICAlgorithmThe algorithm used to sign the outgoing MDN.
MDNReportingUAThe name of the user agent performing the disposition.
MDNSendingModeThe level of end user interaction involved in sending the MDN.
MDNWarningA warning to appear in the MDN.
ProcessingErrorA processing error occurred in the received EDI message.
ProcessMIMEHeadersWhether or not to process MIME headers in the EDI payload.
ProxyAuthorizationThe authorization string to be sent to the proxy server.
ProxyPasswordA password if Basic 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 Basic authentication is to be used for the proxy.
ReceiptSigningProtocolThe protocol used to sign the outgoing MDN receipt.
RequestedMICAlgorithmsThe Message Integrity Check algorithm(s) requested by the client, if any.
RequestedSigningProtocolThe signing protocol requested by the client, if any.
RequireAS2ToEnsure that the received message is intended for the given AS2 identifier.
RequireEncryptEnsure that the received message is encrypted.
RequireSignEnsure that the received message is signed.
SenderSigningAlgorithmThe algorithm used by the sender to sign the message.
SignatureTypeThe MIME type of the signature (if any).
SMTPFromThe email address of the sender of the message.
SMTPServerThe SMTP server to be used.
SMTPSubjectThe mail subject to be used.
UseCryptoAPIWhether to use the Microsoft Crypto API for cryptographic message generation.
HTTPAuthSchemeThe authorization scheme to be used when server authorization is to be performed.
HTTPUserA user name if authentication is to be used.
HTTPPasswordA password if authentication is to be used.
CodePageThe system code page used for Unicode to Multibyte translations.
| About | Privacy Policy | Terms of Use |
© Copyright 2012 /n software inc.