1 / 16

RPG – WSDL2RPG better than IBM’s utility

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?

barb
Download Presentation

RPG – WSDL2RPG better than IBM’s utility

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RPG – WSDL2RPG better than IBM’s utility Ed Waldschmidt ewaldschmidt@brotherhoodmutual.com 260-481-5361 September 30, 2011

  2. 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?

  3. 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

  4. 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.

  5. 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

  6. 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

  7. 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

  8. 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.

  9. 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

  10. 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

  11. Sample code cont. • You wrapper program is just reading your data and passing values to the module call. • The module will return values if neededincluding HTTP errors returned • After control is passed back to your calling program, the rest is native ILE that you developed in RPG.

  12. Real Example – Weather WSDL • // If the Web service finished successfully ... • B01 if (not WeatherForecastSoap_isError()); • // ... get response data from response data structure

  13. Real Example – Weather WSDL cont. • text = 'Retrieved ' + • (GetWeatherByZipCodeResponse... • .GetWeatherByZipCodeResult.Details) • + ' zip codes for ' + • parameters.ZipCode ;

  14. 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()

  15. 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

More Related