Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : CONNECT( ) method (Progress Application Server)
 

CONNECT( ) method (Progress Application Server)

Connects and associates an instance of the Progress Application Server (PAS) with the specified server handle and specifies the application model for the connection. The current application becomes a client application of the connected PAS instance using the specified application model.
Return type: LOGICAL
Applies to: Server object handle

Syntax

CONNECT ( [ connection-parms ]
[ , userid ]
[ , password ]
[ , app-server-info ] )
All of the parameters for the CONNECT( ) method are optional and have defaults if you do not specify them.
connection-parms
A character string containing a space-separated list of one or more connection parameters necessary to establish connection to a PAS instance.
The following table describes the connection parameters available to connect a PAS instance.
Table 71. PAS connection parameters
Connection parameter
Description
-NoSessionReuse
If specified, the connection does not reuse the SSL session ID when reconnecting over HTTPS to the same PAS instance.
-NoHostVerify
If specified, turns off host verification for an HTTPS connection. Without this parameter specified, the client compares the host name specified in the connection with the Common Name specified in the server certificate, and raises an error if they do not match. With this parameter specified, the client never raises the error. For more information, see OpenEdge® Getting Started: Core Business Services - Security and Auditing.
-pf filename
Where filename specifies a text file containing any of the other PAS connection parameters described in this table or Table 70. If this file contains any other OpenEdge startup parameters, the method ignores them.
-sessionModel option
Where option specifies the application model required by the ABL client for this connection, which can have one of the following values:
*Session-managed
*Session-free
This value is not case sensitive.
This parameter is required for session-free applications and is optional for session-managed applications. The default value is Session-managed.
-URL web-path
Where web-path specifies the URL to a PAS instance using the following syntax:
scheme://host:port/[web-app-name|/ROOT/|/]apsv
Where:
scheme
Is either HTTP or HTTPS.
host
Specifies the name or domain of the PAS host.
port
Specifies the port for the host connection. Typically, HTTP uses 8810 and HTTPS uses 8811.
/[web-app-name/|ROOT/|/]apsv
Specifies the OE ABL Web application and ABL client (or Open Client) transport (apsv) to connect with, where web-app-name is the name of an OE ABL Web application other than the default (oeabl.war) and any other combination specifies a connection to the default OE ABL Web application.
For example, assuming a given PAS instance (scheme, host, and port (.)), an ABL client connection to an OE ABL Web application deployed in a WAR file named inventory.war has the following URI:
*./inventory/apsv
An ABL client connection to the default OE ABL Web application on the same PAS instance can be represented by either one of the following URIs:
*./ROOT/apsv
*.//apsv
*./apsv
The client determines the application model that the PAS instance uses for each connection, because ABL sessions onPAS run using any application model that a given client requires.
Note: Connections to an Internet-secure (HTTPS) PAS instance require the management of digital certificate stores for public keys on the client (SSL client) and private keys on the PAS instance (SSL server). For information on configuring PAS for HTTPS connections, see the Progress® Application Server for OpenEdge: Administration Guide. For information on using SSL to secure the client side of a PAS application, see the Progress® Application Server for OpenEdge: Application Migration and Development Guide. For information on managing digital certificate stores for OpenEdge SSL clients, see OpenEdge Getting Started: Core Business Services - Security and Auditing.
[ userid ][ , password][ , app-server-info ]
From one to three character string parameters passed as input to the PAS Connect procedure, which is specified by the sessionConnectProc property in the instance openedge.properties file. The possible values that you can specify for these parameters is determined by the Connect procedure for the business application. If you omit a parameter, it defaults to the Unknown value (?).
If an error occurs while executing the CONNECT( ) method, the method returns FALSE. Some conditions for which an error can occur include:
*The server handle is invalid.
*One of the parameters contains an invalid value.
*One of the values specified in the connection-parms parameter is invalid.
*The PAS instance executes a Connect procedure that terminates with a STOP condition, a QUIT condition, or after executing a RETURN ERROR statement. For more information on PAS Connect procedures, see the Progress® Application Server for OpenEdge: Application Migration and Development Guide.
If the CONNECT( ) method completes successfully, the method returns TRUE.
The connection lasts until the client application executes the server handle DISCONNECT( ) method or until the server session detects any failure conditions that automatically terminate the connection.
For example, the following code fragment makes a session-free connection to an OE ABL Web application named GeneralLedger on a local instance of PAS:
DEFINE VARIABLE happsrv AS HANDLE NO-UNDO.

CREATE SERVER happsrv.
IF happsrv:CONNECT("-URL http://localhost:8810/GeneralLedger/apsv
                    -sessionModel session-free") THEN
DO:
    /* Some accounting work on the local PAS instance */
END.