Does anyone know if it is possible to output an integer from a Plex generated RPG program? I don't see "integer" as an available AS400 format. We are using Plex 6.1.
Let me explain why I need an integer data type. Currently we use the Web Service wizard in RDi to create web services from our Plex RPG programs. This wizard uses something called a PCML file to define the parameters for the RPG program. It then generates a Java wrapper to implement the web service. When my RPG program outputs a multiple occurrence data structure of say 100 records, the XML that is returned to the caller contains 100 instances regardless of whether they contain any data. Apparently, if you have an output parameter of type integer that contains the record count, the generated Java will only generate XML for the number of records being returned.
No Apparently! It works great but as you have found out you need to ouput an integer and something else you will find out is it has to be a true OUTPUT field and not STRUCTURED ouput containing your integer. So it is a bust on two fronts
But the functionality offered was too good to be missed so I edit the source after generation. This is the only way and I talked about it here Consume & Publish Webservices from IBMi - Solved
But it is well worth the hassle and calling tiers perceive you better
Thanks for the information. I was pretty sure it couldn't, but I didn't know if there was a trick I was missing. I was wondering if it could handle the field being in a structure, so I'm glad you confirmed that.
So, when you edit the source do you end up adding a new field as an output parameter and move the value from the existing field or do you change the existing field definition to 10I 0 and move it out of the data structure?
Now that I think about it, I could use RPG source code in the PLEX model to define the integer field. I could also use source code to set the value of the integer field equal to the RowsFetched. That way, the only change to the generated RPG is to add the integer field to the PLIST. Maybe that is what you did.
The other challenge for me is to fix my PCML generation pattern to output the new integer field. I'll have to think about how to do that.
You can patternize everything up to the plist. Was going to create model api tool to do it but then thought why bother since there is no one in the world listening. Would have been an absolute folly much like StellaTools and CA Plex.
I started on the pattern, and it is pretty easy to do as you well know. Generating the PCML correctly will be a little more work. Thanks again.