CONNECT( ) method (Pacific Application Server)

Connects and associates an instance of the Pacific Application Server for OpenEdge (PAS for OE) with the specified server handle and specifies the application model for the connection.The current application becomes a client application of the connected PAS for OE 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 for OE instance.

The following table describes the connection parameters available to connect a PAS for OE instance.

PAS for OE 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 for OE 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 for OE connection parameters described in this table or Table 2. 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 for OE 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 for OE 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 for OE 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 for OE instance can be represented by either one of the following URIs:

  • ./ROOT/apsv
  • .//apsv
  • ./apsv

The client determines the application model that the PAS for OE instance uses for each connection, because ABL sessions on PAS for OE run using any application model that a given client requires.

Note: Connections to an Internet-secure (HTTPS) PAS for OE instance require the management of digital certificate stores for public keys on the client (SSL client) and private keys on the PAS for OE instance (SSL server). For information on configuring PAS for OE for HTTPS connections, see the Pacific Application Server for OpenEdge: Administration Guide. For information on using SSL to secure the client side of a PAS for OE application, see the Pacific 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 for OE 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:

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 for OE:

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 for OE instance */
END.