We are doing a POC to convert SOAP web services to RESTful APIs using z/OS connect EE. We have our existing web services handling variable nested arrays using nested containers. Web services assistant uses the fields with suffix -num and -cont to handle the variable array need. Does z/OS Connect have any special feature to mimic the same?
Answer by edwardz10 (265) | Jul 14 at 09:02 PM
This link described the current zCEE capability in terms of support for depending on type clause
https://www.ibm.com/support/knowledgecenter/en/SS4SVW_3.0.0/designing/service_cobol2json.html
For example
OCCURS n TO m TIMES DEPENDING ON t PIC X
Answer by ZOS_USER_NW (1) | Jul 14 at 10:22 PM
For a single dimensional array, I am able to use ODO and it gets transformed to JSON correctly. But we have our existing layout used in web service that needed more than one dimensional array. For example: Account details: [ Account 1 Policy details [ Policy 1 Policy 2 ] Account 2 Policy details [ Policy 3 Policy 4 ] ] In Web service world, I am able to define Account level container and Policy level container. First I put Policy 1 (Policy container) followed by Policy 2 (Policy container) followed by Account 1 (Account container). Similarly for the next account. Do we have such facility in z/OS connect EE. Cobol restricts me to use nested variable arrays.
Answer by Chandrab (49) | Jul 16 at 09:26 AM
Similar question if this is of any help https://developer.ibm.com/answers/questions/498304/zos-connect-how-to-handle-nested-occurs-depending/
Answer by edwardz10 (265) | Jul 18 at 07:59 AM
Have a look at
http://www-01.ibm.com/support/docview.wss?crawler=1&uid=swg1PH13344
This APAR delivers the following new functionality: The z/OS Connect EE API toolkit has been enhanced with the capability to allow numeric service fields to be defined as counters for fixed and variable length arrays. Counter fields for arrays are used to optimize the request and response JSON for services. This also requires API Toolkit V3.0.6.7 or V3.2.6.7.
The PTFs for this APAR should be available in a week or so.
The above may help with what you want to do.
When the PTFs become available the whats new section of the zCEE KC will have info about the above change
Answer by ZOS_USER_NW (1) | Jul 18 at 09:05 AM
Thanks @Chandrab
@edwardz10: Thanks for your answer. So you mean to say that the APAR will be able to identify the count of nested array as well? For example: 03 AccountCount PIC 9(03). 03 PolicyCount PIC 9(03). 03 AccountData occurs 0 to 5 times depending on AccountCount. 05 AccountNumber PIC 9(10). 05 PolicyData occurs 0 to 5 times depending on PolicyCount. 10 PolicyNumber PIC 9(12).
I had to move PolicyCount before AccountData as Cobol does not allow. But PolicyCount can vary for each AccountData. Is there anyway I can communicate from Cobol so z/OS connect EE will get varied PolicyCount for each AccountData? In WSDL world, we were able to do that.
Answer by edwardz10 (265) | Jul 18 at 09:28 AM
My understanding is that in the Service project editor in the API Toolkit, you will be able to say that a numeric field contains a value that specifies how many entries there are in an array. This variable would be different from the variable used in the occurring depending on clause if used.
It's probably best to wait for the PTFs to ship, which should be soon, and then see the new doc in the zCEE KC to get detailed info about what this new capability will provide. Should happen in next week or two I believe.
I appreciate it's a bit frustrating to have to wait for the KC update, but I'd rather not try to briefly explain here how this will work, as there should be a more comprehensive explanation in the KC in due course.
Answer by ZOS_USER_NW (1) | Jul 18 at 09:43 AM
Sounds like it should solve our issue. Will wait for the PTF to arrive. Thanks for the update.
Answer by edwardz10 (265) | Aug 01 at 04:57 PM
@ZOS_USER_NW Was this new capability what you were looking for ?
Answer by ZOS_USER_NW (1) | Aug 01 at 05:09 PM
@edwardz10 I am not able to try this option due to compatibility issues with my server. I get BAQR7085E. Our server is V3.0.20. We are waiting for up gradation.