View previous topic :: View next topic
|
Author |
Message |
Kadhir A
New User
Joined: 25 Jun 2020 Posts: 3 Location: United Kingdom
|
|
|
|
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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3083 Location: NYC,USA
|
|
|
|
So your question is why Testfield-num has 1 instead of 0? |
|
Back to top |
|
 |
Kadhir A
New User
Joined: 25 Jun 2020 Posts: 3 Location: United Kingdom
|
|
|
|
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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3083 Location: NYC,USA
|
|
|
|
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 |
|
 |
|