skip to main content
Corticon Server: Integration & Deployment Guide : Preparing Studio files for deployment : XML/JSON mapping
 

Try Corticon Now

XML/JSON mapping

If you have chosen to use Option 1 or 2 in the table Corticon Server Installation Options – in other words, the data payload of your call will be in the form of an XML or JSON document – then your Vocabulary may need to be configured to match the naming convention of the elements in your XML/JSON payload.

Displaying XML/JSON Mapping

On the Vocabulary menu, choose Add Document Mapping > Add XML/JSON Mapping.

Entity Mapping

When XML/JSON mapping has been added to the Vocabulary, its Entity properties are displayed.
Table 18. XML/JSON Mapping Entity Properties
Property
Value
XML Namespace
Specifies the full namespace of XML Element Name when there is no exact match.
XML Element Name
Specifies the XML Element Name when there is no exact match.
Vocabulary entities correspond to XML complex elements (complexTypes). If the complexType matches exactly (spelling, case, special characters, everything), then no mapping is necessary. However, if the complexType name differs in any way from the Vocabulary entity name, then the complexType name must be entered into the Element Name property, as shown:.
Figure 272. Mapping a Vocabulary Entity to an XML complexType
In the example shown in this figure, the Vocabulary entity name (Aircraft) does not exactly match the name of the external XML Class (Plane), so the mapping entry is required. If the two names were identical, then no mapping entry would be necessary.
If XML Namespaces vary within the document, then use the Namespace field to enter the full namespace of the XML Element Name. If no XML Namespace value is entered, then it is assumed that all XML Elements use the same namespace.

Attribute Mapping

When XML/JSON mapping has been added to the Vocabulary, its Attribute properties are displayed.
Table 19. XML/JSON Mapping Attribute Properties
Property
Value
XML Namespace
Specifies the full namespace of XML Element Name when there is no exact match.
XML Element Name
Specifies the XML Element Name when there is no exact match.
Vocabulary attributes correspond to XML simple elements. If the element name matches exactly (spelling, case, spaces, and non-alphanumeric characters), then no mapping is necessary. However, if the element name differs in any way from the Vocabulary attribute name, then the element name must be entered into the Element Name property, as shown in the following figure.
Figure 273. Mapping a Vocabulary Attribute to an XML SimpleType
If Namespaces vary within the document, then use the Namespace field to enter the full namespace of the Element Name. If no Namespace value is entered, then it is assumed that all Elements use the same namespace.

Association Mapping

When the Vocabulary has added XML/JSON mapping, you set their properties on the properties page of the Association.
>
Table 20. XML Mapping Association Properties
Property
Value
XML Property Name
Specifies the XML Element Name when there is no exact match to the Vocabulary association name.
Vocabulary associations correspond to references between XML complex elements. If the element name matches exactly (spelling, case, special characters, everything), then no mapping is necessary. However, if the element name differs in any way from the Vocabulary association name, then the element name must be entered into the Property Name property, as shown below.
Figure 274. Mapping a Vocabulary Association to an XML ComplexType

XML Namespace Mapping

Corticon Server assumes that incoming XML requests are loosely compliant with the XSD/WSDL generated for a particular Decision Service (by the Deployment Console, for example) so the Corticon XSD/WSDLs that are generated have a generic targetNamespace of urn:Corticon, as illustrated:
Figure 275. XSD with generic Namespace
Figure 276. WSDL with generic Namespace
Setting XML Namespace Mapping preference for unique target namespaces
Systems that are particular about XML validation might require a unique targetNamespace -- ideally globally unique.
You can choose to have unique names by setting the deployment propertn a server's brms.properties file. The changes will apply after a restart of the Server and the Deployment Console. The SOAP envelope targetNamespace will be set to a concatenation of the following strings:
*The WSDL's service soap address location +
*Forward slash character (/) +
*The Decision Service name.
The following images are examples of unique namespaces:
Figure 277. XSD with unique Namespace
Figure 278. WSDL with unique Namespace