Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Open your project and go the module which contains the web service. The module now has a Schema Set. This item can be found in the bar on the left side of the screen, as can be seen below.

The Schema Set defines which entities, attributes and relations are used by the web service (they map the XSD to the domain model). This works exactly the same for REST and SOAP, and the description can be found here: Chapter 4 - Calling a SOAP service.

1. Using a domain schema

In Blueriq version 9.2.6 we We added a new element, the domain schema. This domain schema lets you define a representation of your domain that the elements in the application, and that is used for the communication with a web service. In the below example, it is chosen that the status of an airport is represented by a certain set of attributes, starting with the delay. An important point to notice is that the domain schema is independent of the language that is used for the communication, and projects can add implementations of any representation not covered out of the box (JSON, XML). The domain schema that you define in studio is used as basis to create a message to a web service or to read a message from a web service. The domain schema can be translated to JSON or XML in a straightforward way, and can be inspected with the preview button.

Image Removed

You can The purpose of this representation is to define what items are needed to accurately describe an element (for example is the representation of person his first name, followed by his second name.). You can see the domain schema as a sort of contract of the communication. You start with an entity that represents the begin and the end of the message. For every attribute/relation you can select a name, what datatype it is, if it is required within the message and if it is multivalued. This contract should be set up to reflect the message that is send, but it can be different to the internal Blueriq domain. For instance, your contract uses a multivalued attribute. Your application always has one value for this attribute however, so it is not multivalued. When sending a message, it is no problem to insert a single-valued attribute in a multivalued entry in the domain schema. It will just be send as a list with only one entry. You have to be careful if it is the other way around, storing a list with possibly more values on a single values attribute.

Info

You might notice that the domain schema that you define is rather similar to the domain in Studio. This is certainly true. Situations when you deviate from this is when you only a subset of information is needed (summaries), or if you have control attributes that are not interesting for the communication.

An important point to note is that the domain schema is independent of the language that is used for the communication, and projects can add implementations of any representation not covered out-of-the-box (OOTB we offer JSON, XML). Blueriq uses he domain schema that you define in Studio as basis to create a message to a web service or to read a message from a web service. Using the domain schema Blueriq generates a JSON or XML message in a straightforward way during runtime. To inspect the translation to JSON or XML, click the preview button in Studio. In the below example, the status of an airport is represented by a certain set of attributes, starting with the delay.

Image Added

 

2. Defining the REST service

...