Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
CICS Web services Assistant - Handling empty XML elements

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Kadhir A

New User


Joined: 25 Jun 2020
Posts: 2
Location: United Kingdom

PostPosted: Thu Jun 25, 2020 6:33 pm    Post subject: CICS Web services Assistant - Handling empty XML elements
Reply with quote

Hi, We have implemented a CICS provider pipeline and are utilizing the CICS WSA capability to parse input SOAP XML. I have used DFHWS2LS to generate the COBOL copybooks and WSBIND. My wrapper program has logic to pass data from the WSA generated COBOL copybook structure to another copybook that will be used in the application program.

The setup is working fine but I see a problem when it comes to empty XML elements that are numeric, for instance

Schema Field Definition
<element name = "Testfield" minOccurs="0" >
<simpleType>
<restriction base="integer">
<minInclusive value="0"/>
<maxInclusive value="999"/>
</restriction>
</simpleType>
<element>

WSA copybook structure
Code:
09 Testfield-num  PIC S9(9) COMP-5 SYNC.
09 Testfield          PIC 9(18) COMP-3.


Wrapper module Code:
Code:
IF Testfield-num > 0
   MOVE Testfield TO TestField-O
END-IF


If the XML has something like <Testfield></Testfield> or <Testfield/>, the corresponding WSA copybook Testfield-num field has 1 and the actual field Testfield-num has 0s. So the above code sets TestField-O to 0 which isnt correct when it comes to business logic. The expectation is the copybook field should have 0 only when the XML has <Testfield>0</Testfield>.

Will tweaking the parameters in DFHWS2LS job help? I couldn't make out from the CICS web services guide. It will be appreciated if you can help me get around this problem. We are at CICS TS version 5.4.
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2419
Location: NY,USA

PostPosted: Fri Jun 26, 2020 5:15 am    Post subject:
Reply with quote

So your question is why Testfield-num has 1 instead of 0?
Back to top
View user's profile Send private message
Kadhir A

New User


Joined: 25 Jun 2020
Posts: 2
Location: United Kingdom

PostPosted: Fri Jun 26, 2020 4:25 pm    Post subject:
Reply with quote

Hi Rohit

Yes, I use the greater than 0 check to pass the actual value to the OP copybook field. So, when the XML element is empty, I thought it should not have a value 1. But it looks like Testfield-num field has 1 because there is infact an XML element( though empty). Also the Testfield has 0 here. But I cannot introduce a Testfield check for 0s like

Code:
IF Testfield-num > 0 AND (Testfield NOT = 0)
   MOVE Testfield to Testfield-O
END-IF


because 0 is a valid value that can be passed in the input XML.

To summarize, the problem here is that the Testfield-O has 0 when the corresponding XML element was empty.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2419
Location: NY,USA

PostPosted: Fri Jun 26, 2020 4:35 pm    Post subject:
Reply with quote

Kadhir,
Did you test when a valid value is passed what’s in Testfield-num? Also when 0 is passed to Testfield vs just element with no values then if you treat them as 0 as a good one and move forward then what’s the downside ?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS exhausted FREE OSCOR hootan CICS 0 Sun May 31, 2020 12:36 pm
No new posts COBOL Student learning COBOL File Han... torrind COBOL Programming 3 Sat May 09, 2020 3:40 am
No new posts APCT Abend while running an online CI... amitc23 CICS 1 Wed May 06, 2020 9:59 am
No new posts CICS application timeout steven bynum CICS 3 Thu Apr 30, 2020 7:58 pm
No new posts CICS RACF & DB2CONN AllardK CICS 2 Thu Apr 30, 2020 1:33 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us