Creates a detailed specification of the EDMInterface communication parameters for communication between an EDMclient and an EDMserver.
A defined server context is identified by its unique numeric server context id. A server context id is a mandatory input parameter to all edmiRemote API function calls. Any number of server contexts may be defined in an EDMclient session at the same time, thereby allowing simultaneous access to any number of remote EDMdatabase located anywhere in the world by TCP or HTTP communication.
Related functions: edmiDefineServerContextsFromFile, edmiDeleteAllServerContexts, edmiDeleteServerContext, edmiDeleteServerContextBN, edmiGetAllServerContexts, edmiGetServerContextId, edmiGetServerContextProperties, edmiResetServerContext, edmiWriteServerContextsToFile.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiDefineServerContext(SdaiString serverContextName,
SdaiString userName,
SdaiString groupName,
SdaiString password,
SdaiString communicationType,
SdaiString edmServerPortNumber,
SdaiString edmServerHostName,
SdaiString edmiTunnelName,
SdaiString edmiTunnelPortNumber,
SdaiString edmiTunnelHostName,
SdaiString proxyServerPortNumber,
SdaiString proxyServerName,
SdaiUnsignedInt *serverContextId);
Arguments:
serverContextName |
Optional name of the server context. Server context names must start with a character followed by any combination of alphanumeric characters and underscore. |
userName |
The name of the edmUser to connect to the EDMserver. The edmUser name is case insensitive and mandatory. |
groupName |
The name of the edmGroup to connect to the EDMserver. The edmGroup name is case insensitive and optional. |
password |
The password of the edmUser specified by <userName>. The password parameter is mandatory. |
communicationType |
The nature of the communication with an EDMserver. Valid communication types are; |
edmServerPortNumber |
The service port number used for remote communication with an EDMserver. Valid for <communicationType> "TCP" and "HTTP". |
edmServerHostName |
The name or IP-address of the machine hosting the EDMserver to communicate with. Valid for <communicationType> "TCP" and "HTTP". |
edmiTunnelName |
The name and full path of the HTTP Tunnel Servlet. Valid only for <communicationType> "HTTP". |
edmiTunnelPortNumber |
The tunnel service port number used by the machine hosting the HTTP Tunnel Servlet. Used by the HTTP tunnel for controling remote communication between an EDMserver and a thin EDMClient. Valid only for <communicationType> "HTTP". |
edmiTunnelHostName |
The name or IP-address of the machine hosting the HTTP Tunnel Servlet. Valid only for <communicationType> "HTTP". |
proxyServerPortNumber |
The service port number used for communication by the proxy server. Valid for <communicationType> "TCP" and "HTTP". |
proxyServerName |
The name or IP-address of the machine hosting the proxy service. Valid for <communicationType> "TCP" and "HTTP" |
*serverContextId |
Variable that will receive the unique numeric identificator of the defined server context. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
Example:
EdmiError rstat;
SdaiUnsignedInt serverContextId;
. . .
if (rstat = edmiDefineServerContext("MyContext",
"Johnny", "supervisor", "w34rS7",
"HTTP", "9090", "EDMServerHost",
"/http/MyHttpTunnel", "7408 "192.136.64.13",
"1120", "OurProxyServer", &serverContextId)) {
printf("\nError %d in edmiDefineServerContext", rstat);
goto err;
}
. . .