We help IT Professionals succeed at work.

WSDL2RPG  Limits

Theo Kouwenhoven
on
Medium Priority
62 Views
Last Modified: 2019-07-05
Hi Experts,

Using the WSDL2RPG from IBM....,
I thougt that this would be the tool that solve all my Webservice problems :-)
But now I get the following errors from the compiler:

*RNF0501 20      6 Length of character item exceeds 16773104; length defaults to 16773104.  
*RNF7301 30     93 Position of subfield is greater than length of data  structure; specification ignored.          

Position (335462082-335462085) of subfield SIZE in data structure SHIPMEN... is greater than length of data structure (16773104).                                

I understand what the problem is, but I still have to create a Webservice client
So I have a big issue/challenge.
What is the way to solve this issue?
Comment
Watch Question

Gary PattersonVP Technology / Senior Consultant
CERTIFIED EXPERT

Commented:
Hi Theo,

The first error is probably causing the second one.  There is something in the WSDL that is causing WSDL2RPG to try to generate a DS (most likely) longer than RPG allows - 16,773,104 bytes.

Ultimately, sometimes you need to go into the code that WSDL2RPG generates and do some "fine tuning" to reduce field sizes to "reasonable" lengths.

If you want specific advice, post the generated code and indicate the problem field.
Theo KouwenhovenApplication Consultant
CERTIFIED EXPERT

Author

Commented:
Hi Gary,

It's a large wsdl (over 2200 lines) with 13 operations. The problem is the "unbounded" Array items, some of them are base64Binary and need at least a size 16380. In all cases 2 or 3 are sufficient, but WSDL2RPG don't let me make a diference between a array of b64 elements or Shipmentlines. Generating 50 shipment lines, will generate 50*50 B64 elements :-(
I tried to change the maxOccurs="Unbounded" into maxOccurs="3", but this will be overruled by the number you specify on the generation string, or can I change someting in that part.

/QIBM/ProdData/OS/WebServices/V1/client/bin/wsdl2rpg.sh -o/home/myDir/MyWs -s/QSYS.LIB/MY.LIB/MYSVRPGM.SRVPGM -ms128 -mb16380 -ma10 file:///home/myDir/myDef.wsdl
Gary PattersonVP Technology / Senior Consultant
CERTIFIED EXPERT

Commented:
Hi Theo,

Sometimes, if you choose to use wsdl2rpg.sh, you have to generate the code, and then tweak the generated code to suit your particular needs, then compile it.  

Sounds like this may be one of those cases.

If you want to provide the wsdl, the generated code, and the compile listing showing the failure, I'd be happy to take a look.
Theo KouwenhovenApplication Consultant
CERTIFIED EXPERT

Author

Commented:
Gary,

for maintenance we choose not to edit generaties code.
the created services wil be part of our standard software. If we can't use this wsdl2rpg, I have to come up with an other solution.
meanwhile, I did isolate one function from the mentioned wsdl so that I have a new (simpel) wsdl. from this one I was able to generate the stubs an a service program.

But I think that the risk will stay as long as the XML is build in a variable/DS.
maybe it's a better approach to write our one program to fill an IFS file with XML data.
and use java to do the SOAP handling. I like to read your thoughts / opinion about this.
Gary PattersonVP Technology / Senior Consultant
CERTIFIED EXPERT

Commented:
I prefer to use a more "XML/JSON friendly" language for web service client development.  On IBM i, I like (in order of favorites):

php, node.js, Java, and SQL (IBM i DB2 HTTP extensions).  I've also used the C and RPG stubs generated by wsdl2ws.sh / wsdl2rpg.sh, and  RPG+HTTPAPI.
Theo KouwenhovenApplication Consultant
CERTIFIED EXPERT

Author

Commented:
Hi Gary,

In order of your favorites,
php and node.js is also mentioned here.

In what context can I see the wsdl, xlm and DB access here
but these persons can't explain me the way to initiate this from the iSeries (or how to process the response)

So I don't have any idea of  who or what is selecting the right data (and transform it if required)
What is handling the errors, how do I get them in my program etc.
Gary PattersonVP Technology / Senior Consultant
CERTIFIED EXPERT

Commented:
Whole set of tutorials and sample code here for calling php scripts in PASE from RPG, including php code to invoke a REST web service:

http://yips.idevcloud.com/wiki/index.php/I5/RPG101CallPHP