The common schema content is defined to the xsebatch command line tool through an XML file that can be specified either on the command line parameter (-commtypes for “Common Types”) or by the “commTypesFile“ attribute specified in the ServiceSpecification.xml file.
The user can override the commtypes xml file specified with the “commTypesFile“ attribute for input and output message elements (InputMessage and OutputMessage) in the Batch processor option specification file (ServiceSpecification.xml).
When the user creates and specifies the commtypes xml file, the WSDL and XSD generation process uses the information specified in the commtypes file to generate elements, types and schema imports instead of the imbedded types, elements and namespaces. The list of common types from the command line parameter can be overridden by the content of the file(s) specified on the commTypesFile attribute.
| Element or Attribute | Definition |
|---|---|
| CommTypes | Container element for common groups. |
| CommGroup | Group for listing common type information. |
| lang | Specifies the source language of the application source being processed. |
| format | For source languages that permit fixed or free source formatting, this attribute must specify which format is used. Currently this attribute is reserved and set to "fixed". |
| CommonType | Attributes of this element describe how the common application source data items should be processed (see below). |
| srcName | Specifies the source name of the copybook as it appears in the COBOL application program source. COPY books specified in the srcName attribute are not cross-referenced with the COBOL application source files, but they must be present and accessible to the Batch processor tool when the COBOL application source is processed. |
| nativeName | Specifies the COBOL data item name for which the XML schema reference and type should be taken from the common schema. |
| commSchemaLocation | Specifies the common schema location attribute
(xsi:schemaLocation) that is generated in the import statement for
the enclosing WSDL or XSD. Note: For CICS® Webservices
scenarios this location must be accessible when the tools are running,
Otherwise an error message are displayed and the generation process
does not complete.
|
| commNamespace | Specifies the value of the namespace declaration that is generated for referring to the common schema. |
| xmlElementName | Specifies the value of the element name from the common schema that should be referred to from the enclosing WSDL or XSD. |
| commNsPrefix | Specifies the value of the namespace prefix that should be generated to qualify the reference of the common elements and types. |
Figure 1 is an example of a commtype xml file used to direct the processor to use common types, elements, namespaces, in a COBOL source language sample.
<?xml version="1.0" encoding="UTF-8"?>
<commtypes:CommonTypes xmlns:commtypes="http://www.ibm.com/xmlent/commxsd/emf/commtypes">
<commtypes:CommGroup lang="COBOL" format="fixed">
<commtypes:CommonType
srcName="COMMHDR"
nativeName="commHeader"
commSchemaLocation="commHeader.xsd"
commNamespace="http://www.sample.com/schemas/commHeader"
xmlElementName="commHeader"
commNsPrefix="hdr1"
/>
</commtypes:CommGroup>
</commtypes:CommonTypes>
The commtype xml file schema is shown in Figure 2.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:commtypes="http://www.ibm.com/xmlent/commxsd/emf/commtypes"
targetNamespace="http://www.ibm.com/xmlent/commxsd/emf/commtypes">
<xsd:element name="CommGroup">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="commtypes:CommonType" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="lang" type="xsd:string"/>
<xsd:attribute name="format" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="CommonTypes">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="commtypes:CommGroup"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CommonType">
<xsd:complexType>
<xsd:attribute name="srcName" type="xsd:string"/>
<xsd:attribute name="xmlElementName" type="xsd:string"/>
<xsd:attribute name="nativeName" type="xsd:string"/>
<xsd:attribute name="commSchemaLocation" type="xsd:string"/>
<xsd:attribute name="commNamespace" type="xsd:string"/>
<xsd:attribute name="commNsPrefix" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Figure 5 shows the commHeader schema.
<schema attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://www.TST01I.com/schemas/TST01IInterface"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:cbl="http://www.TST01I.com/schemas/TST01IInterface"
xmlns:hdr1="http://www.sample.com/schemas/commHeader">
<import namespace="http://www.sample.com/schemas/commHeader"
schemaLocation="commHeader.xsd"/>
<complexType name="departmentUpdateRequest">
<sequence>
<element ref="hdr1:commHeader"/>
<element form="qualified" name="member_count">
<simpleType>
<restriction base="int">
<minInclusive value="0"/>
<maxInclusive value="999999999"/>
</restriction>
</simpleType>
</element>
<element name="dept_details" type="cbl:departmentupdaterequest_dept__details"/>
</sequence>
</complexType>
<schema attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://www.TST01O.com/schemas/TST01OInterface"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:cbl="http://www.TST01O.com/schemas/TST01OInterface"
xmlns:hdr1="http://www.sample.com/schemas/commHeader">
<import namespace="http://www.sample.com/schemas/commHeader"
schemaLocation="commHeader.xsd"/>
<complexType name="departmentUpdateReply">
<sequence>
<element ref="hdr1:commHeader"/>
<element form="qualified" name="updStatus">
<annotation>
<appinfo source="http://www.wsadie.com/appinfo">
<initialValue kind="SPACE"/>
</appinfo>
</annotation>
<simpleType>
<restriction base="string">
<maxLength value="3"/>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
<element name="employeeUpdateRequest" type="cbl:departmentUpdateReply">
<annotation>
<documentation source="com.ibm.etools.xmlent.batch">8.0.0.V200803251533</documentation>
</annotation>
</element>
</schema>
Figure 5 is an example of the schema for the commonHdr.xsd file.
<?xml version="1.0" encoding="UTF-8"?><schema attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="http://www.sample.com/schemas/commHeader"
xmlns="http://www.w3.org/2001/XMLSchema" xmlns:cbl="http://www.sample.com/schemas/commHeader">
<complexType name="commheader">
<sequence>
<element name="commId">
<simpleType>
<restriction base="short">
<minInclusive value="0"/>
<maxInclusive value="9999"/>
</restriction>
</simpleType>
</element>
<element name="commRevDate">
<annotation>
<appinfo source="http://www.wsadie.com/appinfo">
<initialValue kind="SPACE"/>
</appinfo>
</annotation>
<simpleType>
<restriction base="string">
<maxLength value="8"/>
</restriction>
</simpleType>
</element>
<element name="commDigest">
<annotation>
<appinfo source="http://www.wsadie.com/appinfo">
<initialValue kind="SPACE"/>
</appinfo>
</annotation>
<simpleType>
<restriction base="string">
<maxLength value="40"/>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
<element name="commHeader" type="cbl:commheader">
<annotation>
<documentation source="com.ibm.etools.xmlent.batch">8.0.0.V200803251533</documentation>
</annotation>
</element>
</schema>
This topic lists the rules and conditions for the feature “Including and Referencing Commonly Used Elements and Types”.