Language Reference Guide : 4. System Classes : RemoteServer Class : Initiate Method
 
Share this page                  
Initiate Method
The Initiate method connects to an appropriate server process that hosts the specified OpenROAD application image. An initiate must be done once—and only once—prior to using the Call4GL or JsonRpcRequest method.
This method has the following syntax:
Integer = RemoteServer.Initiate(image = imagepath, type = rptype
          [, flags = startflags][, location = locationname ]
          [, routing = routingstring])
This method has the following parameters:
image
Specifies the full path to the OpenROAD image file to be loaded in case type is not RP_LOCAL and routing is neither "http" nor "http-jsonrpc".
If routing is "http", it will be passed to the OpenROAD HTTP Gatekeeper, which usually takes this parameter as the name (AkaName) of the application to connect to.
type
Specifies one of the following types:
RP_LOCAL
RP_PRIVATE
RP_SHARED
The RP_LOCAL type is useful for development and debugging. When initiated in RP_LOCAL mode, all 4GL calls on the RemoteServer object are forwarded to a local instance of the named 4GL procedure (within the current application on its included applications) and not sent to an OpenROAD Server.
Descriptions of system constant values and their numeric equivalents are listed in RemoteServer Settings).
flags
Specifies a string containing authentication credentials if routing is either "http" nor "http-jsonrpc", or the OpenROAD application startup flags is otherwise.
It is ignored if type is RP_LOCAL.
location
Identifies the location where the application server is to be started.
This should be a URL of the Gatekeeper if routing is "http", the URL of the OpenROADJSONRPC servlet if routing is "http-jsonrpc", or a machine name or IP address otherwise.
If it is empty or omitted, the local machine will be used.
routing
Specifies a routing string. The following values are supported:
"compressed"
A COM or DCOM connection will be used; the traffic between the client and server will be compressed
"unauthenticated"
An unauthenticated COM or DCOM connection will be used
"unauthenticated-compressed"
Combination of "unauthenticated" and "compressed"
"http"
A connection will be established through an OpenROAD HTTP Gatekeeper (the JsonRpcRequest() method is not available in the connection)
"http-jsonrpc"
A connection will be established through an OpenROADJSONRPC servlet (the Call4GL() method is not available in the connection)
Note:  If the Initiate method is invoked directly to make a connection to an image (type is not RP_LOCAL and routing is neither "http" nor "http-jsonrpc"), the Name server is bypassed.