Kato Integrations Logo Light
Home  /  Resources  /  Blog  /  Overcoming C Stubs and QSH – Without Stubbing Your Toe

Overcoming C Stubs and QSH – Without Stubbing Your Toe

Simplifying PFSWeb's RPG Infrastructure

It is not uncommon for developers to contact our team after exhausting other “solutions” and finding them lacking important aspects they crave.

Such was the case with PFSWeb, a leader in providing customer care, logistics, and professional services to clients in the eCommerce industry. It would be easy for us to tell the story from our perspective, but Kirk Williams, a developer at PFSWeb does a much better job.

“My name is Kirk Williams and I am a developer here at PFSweb. Just so you have a little background, more and more requirements come about where our OMS (and other systems) hosted on IBM i needs to interact with an external system via a Web Service. For the most part, these have been SOAP Web Services and to consume these services, we currently us IBM’s Integrated Web services for i Suite to do so. If you’re not familiar with this tool, you basically run a QSH command from the IBM i, referencing the WSDL for the SOAP service, and from that, it creates a bunch of C stub programs (on the IFS) and from them creates a consolidated service program which has everything you need to interact with the service.

Now, once we got the hang of it, it was somewhat easy enough to code against the service program. It also creates a /COPYBOOK for you that has all of the predefined data structures that map to the WSDL so it is easy to reference all of the XML nodes, elements, etc. when dealing with the Request and Response XML via qualified data structures.

However, the problems that we would run into sometimes is that the QSH command would end in error and not be able to create the C stubs modules and service program. The reasons varied, but for the most part were always related to a complex type and/or data type, etc. not being supported when they are clearly industry standard WSDL definitions. Another limitation of the IBM tool is that as part of the QSH command, you specify the [number of array dimensions] for all of the XML elements in the WSDL where maxOccurs=”unbounded”. Since it uses the XML element , type, and data names right from the WSDL, if you specified too large a number, one of the C stubs modules may not compile because it would somehow cause the field name length to be too large.

Again, the above would happen using the original native WSDL from the vendor. At this point, what we have been doing is taking that same original native WSDL from the vendor and would write a VB.NET WCF service (wrapper if you will) for that WSDL. The majority of the time, how the (Visual Studio 2010) .NET IDE would create it’s “stubs” and “references” to the WSDL, by referencing those same complex types and/or data type in a .NET WCF service and giving THAT WSDL to the QSH command, everything would compile and work fine. However, the limitation on the [number of array dimensions] you could specify is a limitation either way. It’s strange that in some cases, very complete WSDLs work fine in some cases, but one that appear very simple do not.”

We see this all too often – what starts as simple task quickly becomes a tough row to hoe.

Thankfully, Kirk brought RPG API Express into the mix to simplify their web services infrastructure – making it reliable and predictable. Using RPG API Express, Kirk was able to keep everything in a single technology; RPG on IBM i.

We call that a win.

Do you have a web service that you’d like to integrate with your IBM i?

Remove the stress from your team and make us your virtual IT team – that’s what we are here for! Contact us and we can discuss your project, timelines and budget.

Table of Contents