Integrated Web services for i

In support of Web services and Service Oriented Architecture (SOA), the IBM® i operating system integrates software technologies that support externalizing integrated language environment (ILE) program objects as Web serviced and the consumption of a Web service by an ILE program object. These technologies are the integrated Web services server and the integrated Web services client for ILE.

Overview of technology

Web service technology promises a new range of possibilities for how organizations and their partners interoperate to offer dynamic e-business solutions. Web services connect business applications to each other, inside and outside the enterprise, regardless of their platform, design, or runtime environment. IBM provides the tools, protocols, technologies, support, and commitment to open standards, to help businesses create and use innovative Web services technology.

A Web service is a self-contained software component with a well-defined interface that describes a set of operations that are accessible over the Internet. XML technology provides a platform and programming language-independent means by which a Web service's interface can be defined. Web services can be implemented using any programming language, and can be run on any platform, as long as two components are provided to indicate how the Web service can be accessed: a standardized XML interface description, called WSDL (Web Services Description Language), and a standardized XML-based protocol, called Simple Object Access Protocol (SOAP). Applications can access a Web service by issuing requests formatted according to the XML interface.

Web services do not provide a Graphical User Interface (GUI) for the user. Instead, Web services share business logic, data, and processes through a programming interface across a network. Therefore, developers can access Web services from applications to gain specific functionality. In short, Web services are encapsulated functions which are offered using broadly adopted standard interface descriptions and protocols.

The Web services architecture is based on the interactions among three roles: service provider, service registry, and service requestor. The interactions involve the publish operations, find operations, and bind operations. Together, these roles and operations act upon the Web service artifacts: the Web service software module and its description. In a typical scenario, a service provider defines a service description for the Web service using Web Services Description Language (WSDL). The WSDL description of the service is then published to the service requestor or service registry. The service requestor uses a find operation to retrieve the service description locally or from the service registry. Once obtained, the service description is used to bind with the service provider and invoke or interact with the Web service implementation.

Service Provider (integrated Web services server)
From a business perspective, this is the owner of the service. From an architectural perspective, this is the platform that hosts access to the service.

Service Requestor (integrated Web services client for ILE)

From a business perspective, this is the business that demands that certain requirements be satisfied. From an architectural perspective, this is the application that is looking for and invoking, or initiating, an interaction with a Web service. The service requestor role can be played by a browser driven by a person, a program with a user interface, or a program without a user interface.

Prerequisites and assumptions

Ensure the HTTP Server prerequisites have been installed. In addition, load the latest HTTP Server group PTF.

Integrated Web services server

The integrated Web services server for IBM i greatly simplifies the process of externalizing ILE business logic as a service via the IBM Web Administration for i interface. The externalization of RPG and COBOL business logic as a service has been simplified to be an administrative task on IBM i. This simplification has been accomplished by abstracting the hidden complexities of Web services and extending the ILE programming model, to allow a System i administrators to directly externalize various ILE business tasks as services.

Creating a Web services server

The Create New 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.

  1. Access the IBM Web Administration for i from your browser. For information about how to access the Web Administration for i interface, see Starting Web Administration for i.
  2. From the IBM Web Administration for i interface, select the Setup tab, and then click Create Web Services Server to launch the Create Web Services Server wizard.
  3. Complete the wizards to create a Web services server. Click on the (?) icon to display the help information for a particular panel.

Externalizing IBM i programs as Web services

The Install New Service wizard provides a convenient way to externalize an IBM i program or service program as a Web Service. The wizards provides steps to specify the program object, select program export procedures to be made available through the Web service, and other parameters. When you finish the wizard, the Web service artifacts are created and a new Web service is deployed on the server.

  1. Access the IBM Web Administration for i from your browser. For information about how to access the Web Administration for i interface, see Starting Web Administration for i.
  2. From the IBM Web Administration for i interface, select the Manage tab.
  3. Select the Application Servers subtab.
  4. Select the Web services server that you want to install the new service on from the Server list.
  5. Click Install New service to launch the Install New Service wizard.
  6. Complete the wizards to install your program as Web services. Click on the (?) icon to display the help information for a particular panel.

Web services client for ILE

The Web services client is integrated into IBM i, providing a mechanism to generate service artifacts and allow ILE (RPG, COBOL, C, C++) to act as a services consumer with enablement for calling a variety of Web service implementations, including RPG, COBOL, C, C++, Java, PHP, .NET, WebSphere Process Server (WPS), and WebSphere Enterprise Service Bus (ESB).

The following lists some of the benefits and features for the web services client:
  • Natural extension for the ILE programmer to consume services from a program or service program.
  • ILE enablement to bind and call a service directly from IBM i service program or program.
  • Leverages WSDL to generates proxy client code to be integrated in program or service program.
  • Enhances existing System i development skills to interact with Web services and SOA.

Creating ILE Web service client stub (proxy) service program

Before you can create a Web service client application, you must first generate the client stubs using the wsdl2ws.sh tool.

  1. Copy the WSDL file to a directory in which the client stubs will be generated.
  2. Open Qshell and change the current working directory to where the WSDL file is located. For example, if the WSDL source file GetQuote.wsdl is in /stockquoteWS, then you would specify: cd /stockquoteWS
  3. Run the wsdl2ws.sh tool with the following command to generate the client stubs:

    /qibm/proddata/os/webservices/v1/client/bin/wsdl2ws.sh GetQuote.wsdl

    Note: The command above generates C++ stubs. To generate C stubs simply add the -lc option to the command. For example:

    /qibm/proddata/os/webservices/v1/client/bin/wsdl2ws.sh GetQuote.wsdl -lc

    .
  4. Examine the generated web service stub artifacts in the IBM i Integrated File System (IFS), to determine the interfaces for ILE service programs/programs to interact and invoke the service stub code.
  5. Compile the C or C++ stubs you generated in the previous step. In the following example the generated stub file is StockQuote.cpp:

    CRTCPPMOD MODULE(MYLIB/STOCKQUOTE) SRCSTMF('/stockquoteWS/StockQuote.cpp')INCDIR('/qibm/proddata/os/webservices/v1/client/include')ENUM(*INT).

  6. Create the Web service client proxy service program.
    For C++ stubs, your will need to bind to service program QSYS/QAXIS10C.
    CRTSRVPGM SRVPGM(MYLIB/GETQUOTEWS) MODULE(MYLIB/STOCKQUOTE) EXPORT(*ALL) BNDSRVPGM(QSYS/QAXIS10C)
    For C stubs, you will need to bind to service program QSYS/QAXIS10CC.
    CRTSRVPGM SRVPGM(MYLIB/GETQUOTEWS) MODULE(MYLIB/STOCKQUOTE) EXPORT(*ALL) BNDSRVPGM(QSYS/QAXIS10CC)

Once the client stubs have been generated and a service program containing the stubs created, you can now develop a Web service client application that can invoke the Web service via the stubs. More information on Web services client programming using Web services client for ILE can be found in the PDF files located in /qibm/proddata/os/webservices/v1/client/docs.