webMethods Integration Cloud and Cloud Deployment Documentation 6.0.0 | webMethods Integration Cloud | Document Types | Creating Document Types from Scratch
 
Creating Document Types from Scratch
* To add or edit a Document Type from scratch
1. From the Integration Cloud navigation bar, click Projects > <Select a Project> > Document Types. The Document Types page appears.
Note: You can create document types for already created REST Applications from the Projects > <Select a Project> > Applications > REST Applications > Document Types link or from the Request Body and Response Body panels while creating a REST Application.
From the Document Types page, you can add, edit, delete, or copy a document type.
2. To edit an existing document type, select a document type from the Document Types page and click Edit. Select a field to view the Field Properties panel.
3. To create a new document type from scratch, from the Document Types page, click Add New Document Type > Build from scratch.
4. Provide a name and description of your document type. Required fields are marked with an asterisk on the page.
5. Click Load XML to generate a document type from the XML structure or click Load JSON to generate a document type from the JSON structure.
6. Click the icon to add a new field. You can update the field properties by using the Field Properties window.
Provide the Name and Type of the field in order to define the structure and content of the document type. A field can be a String, Document, Document Reference, Object, Boolean, Double, Float, Integer, Long, or Short. If you select Document Reference, select the Document Reference. Fields are used to declare the expected content and structure of Integration signatures, document contents, and pipeline contents. In addition to specifying the name and type of a field, and whether the type is an Array, you can set properties that specify an XML Namespace and indicate whether the field is required at runtime by selecting the Required option. Select the Content Type you can apply to String, String list, or String table variables. See About Variable Constraints for information.
You can copy a field from the fields panel by clicking the icon. Depending on the context, you can either paste the field or the field path by clicking the icon. For example, if you copy a field and paste the field in the Set Value window in an Integration, the field path will be pasted. If you copy an array item, the path that is pasted includes the item index. For example, if the item that is copied is A/B/C[10], then the pasted path will also include the item index [10]. But if it is pasted in the document tree, it will appear as an array, like A[ ]. If there are multiple fields with the same name in a document, and one of the occurrences of such a field is copied, then the path when pasted will contain the occurrence number in brackets, for example, the path will be A/B/C(5) if the copied element C is the 5th occurrence under field B.
Note: You cannot modify or paste the child fields of a Document Reference.
Note: When defining a document type, avoid adding identically named fields to the document. In particular, do not add identically named fields that are of the same data type.
You can assign an XML namespace and prefix to a field by specifying a URI for the XML namespace property and by using the prefix:fieldName format for the field name. For example, suppose a field is named eg:account and the XML namespace property is set to http://www.example.com. The prefix is eg, the localname is account, and the namespace name is http://www.example.com.
Keep the following points in mind when assigning XML namespaces and prefixes to a field:
*The field name must be in the format: prefix:fieldName
*You must specify a URI in the XML namespace property.
*Do not use the same prefix for different namespaces in the same document type, input signature, or output signature.
7. Click Apply after you have entered the details and constraints for each field, and then click Save to save the Document Type.
Note: When you edit a document type, any change is automatically propagated to all Integrations that use or reference the document type.
The new document type appears in the Document Types page.

Copyright © 2014- 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.