Connect clients with new PAS for OpenEdge transports
- Last Updated: January 6, 2025
- 3 minute read
- OpenEdge
- Version 12.8
- Documentation
Connect clients with new PAS for OpenEdge transports
- Update your client connections.
- Test your client connections.
- Stop your instance.
1. Update your client connections
All client connections must be updated to use one of the four transports, described in Welcome to PAS for OpenEdge. This table summarizes those updates:
|
Application changes by client types… |
|
|---|---|
|
OpenEdge |
|
|
Change clients of the AppServer Internet Adapter (AIA) to use the APSV transport |
From:
To:
|
|
Change the ABL client connection to use the APSV transport |
From:
To:
|
|
REST |
|
|
Change the client URLs to use the ROOT web application |
From:
To:
|
|
WSA |
|
|
Change the clients of the Web Services Adapter (WSA) to use the SOAP transport |
From:
To:
|
|
WebSpeed |
|
|
Change the WebSpeed clients to use the WEB transport |
From:
To: http://host:port/web/ . . . *WSASP, WSISA, NSAPI, and CGIIP messengers are not used with PAS for OpenEdge. |
- Open the ClassicClient.p file in an editor. For
example:
proenv>mpro C:\OpenEdge\WRK\classicAppServerCode\ClassicClient.p - Inspect the ClassicClient.p file, specifically the
cConnectstring:ASSIGN iCustNum=3005. CREATE SERVER hServer. cConnect = "-S 5162 -H localhost -AppService asbroker1". lReturn= hServer:CONNECT(cConnect). IF (lReturn) THEN DO: RUN ServerGetCustNameSample.p ON hServer (INPUT iCustNum, OUTPUT cCustName). DISPLAY "Customer Name: " cCustName FORMAT "x(40)" SKIP. hServer:DISCONNECT(). END. OUTPUT CLOSE. QUIT. - Replace the classic connections
(
cConnect) parameter with the updated connection parameter, and indicate that thesessionModelisSession-Free. For example:ASSIGN iCustNum=3005. CREATE SERVER hServer. cConnect = "-URL http://localhost:8817/apsv -sessionModel Session-Free". lReturn= hServer:CONNECT(cConnect). IF (lReturn) THEN DO: RUN ServerGetCustNameSample.p ON hServer (INPUT iCustNum, OUTPUT cCustName). DISPLAY "Customer Name: " cCustName FORMAT "x(40)" SKIP. hServer:DISCONNECT(). END. OUTPUT CLOSE. QUIT. - Save the file as PASforOpenEdgeClient.p.
- Recompile the client code and exit the file.
- Open the server code file—ServerGetCustNameSample.p—in an
editor. The code takes a customer number as input
and returns a customer name:
/* Sample code, run on Appserver, gets customer's name from "sports2020" database, based on customer number sent from client. */ DEF INPUT PARAM iCustNum AS INTEGER. DEF OUTPUT PARAM cCustName AS CHAR. IF CONNECTED("sports2020") THEN DO: FIND FIRST customer WHERE custNum = iCustNum NO-LOCK NO-ERROR. IF AVAILABLE customer THEN cCustName = Name. ELSE cCustName = "No record".Note: No changes are required on the server code, ServerGetCustNameSample.p, if you are running OpenEdge 12.
Test your client connections
The final test is to run a client connection that collects data from your database.
- Run the client code. For example, open
the PASforOpenEdgeClient.p file
in mpro using the following command in Proenv and
then press F1:
proenv>mpro %WRKDIR%\classicAppServerCode\PASforOpenEdgeClient.p - Verify that your application can
connect and access your database data:
Stop your instance
When you are done testing your server and it is no longer needed, then it is a good practice to stop the instance.
- Use the
pasmancommand with thestopaction to stop a running instance.pasman.{sh|bat} stop -I myProdInstance - View the application agent log file in
a text editor to ensure that the agent stopped
correctly and to see if your shutdown procedure ran.
If you are using the files included in this
tutorial, then the shutdown procedure writes the
following message to the log file:
This is a session shutdown event procedure!The agent log file can be viewed in instance-name/logs/application-name.agent.date.log. The agent log file should contain these types of entries that indicate a successful execution of the shutdown procedure, database disconnection, and agent shutdown:2019-10-04T14:36:42.252-0400 027876 019344 1 AS-4 ROOT:a:0000001f -- (Procedure: 'session_shutdown.p' Line:22) This is a session shutdown event procedure! 2019-10-04T14:36:42.276-0400 027876 018972 2 AS-ResourceMgr mtapsv:-:? CONN Disconnecting from database sports2020, user number 5. (9545) 2019-10-04T14:36:42.279-0400 027876 010356 1 AS-Listener mtapsv:-:? MSAS Agent Shutdown Complete.
To prepare the test instance for full production release, continue your learning with the following: