Business Scenario: In Multi-System Environment There is growing need to Communicate and exchange information with Other system without impacting current state of the existing System.

 

Solution: IBM has provided Utility WSDL2RPG which helps to create a stub ILE service program in RPG to allow you to consume a web-service.

 

MTR: Depending on Your OS400 Version ensure that the system is having these PTF’s

 

OS Version PTF
V5R4M0 SI42234
V6R1M0 SI42236
V7R1M0 SI42235

 

Once you’ve ensured that you have the appropriate PTF for your release installed, you’re ready to go. The Qshell script for WSDL2RPG is created.

 

Before you can execute the script, you’ll need the location of the WSDL document that describes the web service. That location can be either the HTTP location of the WSDL or a local WSDL document on the IFS.

 

The options available for this script are listed below:

  • -h/-help—Displays help text for the script/command.
  • -o [path] —Sets the output directory for the source to be created.
  • -ms [number] —Defines the maximum size for RPG character fields used to hold string data. For V5R4, the value can be between 16 and 650004. For V6R1 and higher, the range is 16 to 80000004. The default value is 128.
  • -mb [number] —Defines the maximum size for binary fields holding character data. The range is 48 to 650004 for V5R4 and 48 to 160000004 for V6R1 and higher.
  • -ma [number] —Defines the maximum array size for RPG arrays. The range is from 1 to 320004 for V5R4 and 1 to 80000004 for V6R1 and higher. The default value is 20.
  • -s [path] —This value is the full /qsys.lib path to the service program to be created.
  • -d—This option indicates that the resulting service program should be generated with debugging views

 

Use Case:  Requirement to Fetch the account information from Third Party and use the same in Transaction on the Native system.

WSDL Definition: https://somewebsite.com:8083/PY920/GetAccountIDManager?WSDL

As preliminary step we would Enter the Qshell command line by typing QSH at the command line

Thereafter we create a directory we intend to put Stubs and Source Code for Service programs.

mkdir e1int/Account

Once you create the Stubs and Source Code for Service program in /e1int/Account

As shown below.

It would also create Service program ACCOUNT in E1INT1 Library

Next Step would be to write Client in RPGLE TO CONSUME the Third-party Service.

RPGLE would be required to construct the xml message and invoke the client method which would return desired result. In this use case Server expects following xml to provide desired response.

 

Write a  Client GETACTID to achieve above step.

 

You can leverage using axiscAxisStartTrace API to capture logs which would enable to you trap in case of failures.

axiscAxisStartTrace(‘/e1int/nn/axis32.log’:*NULL);

 

Common Pit falls: If you are connecting to secured webservice ensure that secure socket level protocols are correctly set for your IBM OS.

Previous Post

We Make Beautiful Things

Next Post

Native or Hybrid whats your Choice ??

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top