Skip to main content

Integrated Web Services for i

Web services made easy

Tab navigation

Tab navigation


The Create Web Services Server wizard provides a convenient way to externalize programs running on IBM i, such as RPG or COBOL ILE programs, as Web services. The goal of the wizard is to create a recommended production level server configuration while requiring minimal information from the user.

This article provides start-up instructions for the creation of a Web services server and the deployment of a Web service written in the ILE RPG programming language.

To launch the Web services server wizard you need to sign on to the Web Administration GUI for IBM i and click on the Create Web Services Server wizard link. Point your browser to the Web Admin GUI for IBM i by specifying the following URL: http://hostname:2001/HTTPAdmin, where hostname is the host name of your server (note that if SSL has been configured for the Web administration server the URL would be https://hostname:2010/HTTPAdmin) and sign on. You must have *ALLOBJ and *IOSYSCFG special authorities to create a Web services server, or, if you are on IBM i 6.1 or newer release, you must have been given permission to create Web services servers. Launch the Create Web Services Server wizard by either clicking on the link in the navigation bar under the Common Tasks and Wizards heading, or on the main page of the Setup tab (see Figure 1 below).

Figure 1. Links to Create Web Services Server

screenshot from the IBM Web Administration for IBM i

Here are the steps to create a Web services server.

Step 1. Specify Web services server name

You have the option of naming (see Figure 2) the Web services server that is to be created. You can also provide a short description if you so choose. Accept the defaults and click on the Next button at the bottom of the form.

screenshot from the IBM Web Administration for IBM i
Figure 2: Specify Web services server name

Step 2. Specify server user ID

Specify the user ID to run the jobs associated with the server. You have the option of specifying an existing user ID, creating a new user ID, or using the default user ID. We will use the default user ID, QWSERVICE.

Note: Any user ID specified for the server must be enabled and the password set to a value other than *NONE. Ensure this is true for the specified user ID.

Click on the Next button at the bottom of the form.

screenshot from the IBM Web Administration for IBM i
Figure 3. Specify User ID for Server


Step 3. Deploy an IBM i Program as a Web service

You can deploy an existing IBM i program object as a Web service during the creation of the integrated Web services server, or you can do simply create the server and deploy a program object as a Web service later. If you do not select the option to deploy a new service, you will go to Step 9. We will leave the option to deploy a new service selected, which is the default as shown by Figure 4. Click on the Next button at the bottom of the form.

screenshot from the IBM Web Administration for IBM i
Figure 4. Deploy an IBM i Program as a Web service


Step 4. Specify location of IBM i program object

We now need to specify (see Figure 5) an ILE program object name from which the Web service is generated. There are two ways to locate the program object on the system. The default way is to specify the program and library names by selecting the option Specify IBM i library and ILE object name (Recommended). Another way is to search for the program object by browsing the IFS, which could take a while if a directory is specified that contains a lot of objects, such as /QSYS.LIB.

screenshot from the IBM Web Administration for IBM i
Figure 5. Specify location of IBM i program object


For each program object to be deployed there should be a corresponding Program Call Markup Language (PCML) document. PCML is based upon the Extensible Markup Language (XML), and is a tag syntax that is used to fully describe the input and output parameters of the program object.

The wizard determines whether the program object has any PCML data stored in the object. If no PCML data is found, the wizard shows a prompt in which you can specify a path to a PCML document that describes the program object. The PCML document is then validated and processed so that only information for exported functions or procedures is shown.

The PCML information can be generated three ways:

  1. Manually, using an editor.
  2. Using a development tool such as WebSphere Development Studio Client for iSeries.
  3. Recompiling ILE modules so that the PCML information is stored as part of the module (*MODULE) object.

The generation of PCML information is done by using the Program Interface Information (PGMINFO) parameter on the CRTRPGMOD and CRTCBLMOD commands. Since it is done on a per-module basis, you need to combine the generated PCML documents into one document so that the resultant document has the following format (not all elements and attributes are shown):

 <pcml version="4.0">
   <program name="p1" ... >  ...   </program>
   <program name="p2" ... >  ...   </program>
 </pcml>

The recommended approach for users not experienced with PCML, or users who do not need to customize the PCML document, is to store the PCML as part of the module object as follows:

  CRTRPGMOD PGMINFO(*PCML *MODULE)
  CRTCBLMOD PGMINFO(*PCML *MODULE)
  H PGMINFO(*PCML:*MODULE)
  PROCESS OPTIONS PGMINFO(PCML MODULE)

Refer to the IBM Information Center for more information on PCML syntax.

In our example, we will deploy the service program QIWSSAMPLE in library QSYSDIR. This service program is shipped as part of integrated Web services server support and contains one exported procedure, CONVERTTEMP, that is written in the ILE RPG programming language. The procedure converts the temperature from Fahrenheit to Celsius. The source for the procedure can be found in:

/QIBM/ProdData/OS/WebServices/V1/server/samples/ConvertTemp/CNVRTTMP.RPGLE

Fill in library name QSYSDIR and ILE Object name of QIWSSAMPLE and click on the Next button at bottom of form.

Step 5. Specify name for the Web service

Now we need to give the Web service a meaningful service name and description. By default, the service name and description is set to the name of the selected program object (see Figure 6). It would make sense to set the name of the Web service to 'ConvertTemp', but that name is already being used for the sample service that is deployed on all newly created integrated Web services servers. So let us set the name to 'ConvertTemp2'. You can also change the description if you so choose.

Click on the Next button at bottom of form.

screenshot from the IBM Web Administration for IBM i
Figure 6. Specify name for service


Step 6. Select Export Procedures to Externalize as a Web Service

The wizard will show a list of exported procedures as shown in Figure 7. For service programs (object type of *SRVPGM), there may be one or more procedures. For programs (object type of *PGM), there is only one procedure, which is the main entry point to the program. Expanding the procedure row shows the parameters for the procedure and various parameter attributes.

screenshot from the IBM Web Administration for IBM i
Figure 7. Select Export Procedures to Externalize as a Web Service


The parameter attributes are modifiable. In most cases you want to modify the parameter attributes to control what data is to be sent by Web service clients and what data is to be returned in the responses to the client requests.

The table contains the following information:

In this example, the TEMPIN parameter is an input parameter, and the TEMPOUT parameter is the output parameter. We change the Usage parameter attribute to output (see Figure 6 above). This means that a Web service client will need to only pass data corresponding to the TEMPIN parameter, and the response to the client request will be returned in the TEMPOUT parameter.

Click on the Next button at bottom of form.

Step 7. Specify user ID for this service

We now need to specify the user ID that the service will run under. As shown in Figure 8, you can run the service under the server's user ID or you can specify an existing user ID that the service will run under.

In order for the Web service to run correctly, the user ID status must be set to *ENABLED and the password must be set to a value other than *NONE. If a user ID is specified that is disabled or has a password of *NONE, a warning message is displayed and the service may not run correctly. In addition, ensure that the specified user ID has the proper authorities to any resources and objects that the program object needs, such as libraries, databases and files.

In this example, we will accept the default. Click on the Next button of the form.

screenshot from the IBM Web Administration for IBM i
Figure 8. Specify user ID for this service


Step 8. Specify library list

Specify any libraries that the program object needs to function properly (see Figure 9). You have the option of putting the libraries at the start of the user portion of the library list or at the end of the user portion of the library list. Click on the Next button of the form.

screenshot from the IBM Web Administration for IBM i
Figure 9. Specify library list


Step 9. Summary

The wizard shows you a summary page (see Figure 10), giving you the chance to see the details relating to the Web services server before it actually kicks off the task of creating the Web services server and deploying the service.

The Server tab on the summary page gives you details about the Web services server and the associated HTTP server (anytime a Web services server is created a corresponding HTTP server is also created). Here you will find information about ports, the location of the Web services server instance, etc.

screenshot from the IBM Web Administration for IBM i
Figure 10. Summary – Servers tab

If you click on the Services tab, you will see information about the services being deployed (see Figure 11). Here you will find the sample services being deployed, in addition to the service that we deployed.

screenshot from the IBM Web Administration for IBM i
Figure 11. Summary – Services tab

Finally, if you click on the Operations tab, you will see the Web service operations that correspond to the procedure that was selected to be deployed as a Web service operation (see Figure 12).

screenshot from the IBM Web Administration for IBM i
Figure 12. Summary – Operations tab

Clicking on the Finish button at the bottom of the summary page will result in the panel shown in Figure 13 being displayed by the wizard:

screenshot from the IBM Web Administration for IBM i
Figure 13. Server creating

After the server is created, the wizard will deploy the service and then start the Web services server and HTTP server. So if all goes well, you will eventually see the server in Running state and the deployed services active (green dot to the left of service name) as in Figure 14:

screenshot from the IBM Web Administration for IBM i
Figure 14. Server running


Congratulations, you have now successfully created a Web services server and deployed your first ILE program object as a Web service. Let us now look at the deployed service in more detail. Click on the Managed Deployed Services link that is to the left of the list of service names.

Step 10 (optional). Managed deployed services

The Manage Deployed Services form (figure 15) is used to view the list of deployed services, start or stop a service, deploy a new Web service, modify the properties of an existing service, view the WSDL definition, uninstall a Web service, or verify the function of the service by running a Web service test tool.

screenshot from the IBM Web Administration for IBM i
Figure 15. Manage deployed services


The deployed services table contains the following information:

If no service is selected, the only options you will see are the Deploy and Refresh buttons. However, if you choose a service, such as ConvertTemp2, by selecting the radio button next to the Web service name, more options will be displayed (see Figure 16).

screenshot from the IBM Web Administration for IBM i
Figure 16. Manage deployed services – service selected


The options are as follows:

We're here to help

Easy ways to get the answers you need.


or call us at
1-866-883-8901
Priority code:
101AR13W