|
SAP NetWeaver RFC SDK 7.50
|
Some utility functions for initializing, tracing, version info, etc. More...
Functions | |
| DECL_EXP RFC_RC SAP_API | RfcInit (void) |
| Initialization of internal variablesObsolete. More... | |
| DECL_EXP RFC_RC SAP_API | RfcCleanup (void) |
| Freeing of internal variablesObsolete. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetVersion (unsigned *majorVersion, unsigned *minorVersion, unsigned *patchLevel) |
| Get information about currently loaded sapnwrfc library. More... | |
| DECL_EXP RFC_RC SAP_API | RfcGetVersionInternal (void) |
| This function is intended to be used by SAP Make-factory only. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetIniPath (const SAP_UC *pathName, RFC_ERROR_INFO *errorInfo) |
| Sets the directory in which to search for the sapnwrfc.ini file. More... | |
| DECL_EXP RFC_RC SAP_API | RfcReloadIniFile (RFC_ERROR_INFO *errorInfo) |
| Reloads the contents of the sapnwrfc.ini file into memory. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetTraceLevel (RFC_CONNECTION_HANDLE connection, SAP_UC *destination, unsigned traceLevel, RFC_ERROR_INFO *errorInfo) |
| Sets the current trace level of the specified RFC connection or destination to the new value. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetTraceEncoding (SAP_UC *traceEncoding, RFC_ERROR_INFO *errorInfo) |
| Changes the character encoding to be used in trace files. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetTraceDir (SAP_UC *traceDir, RFC_ERROR_INFO *errorInfo) |
| Changes the directory where the NW RFC lib should write trace files. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetTraceType (SAP_UC *traceType, RFC_ERROR_INFO *errorInfo) |
| Changes the way the NW RFC lib writes trace files. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetCpicTraceLevel (unsigned traceLevel, RFC_ERROR_INFO *errorInfo) |
| Sets the global CPIC trace level used by the underlying CPIC libabry to write CPIC tracing information to the CPIC trace file cpic_<pid>.trc, where pid is the process ID of the current process. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetSocketTraceLevel (unsigned traceLevel, RFC_ERROR_INFO *errorInfo) |
| Sets the global Websocket trace level used by the underlying NI libabry to write tracing information to the trace file ws_rfc_<pid>.trc, where pid is the process ID of the current process. More... | |
| DECL_EXP RFC_RC SAP_API | RfcLoadCryptoLibrary (const SAP_UC *const pathToLibrary, RFC_ERROR_INFO *errorInfo) |
| Sets the absolute path to the sapcrypto library to enable TLS encryption via Websocket Rfc. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetWebsocketPingInterval (unsigned pingInterval, RFC_ERROR_INFO *errorInfo) |
| Sets the global idle time interval of a Websocket server connection in seconds after which a keep alive Websocket ping packet is sent. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetWebsocketPongTimeout (unsigned pongTimeout, RFC_ERROR_INFO *errorInfo) |
| Sets the global timeout for a WebSocket keep alive ping reply packet in seconds. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetMaximumTraceFileSize (unsigned size, SAP_UC unit, RFC_ERROR_INFO *errorInfo) |
| Sets the maximum size of the trace file, after which the current file is closed and "rolled over" to a new file. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetMaximumStoredTraceFiles (int numberOfFiles, RFC_ERROR_INFO *errorInfo) |
| Sets the maximum size of stored old trace files, after which the current file is closed and "rolled over" to a new file. More... | |
| DECL_EXP RFC_RC SAP_API | RfcUTF8ToSAPUC (const RFC_BYTE *utf8, unsigned utf8Length, SAP_UC *sapuc, unsigned *sapucSize, unsigned *resultLength, RFC_ERROR_INFO *errorInfo) |
| Converts data in UTF-8 format to SAP_UC strings. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSAPUCToUTF8 (const SAP_UC *sapuc, unsigned sapucLength, RFC_BYTE *utf8, unsigned *utf8Size, unsigned *resultLength, RFC_ERROR_INFO *errorInfo) |
| Converts data in SAP_UC format to UTF-8 format. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetRcAsString (RFC_RC rc) |
| Converts an RFC_RC return code to a human readable string for logging purposes. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetTypeAsString (RFCTYPE type) |
| Converts an RFCTYPE data type indicator to a human readable string for logging purposes. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetDirectionAsString (RFC_DIRECTION direction) |
| Converts an RFC_DIRECTION direction indicator to a human readable string for logging purposes. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetServerStateAsString (RFC_SERVER_STATE serverState) |
| Converts an RFC_SERVER_STATE state indicator to a human readable string for logging purposes. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetSessionEventAsString (RFC_SESSION_EVENT sessionEvent) |
| Converts an RFC_SESSION_EVENT to a human readable string for logging purposes. More... | |
| DECL_EXP RFC_RC SAP_API | RfcLanguageIsoToSap (const SAP_UC *laiso, SAP_UC *lang, RFC_ERROR_INFO *errorInfo) |
| Converts a 2-char SAP language code to the 1-char SAP language code. More... | |
| DECL_EXP RFC_RC SAP_API | RfcLanguageSapToIso (const SAP_UC *lang, SAP_UC *laiso, RFC_ERROR_INFO *errorInfo) |
| Converts a 1-char SAP language key to the 2-char SAP language code. More... | |
Some utility functions for initializing, tracing, version info, etc.
Freeing of internal variablesObsolete.
The RFC library does this automatically on DLL unload.
| DECL_EXP const SAP_UC* SAP_API RfcGetDirectionAsString | ( | RFC_DIRECTION | direction | ) |
Converts an RFC_DIRECTION direction indicator to a human readable string for logging purposes.
| [in] | direction | Direction indicator to convert |
Converts an RFC_RC return code to a human readable string for logging purposes.
| [in] | rc | Return code to covert to string |
| DECL_EXP const SAP_UC* SAP_API RfcGetServerStateAsString | ( | RFC_SERVER_STATE | serverState | ) |
Converts an RFC_SERVER_STATE state indicator to a human readable string for logging purposes.
| [in] | serverState | State indicator to convert |
| DECL_EXP const SAP_UC* SAP_API RfcGetSessionEventAsString | ( | RFC_SESSION_EVENT | sessionEvent | ) |
Converts an RFC_SESSION_EVENT to a human readable string for logging purposes.
| [in] | sessionEvent | Session event to convert |
Converts an RFCTYPE data type indicator to a human readable string for logging purposes.
| [in] | type | Data type indicator to convert |
| DECL_EXP const SAP_UC* SAP_API RfcGetVersion | ( | unsigned * | majorVersion, |
| unsigned * | minorVersion, | ||
| unsigned * | patchLevel | ||
| ) |
Get information about currently loaded sapnwrfc library.
Fills the provided unsigneds with the SAP release values, e.g. *majorVersion = 7500, *minorVersion = 0, *patchLevel = 44.
| [out] | *majorVersion | |
| [out] | *minorVersion | |
| [out] | *patchLevel |
This function is intended to be used by SAP Make-factory only.
Please DO NOT use it!
Initialization of internal variablesObsolete.
RfcInit() no longer needs to be called explicitly. The RFC library does this automatically on DLL load.
| DECL_EXP RFC_RC SAP_API RfcLanguageIsoToSap | ( | const SAP_UC * | laiso, |
| SAP_UC * | lang, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Converts a 2-char SAP language code to the 1-char SAP language code.
| [in] | *laiso | Pointer to the 2-char array with SAP LAISO code to convert |
| [out] | *lang | Pointer to the 1 char for SAP SPRAS key |
| [out] | *errorInfo | Will be filled with additional error information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcLanguageSapToIso | ( | const SAP_UC * | lang, |
| SAP_UC * | laiso, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Converts a 1-char SAP language key to the 2-char SAP language code.
| [in] | *lang | Pointer to the 1 char with SAP SPRAS key to convert |
| [out] | *laiso | Pointer to the 2-char array for SAP LAISO code |
| [out] | *errorInfo | Will be filled with additional error information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcLoadCryptoLibrary | ( | const SAP_UC *const | pathToLibrary, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the absolute path to the sapcrypto library to enable TLS encryption via Websocket Rfc.
The parameter pathToLibrary needs also to contain the name of the library. This function has the same effect as the sapnwrfc.ini parameter TLS_SAPCRYPTOLIB. This API cannot reset a new path to the library during runtime. Once set, the path is definitive.
| [in] | *pathToLibrary | Absolute path to library (.so or .dll). |
| [out] | *errorInfo | Detail information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcReloadIniFile | ( | RFC_ERROR_INFO * | errorInfo | ) |
Reloads the contents of the sapnwrfc.ini file into memory.
Searches the directory given by RfcSetIniPath() (or the current working directory) for the file sapnwrfc.ini and loads its contents into memory. Reloading the sapnwrfc.ini file is only necessary after the file has been manually edited If you want to use a sapnwrfc.ini file in a different location, consider using RfcSetIniPath().
Note: If a file with the name sapnwrfc.ini does not exist in the given directory, this is not considered an error! Default settings are used in this case.
| [out] | *errorInfo | Detail information in case anything goes wrong. |
| DECL_EXP RFC_RC SAP_API RfcSAPUCToUTF8 | ( | const SAP_UC * | sapuc, |
| unsigned | sapucLength, | ||
| RFC_BYTE * | utf8, | ||
| unsigned * | utf8Size, | ||
| unsigned * | resultLength, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Converts data in SAP_UC format to UTF-8 format.
| [in] | *sapuc | Pointer to SAP_UC data to be converted |
| [in] | sapucLength | Number of characters to convert |
| [out] | *utf8 | Pre-allocated output buffer, which will receive the result. Output will be null-terminated. |
| [in,out] | *utf8Size | Needs to be filled with the size of the given output buffer in bytes. If the given buffer turns out to be too small (return code RFC_BUFFER_TOO_SMALL), it will be filled with the required buffer size that would be necessary to convert the given input data. |
| [out] | *resultLength | If the output buffer was large enough, resultLength will be filled with the length of the output string in bytes. |
| [out] | *errorInfo | Will be filled with additional error information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcSetCpicTraceLevel | ( | unsigned | traceLevel, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the global CPIC trace level used by the underlying CPIC libabry to write CPIC tracing information to the CPIC trace file cpic_<pid>.trc, where pid is the process ID of the current process.
The CPIC trace file is located in the same directory where the RFC trace files are located.
This function has the same effect as the sapnwrfc.ini parameter CPIC_TRACE_LEVEL. See the documentation of that parameter in the sample ini file contained in the /demo directory of the NW RFC SDK.
| [in] | traceLevel | Must be a value between 0 to 3, where 0 turns tracing off. |
| [out] | *errorInfo | Detail information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcSetIniPath | ( | const SAP_UC * | pathName, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the directory in which to search for the sapnwrfc.ini file.
By default the sapnwrfc library searches for the sapnwrfc.ini in the current working directory of the process. If you want to keep it in a different directory, use this function to tell the sapnwrfc library about the new path.
| [in] | *pathName | The full (absolute) path of the directory, in which the sapnwrfc library should look for the sapnwrfc.ini file. A path relative to the current working directory of the process also works. |
| [out] | *errorInfo | Detail information in case anything goes wrong. |
| DECL_EXP RFC_RC SAP_API RfcSetMaximumStoredTraceFiles | ( | int | numberOfFiles, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the maximum size of stored old trace files, after which the current file is closed and "rolled over" to a new file.
This function has the same effect as the sapnwrfc.ini parameter RFC_TRACE_MAX_STORED_FILES. An additional "roll" to a new file after the maximum is reached, triggers a deletion of the oldest file. The old stored files are marked with the opening timestamp in the file name, when a "roll over" is done. By default two files are stored. The current trace file is not yet marked with the time stamp. However this function cannot set the size to zero, (it will result in an error,) or to a value lower than the one set by RFC_TRACE_MAX_STORED_FILES from the sapnwrfc.ini. By setting this value to -1, the limit is disabled and and an infinite amount of concurrent files can be kept, i.e. no files will be deleted by the NW RFC library.
| [in] | numberOfFiles | Maximum size of stored old trace |
| [out] | *errorInfo | Detail information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcSetMaximumTraceFileSize | ( | unsigned | size, |
| SAP_UC | unit, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the maximum size of the trace file, after which the current file is closed and "rolled over" to a new file.
This function has the same effect as the sapnwrfc.ini parameter RFC_TRACE_MAX_FILE_SIZE. By default two files of a maximum of 512 MB are stored. However this function cannot set the size below a minimum value of 20 MB or the value set by RFC_TRACE_MAX_FILE_SIZE from the sapnwrfc.ini. As unit of measure you can use "M" for Megabytes or "G" for Gigabytes, for example 1024 and M.
| [in] | size | Size in specified unit |
| [in] | unit | Unit of measurement |
| [out] | *errorInfo | Detail information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcSetSocketTraceLevel | ( | unsigned | traceLevel, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the global Websocket trace level used by the underlying NI libabry to write tracing information to the trace file ws_rfc_<pid>.trc, where pid is the process ID of the current process.
The NI trace file is located in the same directory where the RFC trace files are located.
This function has the same effect as the sapnwrfc.ini parameter RFC_SOCKET_TRACE. See the documentation of that parameter in the sample ini file contained in the /demo directory of the NW RFC SDK. Nevertheless this API cannot set a trace level below the global socket trace level set by environment variable or the ini file.
| [in] | traceLevel | Must be a value between 0 to 3, where 0 turns tracing off. |
| [out] | *errorInfo | Detail information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcSetTraceDir | ( | SAP_UC * | traceDir, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Changes the directory where the NW RFC lib should write trace files.
This function has the same effect as the sapnwrfc.ini parameter RFC_TRACE_DIR. See the documentation of that parameter in the sample ini file contained in the /demo directory of the NW RFC SDK.
| [in] | *traceDir | The new directory. Can be an absolute or relative path name. The directory needs to exist prior to calling this API. The NW RFC lib will not attempt to create non-existing directories. |
| [out] | *errorInfo | Detail information in case of an invalid traceEncoding input. |
| DECL_EXP RFC_RC SAP_API RfcSetTraceEncoding | ( | SAP_UC * | traceEncoding, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Changes the character encoding to be used in trace files.
This function has the same effect as the sapnwrfc.ini parameter RFC_TRACE_ENCODING. See the documentation of that parameter in the sample ini file contained in the /demo directory of the NW RFC SDK.
| [in] | *traceEncoding | The new encoding. Possible values are "UTF-16", "UTF-8" and "DEFAULT". On Windows UTF-16 is recommended for faster performance. "DEFAULT" corresponds to the operating system's default character encoding, which is CP1252 or ISO-8859-1 on most Windows systems and UTF-8 on most Linux systems. |
| [out] | *errorInfo | Detail information in case of an invalid traceEncoding input. |
| DECL_EXP RFC_RC SAP_API RfcSetTraceLevel | ( | RFC_CONNECTION_HANDLE | connection, |
| SAP_UC * | destination, | ||
| unsigned | traceLevel, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the current trace level of the specified RFC connection or destination to the new value.
| [in] | connection | A handle to a currently open RFC connection (client or server connection). The new trace level will be effective immediately. |
| [in] | *destination | Null-terminated string specifying a client or server destination as defined via a DEST=... entry in sapnwrfc.ini. The new trace level will be used for new connections to that destination opened after the RfcSetTraceLevel() call. Already existing connections to that destination will not be effected. |
| [in] | traceLevel | The new trace level. Must be between 0 and 4. The meaning of those four values is as follows:
|
| [out] | *errorInfo | Detail information in case the specified connection or destination does not exist. |
| DECL_EXP RFC_RC SAP_API RfcSetTraceType | ( | SAP_UC * | traceType, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Changes the way the NW RFC lib writes trace files.
This function has the same effect as the sapnwrfc.ini parameter RFC_TRACE_TYPE. See the documentation of that parameter in the sample ini file contained in the /demo directory of the NW RFC SDK.
| [in] | *traceType | Must be either "PROCESS" or "THREAD". |
| [out] | *errorInfo | Detail information in case of an invalid traceEncoding input. |
| DECL_EXP RFC_RC SAP_API RfcSetWebsocketPingInterval | ( | unsigned | pingInterval, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the global idle time interval of a Websocket server connection in seconds after which a keep alive Websocket ping packet is sent.
This function has the same effect as the sapnwrfc.ini parameter RFC_WEBSOCKET_PING_INTERVAL. The default value is 300; valid values are 0 [off] and a range from 10 [ten seconds] to 86400 [one day].
| [in] | pingInterval | Interval in seconds. |
| [out] | *errorInfo | Detail information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcSetWebsocketPongTimeout | ( | unsigned | pongTimeout, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the global timeout for a WebSocket keep alive ping reply packet in seconds.
This function has the same effect as the sapnwrfc.ini parameter RFC_WEBSOCKET_PONG_TIMEOUT. If no such so-called pong packet is received from the communication partner as a reply to a previously sent WebSocket keep alive ping packet within this timeout period, the connection is considered as broken and will be closed. The default value is 60; valid values are 0 [off] and a range from 10 [ten seconds] to 3600 [one hour]. The timeout value should be set lower than the ping interval of the server, so only one ping is active at a time.
| [in] | pongTimeout | Timeout in seconds. |
| [out] | *errorInfo | Detail information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcUTF8ToSAPUC | ( | const RFC_BYTE * | utf8, |
| unsigned | utf8Length, | ||
| SAP_UC * | sapuc, | ||
| unsigned * | sapucSize, | ||
| unsigned * | resultLength, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Converts data in UTF-8 format to SAP_UC strings.
| [in] | *utf8 | Pointer to UTF-8 data to be converted |
| [in] | utf8Length | Number of bytes to convert |
| [out] | *sapuc | Pre-allocated output buffer, which will receive the result. Output will be null-terminated. |
| [in,out] | *sapucSize | Needs to be filled with the size of the given output buffer in SAP_UC characters. If the given buffer turns out to be too small (return code RFC_BUFFER_TOO_SMALL), it will be filled with the required buffer size that would be necessary to convert the given input data. |
| [out] | *resultLength | If the output buffer was large enough, resultLength will be filled with the length of the output string in SAP_UC characters. |
| [out] | *errorInfo | Will be filled with additional error information in case of an error. |