Creating a document type
The following SOAP request illustrates the creation of a document type with two basic attributes:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="http://www.tsystems.com/ima9/integrationws/messaging/201101">
<soap:Header/>
<soap:Body>
<ns:createDocumentType>
<documentType name="exampleDocType" isSystemType="false">
<attributes>
<!--Zero or more repetitions:-->
<attribute name="exampleDocType.stringKeyIdx" isKey="true" minOccurs="1" maxOccurs="1">
<type name="string"/>
<description>A sequence of characters of at most 2000 characters.</description>
</attribute>
<attribute name="exampleDocType.dateDateidx" isKey="false" minOccurs="0" maxOccurs="1">
<type name="date"/>
<description>The date type as defined in XML Schema.</description>
</attribute>
</attributes>
<description>This is an example document type.</description>
</documentType>
</ns:createDocumentType>
</soap:Body>
</soap:Envelope>
Note the following details:
-
The new document type’s name is “exampleDocType”.
-
The attributes defined for this document type are of the basic types “string” and “date”.
These referenced attribute types refer to basic types which are available in the repository. The complete list of available types can be requested by the service “listAttributeTypes” (see example step from beneath in chapter Listing available attribute types). -
Note that instead of the attribute name “exampleDocType.stringKeyIdx” any other name could have been chosen, as long as it is unique. Although the attribute names need not contain the document type, such a naming pattern is suggested as a convention since attribute names must be unique even beyond the scope of document types. It is impossible to have two document types containing an attribute with the same name.1
-
The string attribute has been defined as a required key attribute (see chapter Document model). Each revision which is to be created will therefore have to be fitted with exactly one corresponding attribute value.
-
The date attribute represents an optional index value (minOccurs = “0”).
-
The maximum bound (maxOccurs = “1”), which is defined for both attributes, identifies them as single valued attributes i.e. they are not of a multivalued nature.
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="http://www.tsystems.com/ima9/integrationws/messaging/201101">
<soap:Header/>
<soap:Body>
<ns:createDocumentTypeResponse>
<documentType name="exampleDocType" id="ad70fc31-f028-4ecb-9d2a-2a5a34cc7f7f" isSystemType="false">
<attributes>
<!--Zero or more repetitions:-->
<attribute name="exampleDocType.dateDateIdx" isKey="false" minOccurs="1" maxOccurs="0" id="4d18fb6f-1b1e-4aab-bb00-6fb4dcd6b9cd">
<type name="date" id="84e37798-9dcd-4d1d-a24a-754f9a182958"/>
<description>The date type as defined in XML Schema.</description>
</attribute>
<attribute name="exampleDocType.stringKeyIdx" isKey="true" minOccurs="1" maxOccurs="1" id="ce57ebed-1e76-4282-b980-5293ddfe977b">
<type name="string" id="4723e9a7-5e18-4852-a8ed-af9cbb11e824"/>
<description>A sequence of characters of at most 2000 characters.</description>
</attribute>
</attributes>
<description>?</description>
</documentType>
</ns:createDocumentTypeResponse>
</soap:Body>
</soap:Envelope>
Figure 570: Example – response on creating a document type
Note the following details:
-
Unique IDs have been generated for each of the attributes.
-
The returned attribute type IDs refer to the corresponding UUIDs from the available attribute types (see Example – response on listing attribute types)