Support for <xsd:any> and xsd:anyType
DFHWS2LS and DFHSC2LS support the use of <xsd:any> and xsd:anyType
in
the XML schema. You can use the <xsd:any> XML schema element to
describe a section of an XML document with undefined content. xsd:anyType
is
the base data type from which all simple and complex data types are
derived; it has no restrictions or constraints on the data content.
xsd:anyType
with
the CICS assistants, set the following parameters:- Set the MAPPING-LEVEL parameter to 2.1 or higher.
- For a Web service provider application, set the PGMINT parameter to CHANNEL.
<xsd:any> example
This example uses an <xsd:any> element to describe some optional unstructured XML content following the"Surname"
tag in the "Customer"
tag:<xsd:element name="Customer">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="FirstName" type="xsd:string"/>
<xsd:element name="Surname" type="xsd:string"/>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
An example SOAP message that conforms to this XML schema
is:<xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<Customer xmlns="http://www.example.org/anyExample">
<Title xmlns="">Mr</Title>
<FirstName xmlns="">John</FirstName>
<Surname xmlns="">Smith</Surname>
<ExtraInformation xmlns="http://www.example.org/ExtraInformation">
<!-- This 'ExtraInformation' tag is associated with the optional xsd:any from the XML schema.
It can contain any well formed XML. -->
<ExampleField1>one</ExampleField1>
<ExampleField2>two</ExampleField2>
</ExtraInformation>
</Customer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
If this SOAP message is sent to CICS®, CICS populates
the Customer-xml-cont
container with the following
XML data:<ExtraInformation xmlns="http://www.example.org/ExtraInformation">
<!-- This 'ExtraInformation' tag is associated with the optional xsd:any from the XML schema.
It can contain any well formed XML. -->
<ExampleField1>one</ExampleField1>
<ExampleField2>two</ExampleField2>
</ExtraInformation>
CICS also populates the Customer-xmlns-cont
container
with the following XML namespace declarations that are in scope; these
declarations are separated by a space:xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.example.org/anyExample"
xsd:anyType
example
The xsd:anyType
is
the base data type from which all simple and complex data types are
derived. It does not restrict the data content. If you do not specify
a data type, it defaults to xsd:anyType
; for example,
these two XML fragments are equivalent:<xsd:element name="Name" type="xsd:anyType"/>
<xsd:element name="Name"/>
Generated language structures
The language structures generated for <xsd:any> orxsd:anyType
take
the following form in COBOL and an equivalent form for the other languages:- elementName-xml-cont PIC X(16)
- The name of a container that holds the raw XML. When CICS processes
an incoming SOAP message, it places the subset of the SOAP message
that the <xsd:any> or
xsd:anyType
defines into this container. The application can process the XML data only natively. The application must generate the XML, populate this container, and supply the container name.This container must be populated in text mode. If CICS populates this container, it does so using the same variant of EBCDIC as the Web service is defined to use. Characters that do not exist in the target EBCDIC code page are replaced with substitute characters, even if the container is read by the application in UTF-8.
- elementName-xmlns-cont PIC X(16)
- The name of a container that holds any namespace prefix declarations
that are in scope. The contents of this container are similar to those
of the DFHWS-XMLNS container, except that it includes all the namespace
declarations that are in scope and that are relevant, rather than
only the subset from the SOAP Envelope tag.
This container must be populated in text mode. If CICS populates this container, it does so using the same variant of EBCDIC as the Web service is defined to use. Characters that do not exist in the target EBCDIC code page are replaced with substitute characters, even if the container is read by the application in UTF-8.
This container is used only when processing SOAP messages sent to CICS. If the application tries to supply a container with namespace declarations when an output SOAP message is generated, the container and its contents are ignored by CICS. CICS requires that the XML supplied by the application is entirely self-contained with respect to namespace declarations.
Customer-xml-cont PIC X(16)
and Customer-xmlns-cont
PIC X(16)
. For an xsd:anyType
type,
the direct XML element name is used; in the xsd:anyType
example
above, the variable names are Name-xml-cont PIC X(16)
and Name-xmlns-cont
PIC X(16)
.