Connect clients with new PAS for OpenEdge transports

To connect client applications with new transports:
  1. Update your client connections.
  2. Test your client connections.
  3. 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:

-URL http://host:port/aia/Aia?AppService=brokername

To:

-URL http://host:port/apsv

Change the ABL client connection to use the APSV transport

From:

-S port -H host -AppService brokername

To:

-URL http://host:port/apsv

REST

Change the client URLs to use the ROOT web application

From:

http://host:port/restservice/rest/restresource

To:

http://host:port/rest/restresource

WSA

Change the clients of the Web Services Adapter (WSA) to use the SOAP transport

From:

-WSDL http://host:port/wsa/wsa1/wsdl?targetURI=urn:CustomerSvc

To:

-WSDL http://host:port/soap/wsdl?targetURI=urn:CustomerSvc

WebSpeed

Change the WebSpeed clients to use the WEB transport

From:

http://host:port/cgi/wspd_cgi.sh/ . . .

To:

http://host:port/web/ . . .

*WSASP, WSISA, NSAPI, and CGIIP messengers are not used with PAS for OpenEdge.

To update an OpenEdge ABL client connection, follow these steps:
  1. Open the ClassicClient.p file in an editor. For example:
    proenv>mpro C:\OpenEdge\WRK\classicAppServerCode\ClassicClient.p
  2. Inspect the ClassicClient.p file, specifically the cConnect string:
    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.
  3. Replace the classic connections (cConnect) parameter with the updated connection parameter, and indicate that the sessionModel is Session-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.
  4. Save the file as PASforOpenEdgeClient.p.
  5. Recompile the client code and exit the file.
  6. 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.

  1. 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
  2. Verify that your application can connect and access your database data:
    Client connection to PAS for OpenEdge instance

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.

  1. Use the pasman command with the stop action to stop a running instance.
    pasman.{sh|bat} stop -I myProdInstance
  2. 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: