How to implement Android invoke Web services based on IBM I

Source: Internet
Author: User
Tags line web web services

Implementing the Android call based on IBM I WEB services

As an interoperability technology in the heterogeneous environment of the Internet, Web services are widely used. Because of the cross-language, Cross-platform, and other features of Web services, we can reuse IBM I server-side RPG, COBOL, and other business programs in Web services via smart devices like Android. The main goal of this article is to combine the IBM I supported Web Services components to instruct readers on how to write an Android based Web service client that invokes the IBM I server-side Web service.

From the structure, this article mainly divides into 3 parts. The 1th part focuses on IBM I server-side support for WEB services. The 2nd part is the body, which focuses on how to write Web service client programs on the Android platform and invoke the IBM I Web services. The last part is the summary.

ConvertTemp for the WEB services throughout this article, the corresponding is a Fahrenheit to Celsius conversion of the temperature converter program. Rpgint is a user-defined, simple Web service, with the corresponding logic echoing the input numbers.

IBM I server-side support for WEB services

As an IBM I server-side component that supports Web services, IBM Integrated Web Service server for I simplifies the development process for Web services based on IBM i. On the one hand, the IBM integrated Web service Server for I integrates the Apache AXIS2 framework to easily create Web services. IBM integrated Web service server for I, on the other hand, is also an application server that provides a running environment for Web services. Therefore, without any additional coding, the integrated Web service Server for I can convert IBM I applications, such as existing RPG, to WEB service.

Figure 1 shows an Android based client application that invokes the Web Service published by IBM integrated Web Services Server for I, successfully reusing the IBM I platform based Rpg/cobol program.

Figure 1. Android client invokes Web Service architecture diagram based on IBM i

The specific WEB Service call request steps are as follows:

As the service requestor, the Web service client program based on the Android platform invokes the Web service Framework (ksoap-android) to send a SOAP based Web service invocation request;

As a service provider (Provider), IBM integrated Web services Server receives a Web service call request and invokes the corresponding Web service;

The Web service uses the Web Service Framework (AXIS2) to invoke the Rpg/cobol program to complete the business logic, using the interface provided by the IBM Java Toolbox for I with the PCB call Bean.

The Rpg/cobol program returns the results to the Web service and eventually to the Web service client calling program based on Android.

As an integrated Web console for IBM i middleware, IBM Web Administration for I supports Web wizards that leverage the IBM integrated Web Service Server for I server to create, deploy, ship Line Web service.

Because the focus of this article is to guide readers on how to write Web service client programs based on Android. For simplicity's sake, we're just creating an IBM integrated Web Service Server for I servers instance. By default, the Create Web Services Server Wizard of the IBM Web administration for I creates and deploys a Web service sample, running on this server, while creating a server instance. The process is created as follows:

Click the Create Web Services Server link to enter step 1th of the wizard, specifying the name and description of the server instance. Then click the Next button to enter the 2nd step of the wizard.

Specifies the IBM I job user that corresponds to the server instance. There are 3 options for using the default Qwservice user, selecting an existing IBM i user, and creating and using the new IBM I user. We select the 1th option and then click the Next button to enter the 3rd step of the wizard and the final--summary page.

Click on the Services tab of the Summary page to view the Web Services sample--converttemp and converttemp corresponding Web service description file--WSDL.

After you have created the IBM Integrated Web service server for I server, we can view the details of the WEB Services sample ConvertTemp and the running status through the Manage deployed services link , as shown in Figure 2:

Figure 2. The status of the sample Web service ConvertTemp

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.