Why data conversion errors occur

CICS validates SOAP messages only to the extent that it is necessary to confirm that they contain well-formed XML, and to transform them. This means that it is possible for a SOAP message to be successfully validated using the WSDL, but then fail in the runtime environment and vice versa.

The WEBSERVICE resource encapsulates the mapping instructions to enable CICS to perform data conversion at run time. A conversion error occurs when the input does not match the expected data, as described in the WEBSERVICE resource.

This mismatch can occur for any of the following reasons:

For example, the WSDL document might specify range restrictions on a field, such as an unsignedInt that can only have a value between 10 and 20. If a SOAP message contains a value of 25, then validating the SOAP message would cause it to be rejected as invalid. The value 25 is accepted as a valid value for an integer and is passed to the application.

A second example is where the WSDL document specifies a string without specifying a maximum length. DFHWS2LS assumes a maximum length of 255 characters by default when generating the Web service binding file. If the SOAP message contains 300 characters, then although the check against the WSDL would validate the message as no maximum length is set, an error would be reported when attempting to transform the message as the value does not fit the 255 character buffer allocated by CICS.

Code page issues

CICS uses the value of the LOCALCCSID system initialization parameter to encode the application program data. However, the Web service binding file is encoded in US EBCDIC (Cp037). This can lead to problems with converting data when the code page used by the application program encodes characters differently to the US EBCDIC code page. To avoid this problem, you can use the CCSID parameter in the Web services assistant batch jobs to specify a different code page to encode data between the application program and the Web services binding file. The value of this parameter overrides the LOCALCCSID system initialization parameter for that particular WEBSERVICE resource. The value of CCSID must be an EBCDIC CCSID.