10.10.2019
Posted by 
What Is Service Program In Rpgle Average ratng: 8,5/10 2286 reviews
Rpgle

Example H Nomain //Prototypes D FeetToInches PR extproc('feettoinches') D Feet 10 P 0 D Inches 10 P 0 D CentsToDollars PR extproc('centstodollars') D Cents 10 P 0 D Dollars 10 P 2 //. //. FeetToInches Procedure //. Converts Feet to Inches.

May 07, 2015 -Uses service programs- You can simply think of multiple subroutine placed under one object which can be accessed from outside world, program. You can not use a subroutine out of a program. Whereas, we can place many subprocedures under one module and it can be called from any other programs.

//. P FeetToInches B EXPORT D FeetToInches PI D Feet 10 P 0 D Inches 10 P 0 /Free Inches = 12. Feet; Return; /End-Free P FeetToInches E //. //. CentsToDollars Procedure //. Converts Cents to Dollars. //.

Rpgle

P CentsToDollars B EXPORT D CentsToDollars PI D Cents 10 P 0 D Dollars 10 P 2 /Free Dollars = Cents / 100; Return; /End-Free P CentsToDollars E First, the service program must be compiled and the PCML must be generated. For the purpose of this document, the PCML has been generated to an external file in the IFS. You should compile the source using the following commands: CRTRPGMOD MODULE(WEBTEST1/CONVERTS) PGMINFO(.PCML) INFOSTMF('/home/WebTest1/Converts/converts.pcml') CRTSRVPGM SRVPGM(WEBTEST1/CONVERTS) EXPORT(.ALL) You begin by loading IBM Web Administration for i. In a Web browser, go to On the All Servers tab under Manage, select Create Web Services Server. This will take you through an eight-step process that will create the Web service from the RPGLE service program. For the first step, it will ask for the user ID that the server's jobs will run under.

The default user ID is fine here. Select Use default user ID, and click Next. For the second step, it confirms that you would like to deploy a new service to externalize an IBM i program.

Make sure the checkbox is checked and click Next. For the third step, it asks for the library and object names. Enter the library WEBTEST1 and the object CONVERTS. Because it is a service program, select the.SRVPGM and click Next. If the program object does not have the PCML stored in it, you will need to specify the location of the PCML file. We compiled with the PCML file being output to the IFS, so we will specify that location here.

Enter the path and name of the pcml file, which is /home/WebTest1/Converts/converts.pcml. You can also browse to find this file. The fourth step asks for the name that you would like to give the service. You can also give it a description here. For the purpose of this example. We will name the service CONVERTS.

Memorial Service Program Template

In the fifth step, it lists the procedures and parameters that will be externalized as Web services. Select both centstodollars and feettoinches. In the Usage column, make sure that CENTS and FEET are set to be input parameters and DOLLARS and INCHES are set to be output parameters. For Step 6, it will ask for the user ID that will execute the RPG functions. You may specify the server ID or an existing ID. In Step 7, the wizard sets up the library list for the Web service.

Make sure WEBTEST1 is added to this list. Step 8 is a summary page. Once you have reviewed this page, click Finish. This will complete the wizard and create the Web services server and the service that will run on it. Once the server and service are created, they will be available for use. You can check on their status in IBM Web Administration for i. To test the Web service, you can select Manage Web Services Server.

This will show the deployed Web services on this server. By selecting Manage Deployed Services, you can see the full list of services on the server. Here, you can start, stop, deploy, and uninstall the Web services on this server. We can also test a Web service here using a generated test client. Choose CONVERTS and click Test Service. This will bring up a test client screen. Here, you can add parameters, enter data, and test the different functions of the service.

Ms-dos

Ms-dos

The service is now ready to be accessed by an external Web service client.