Presentation for October 2011 "RPG – WSDL 2 RPG better than - Status

watermelonroachdaleInternet και Εφαρμογές Web

30 Ιουλ 2012 (πριν από 4 χρόνια και 8 μήνες)

505 εμφανίσεις

RPG


WSDL2RPG
better than IBM’s utility


Ed Waldschmidt


ewaldschmidt@brotherhoodmutual.com

260
-
481
-
5361


September 30, 2011

Quick Poll

How many have worked with web
services?

How many have attempted
programming the interface for WSDL’s
and have been successful?

How many have done this in RPG?



WSDL programming made
simple.




Tools 400 has an utility which generates both
the service program and the module


The utility is called WSDL2RPG


Command interface for I
-
Series developers


Generated code does compile


Best part, it is free. Free software for the I
-
Series










IBM and the tool



IBM liked the tool, however, IBM dropped the
command interface.


Developers need to know how to navigate Q
-
Shell.


With IBM’s version, need to have
Websphere

installed on the system.


V5R1 is the oldest release supported, however
V6R1 is recommended.









IBM and the tool cont.


JAVA also needs to be installed on the I
-
Series


Defaults to C#.


One must manually setup the RPG source
file before migration. Library and source file
with member needs to be created first


Good luck









WSDL2RPG tool



Tools/400 shareware version resides in a
library on the I Series.


Provides a command that can be prompted
for the native I
-
Series developer which makes
code generation easier.


Tool evokes the WSDL for the developer
through HTTPAPPI to select correct module
of WSDL







WSDL2RPG tool (cont)


Generated code will compile


Can generate both the module and program


Markers are created in the program to indicate what
to pass for the WSDL


With minor changes the code (to add the parms the
WSDL needs) does run and return values


The tool will poll the WSDL and show you the
different WSDL’s that are available


Requires Scott Klements HTTP software









Wave of the future


More and more companies and government entities
are setting up WSDL’s for people to tap into
information. Such as : UPS for rates and delivery
status


This tool makes the code generation easy


Good support from Tom Radditz on his code


Try it. You will like it.









Downside to tool




Code generated is not pretty and is very
complex. Most generated code is this way


Module compile is very big and has every
procedure that could possibly be used. Most are
not needed










Sample code


Code tells you where to put your parameters for
call.

// Set the paramater values of the request message

// of the web service.

// assign values here

parameters.ZipCode = Pzipcode;


Substitute a value for the zipcode. Pzipcode was
added to the module as a parameter









Sample code cont.



You wrapper program is just reading your data
and passing values to the module call.



The module will return values if needed

including HTTP errors returned


After control is passed back to your calling
program, the rest is native ILE that you
developed in RPG.











Real Example


Weather WSDL






// If the Web service finished successfully ...



B01 if (not WeatherForecastSoap_isError());



// ... get response data from response
data structure









Real Example


Weather WSDL
cont.



text = 'Retrieved ' +



(GetWeatherByZipCodeResponse...



.GetWeatherByZipCodeResult.Details)



+ ' zip codes for ' +



parameters.ZipCode ;









Real Example


Aplicor WSDL
cont.


X01 else;


// ... else show error messages ordered by
priority:


// 1. HTTP error information


text = %char(
WeatherForecastSoap_HttpError_getCode()


) + ': ' +
WeatherForecastSoap_HttpError_getText()









Real example


Weather
WSDL cont.


The only modification is adding the parms to
program


The other modification that would be needed
is to write the wrapper program so that it can
handle return information.


Otherwise, native ILE code