How to enforce digits only in an xsd simpleType input to CICS/DFHWS2LS - without using the pattern facet element?



As provider of a web service, I'd like to enforce a restriction on the value of an ID field in the associated web request to the expected number of digits, but according to CICS it appears that I'm unable to use a pattern facet element in the xsd/schema for that purpose. Also, AFAIK the length facet element doesn't support the restriction of characters to digit only.


I've supplied my colleague, a CICS user, with a WSDL file and separate but included xsd file for a web service, and evidently the DFHWS2LS tool in CICS Web Services Assistant does not recognize a pattern facet element contained in the xsd file.


(I know the following - and my colleague has separately confirmed - from the added log print out in my web service code - though the full text of the SOAP request is not available for now, since I have HTTP dump setting turned off in my tomcat start-up script in order to avoid flooding the log file.)


As a result, the web client (presumably COBOL - not sure) generated by my colleague sends to my web service a request whose ID field value is a 255-character (default length) string containing the expected number of digits - but followed by padding blanks - for the ID field.


Here's a sample included schema/xsd - e.g. with ID length 16...



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" targetNamespace="snip1" xmlns:tns="snip2" xmlns:xs="http://ift.tt/tphNwY">

<xs:element name="myUpdateStatus" type="tns:myUpdateStatus"/>

<xs:element name="myUpdateStatusResponse" type="tns:myUpdateStatusResponse"/>

<xs:complexType name="myUpdateStatus">
<xs:sequence>
<xs:element name="ssn">
<xs:simpleType>
<xs:restriction base='xs:string'>
<!-- DFHWS2LS ignores the following pattern facet-->
<xs:pattern value='[0-9]{16}'/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="updatedStatus">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="myUpdateStatusResponse">
<xs:sequence>
<xs:element name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>


FYI, I'm not a CICS user; hence I have no vendor support contract. Also, I have yet to inquire whether my colleague's vendor support has a work around.


No comments:

Post a Comment