IPWorks EDI 2020 Python Edition

Questions / Feedback?

OFTPClient Class

Properties   Methods   Events   Configuration Settings   Errors  

The OFTPClient class implements the Odette File Transfer Protocol.

Syntax

class ipworksedi.OFTPClient

Remarks

The OFTPClient component may be used to send and receive OFTP files to and from an OFTP server.

Receiving Files

The OFTPClient receive_files function requires certain server properties be set. You must set the remote_host property to the remote location of the desired OFTP server. You may also set a remote_port if the server is not set to the default protocol port. For client authorization, you must set the client_ssid_code, client_sfid_code, and client_password properties. And, for server authentication, you must set the server_ssid_code, server_sfid_code, and server_password properties.

The class will connect to the OFTP server and download all files in the server's outgoing queue, and write these files to the directory specified by download_directory. The class creates a default location on the local machine based on the values of the download_directory and the Virtual Filename as received from the server. If a different location is preferred, you may set the LocalFile parameter of the on_start_transfer event.

Sending Files

The OFTPClient send_file function requires the same server and authentication properties to be set as the receive_files function.

The class will connect to the OFTP server and upload the file contained by the LocalFile parameter. It uses the name specified by VirtualFileName when sending to the server. If this is not specified, the filename of the local file is parsed and used as the virtual filename.

Property List


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

cert_encodedThe certificate (PEM/base64 encoded).
cert_storeThe name of the certificate store for the client certificate.
cert_store_passwordIf 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.
cert_store_typeThe type of certificate store for this certificate.
cert_subjectThe subject of the certificate used for client authentication.
client_passwordThe client's password.
client_sfid_codeClient's SFID code.
client_ssid_codeThe client's SSID code.
compressWhether or not to compress the outgoing file.
connectedShows whether the class is connected.
download_directoryDownload directory.
encryption_algorithmThe encryption algorithm.
firewall_auto_detectThis property tells the class whether or not to automatically detect and use firewall system settings, if available.
firewall_typeThis property determines the type of firewall to connect through.
firewall_hostThis property contains the name or IP address of firewall (optional).
firewall_passwordThis property contains a password if authentication is to be used when connecting through the firewall.
firewall_portThis property contains the TCP port for the firewall Host .
firewall_userThis property contains a user name if authentication is to be used connecting through a firewall.
local_hostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
max_record_sizeThe maximum length of a given record.
overwriteWhether or not the class should overwrite files during transfer.
recipient_cert_encodedThe certificate (PEM/base64 encoded).
recipient_cert_storeThe name of the certificate store for the client certificate.
recipient_cert_store_passwordIf 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.
recipient_cert_store_typeThe type of certificate store for this certificate.
recipient_cert_subjectThe subject of the certificate used for client authentication.
remote_hostThe domain name or IP address of the OFTP server.
remote_portThe port for the OFTP service (default is 3305).
secure_authenticationWhether or not the class should perform secure Odette authentication.
server_passwordThe server's password.
server_sfid_codeServer's SFID code.
server_ssid_codeThe server's SSID code.
signed_receiptWhether or not to require signed receipts.
ssl_accept_server_cert_encodedThe certificate (PEM/base64 encoded).
ssl_cert_encodedThe certificate (PEM/base64 encoded).
ssl_cert_storeThe name of the certificate store for the client certificate.
ssl_cert_store_passwordIf 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.
ssl_cert_store_typeThe type of certificate store for this certificate.
ssl_cert_subjectThe subject of the certificate used for client authentication.
timeoutA timeout for the class.
trusted_cert_countThe number of records in the TrustedCert arrays.
trusted_cert_encodedThe certificate (PEM/base64 encoded).
trusted_cert_storeThe name of the certificate store for the client certificate.
trusted_cert_store_passwordIf 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.
trusted_cert_store_typeThe type of certificate store for this certificate.
trusted_cert_subjectThe subject of the certificate used for client authentication.
use_sslUse SSL to access the RemoteHost .
versionWhich version of the OFTP protocol the class is using.
virtual_file_dateThe date/time stamp for the virtual file.
virtual_file_formatThe structure of the outgoing file.
virtual_file_security_levelThe level of security for the file.

Method List


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

change_directionSends a Change Direction (CD) command.
configSets or retrieves a configuration setting.
do_eventsProcesses events from the internal message queue.
exchange_certificateExchange a certificate with the remote host.
import_trusted_certsImports a list of trusted CA certificates.
interruptInterrupts the current action.
logoffLogoff from the OFTP server.
logonLogon to the OFTP RemoteHost using the current client credentials.
receive_filesReceive any files queued to be sent from the server.
resetResets the state of the control.
send_end_responseSends an EERP/NERP asynchronously.
send_fileSend the specified file to the server.

Event List


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

on_accept_fileFired when the client receives a file.
on_certificate_receivedFired when a certificate is received from the remote host.
on_end_responseFired every time an end response is received from the server.
on_end_transferFired when a file finishes transferring.
on_errorInformation about errors during data delivery.
on_pi_trailFired when any protocol level communication occurs.
on_ssl_server_authenticationFired after the server presents its certificate to the client.
on_ssl_statusShows the progress of the secure connection.
on_start_transferFired when a document starts transferring.
on_transferFired while a document transfers (delivers document).

Configuration Settings


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

AcceptAnySFIDCodeIndicates that all SFID codes are acceptable.
AllowRetryWhether to send a retry indicator when rejecting a file.
CertificateTypeSpecifies the type of certificate being supplied.
ConnectionTypeSpecifies the type of connection that will be created.
CreditCountSpecifies the credit value.
DeleteOnErrorWhether received files are deleted when there is an error during processing.
DisconnectAfterEndSessionDetermines if the connection is closed immediately after ending the session.
EnforceProtocolVersionRequires the server to support the same OFTP version.
ExchangeBufferSizeSpecifies the data exchange buffer size in bytes.
ExchangeCertStoreTypeSpecifies the store type when loading a certificate to be exchanged.
ExchangeCertSubjectThe subject of the certificate being exchanged.
FailOnUntrustedCertWhether or not to throw an exception when untrusted certificates are used.
FileDescriptionAdditional description information sent with the file.
FileHashAlgorithmThe hash algorithm to use when sending a file.
FireEndResponseOnSendDetermines if the EndResponse event is fired for outgoing EERP and NERPs.
FollowRedirectsDetermines behavior when importing trusted certificates and a HTTP redirect is returned.
FriendlyLogFormatDetermines if a more friendly format is applied to PITrail event out.
MaskSensitiveMasks passwords in logs.
ReceiptHashAlgorithmThe receipt hash algorithm to request when sending a file.
ReceivedFileDateTimeThe datetime of the file being received.
ReceivedFileDescriptionAdditional description information received with the file.
ReceivedFileEncryptionAlgThe encryption algorithm used for the file being received.
ReceivedFileNameReturns the name of the received file.
ReceivedFileNameFormatThe name format of received files.
ReceivedFileNameFormatThe name format of received files.
RecipientCertificateTypeSpecifies the type of recipient certificate being supplied.
RetryIndicates whether the recipient allows the send to be retried.
SendCDAfterEFPASpecifies whether a CD is always sent after receiving an EFPA.
TempPathThe path of a directory where temporary files will be created.
TrustedCertsDataSpecifies the source to be used when importing trusted certificates.
VirtualFileDateFormatThe DateTime format of received files.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class 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 Python Edition - Version 20.0 [Build 8203]