API Dev Tool Delivers For Trucking Outfit
October 2, 2023 Alex Woodie
When the IT leaders at Ward Transport & Logistics set out to find a product that would allow them to call outbound APIs from their IBM i server for a new dynamic pricing system, they had an inkling of what they wanted. But when they looked for an API development tool in the IBM i market, they were surprised at what they found.
From its headquarters in Altoona, Pennsylvania, Ward Transport & Logistics provides less than truckload (LTL) service to customers throughout the region. The company’s 1,600 employees help Ward’s customers move freight with a fleet of 750 power units and 1,100 trailers.
Ward relies on a single production Power Systems machine running IBM i to automate its business processes, with a backup system nearby. Like other prominent LTL companies in this country, Ward runs the LTL/400 package originally developed by Ayers Rock Software and now distributed by InfusedQuality LLC. In Ward’s case, it’s a highly modified version of LTL/400 that is supported by a team of RPG and PHP programmers.
The IBM i server and the LTL/400 package are a big part of the company’s past success and are central to the company’s IT plans moving forward, says Michael Zupon, Ward’s vice president of technology.
“The box is a beast,” Zupon says. “Back when we got it in the early 1990s, it helped transition us into a very solid regional carrier. It eliminated a vast array of costs and expenses over the course of that five years transitioning from our old system to the AS/400. It’s hard to fathom how we did that.”
Ward’s IT department has eight programmers to develop and maintain its RPG and PHP applications. LTL/400 was written in RPG, and it has several other RPG-based apps, such as accounting and pricing packages. Over the years, it’s adopted PHP as its strategic language for modernization and IBM i Web development.
One of the IBM i applications it developed in PHP handles inbound REST-based API calls that are initiated by customers on the Web. These API calls were for pickup requests, rate quotes, or tracing a shipment, says Ward’s technology manager, Ray Taylor, who leads PHP development.
“There’s a whole suite of APIs,” says Taylor, who was brought in as a PHP developer before broadening out into RPG. “They’re all inbound. We front them in PHP, build Db2 tables, call stored procedures, and the iSeries does all the work. It passes back a response, and we send the response back to the client.”
The combination of the PHP Web technology running atop IBM i and the underlying Db2 for i database has proven powerful for Ward, which has grown its inbound API business for years in the competitive LTL market, Taylor says. “We’re handling millions of HTTP requests on a weekly basis,” he says.
About a year and a half ago, the IT department faced a new business requirement: Executing outbound API calls from the IBM i server. The company was adopting a new dynamic pricing program, and it needed a way to tap into an external system, pass data from Db2, and get the response back over REST.
While PHP has delivered the goods for inbound APIs, where it calls RPG programs to process requests, PHP was not a good fit for handling outbound calls from LTL/400 that are initiated from within RPG. RPG doesn’t easily call PHP, Taylor says.
“There’s no clean way, no straightforward, nicely supported way to do that in RPG from the IBM i,” Taylor says.
When Taylor surveyed the market for a REST Web services tool that could support his needs, he found the selection was limited. To his chagrin, most of the tools were not native and instead ran in PASE.
Then he heard about a tool called MDRest4i from Midrange Dynamics North America. The product, which was originally developed by Stuart Milligan before he sold it in 2019 to Midrange Dynamics, was different from the other tools that Taylor saw in one important way: It was straight RPG. That immediately got Taylor’s attention.
“It’s 100 percent RPG-based. That was music to our ears,” he tells IT Jungle. “You can debug it just like a regular program. It’s all in front of you. You see the source code, There’s no smoke and mirrors. There’s just nothing hidden and any RPG programmer with a little bit of training can make use of it.”
That was the first selling point. The second selling point was the MDRest4i’s console. “That is an incredible tool,” he says. “Nobody else has anything close to it.”
What made the console valuable, Taylor said, was how it wrote the RPG code to power the Web services. Instead of having Ward’s RPG developers futz around with writing RPG code by hand, it’s generated automatically for them.
“You can import sample JSON requests and responses, and it generates an RPG program with probably 80 or 90 percent of the code in place to do what you need to do,” Taylor says. “The fact that it was RPG based and they had the program generator – I mean, it was there. There wasn’t even a question.”
While Ward’s programmers were capable of writing good, clean RPG Free code, the fact that MDRest4i could do it for them was a solid selling point.
“It generates all of the code to do the actual communication with the other server, all the SSL stuff, the socket programming,” Taylor says. “You could do it, but why would you dig a ditch with a shovel when you got a backhoe sitting there?”
Ward became a beta site for an external dynamic pricing system that could allow the company to grant shipping discounts response to business needs. For example, if the company wanted to boost business on one particular route, it could do that by granting discounts for freight moving from one particular Zip Code to another. It could also change them according to time and specific customers.
When a customer requests a quote, that external request is handled by the PHP-based Web services system, which populates the Db2 database table. If a rate discount is in order, the LTL/400 application would then call MDRest4i to initiate a separate REST session with the external rating bureau.
The dynamic rate pricing program has been a success, and today, the company taps into the external rating service via MDRest4i about 100,000 per day. But that’s not the only use case for the API product.
One of the other uses for outbound API calls from Ward’s IBM i server is to communicate with a driver management system from Maven. Maven provides Ward’s truckers with mobile phone-based apps that direct them where to get their next pickup and where to deliver it.
Previously, the integration between Maven and Ward’s LTL/400 system was handled through FTP uploads. By replacing that batch process with a real-time REST-based approach, it will give Ward better visibility into the location of their truckers and shipments. The company is in the process of implementing that system, Taylor says.
The company is also using MDRest4i to hook into Salesforce. That’s an interface that’s likely to grow, according to Taylor.
“Salesforce is becoming a much more integrated part of our sales team,” he says. “The communication between the iSeries and Salesforce is just going to explode, and that’s all API-based communications.”
Another factor giving comfort to Ward as it increases its use of MDRest4i is the Midrange Dynamics North America technical support team. They have been good to work with, Taylor says. Through their interaction with Milligan, who continues to support the product he built with MDNA, the company has added new features to MDRest4i. That’s something Taylor hasn’t experienced with other vendors.
“Stu and his team are outstanding,” Taylor says. “You never find that anywhere, where you can talk directly to the developers, and they say, “Okay, we’re gonna put that fix in. We’ll give you a new version tomorrow.’ By golly, there you go.”
Full products and platforms are good to have in production.
But for quick and strategic REST use, RPG is pretty fast and capable and so is worth noting tools like httpapi to send fast REST requests.
RPG is even pretty much capable of anwering json REST call too, with the integrated Apache, just using one instruction DATA-INTO you can deserialize the message on the wire and do what you want.