You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.
Table of contents
You can find the REST service editor under Connectivity.
Unlike a Schema set, or a SOAP Service, you have to create a REST service object yourself.
A REST service has the following structure:
- Service
- Operation
- request
- response
- Operation
- request
- response
...
- Operation
Within REST there are four operations available; PUT
, POST
, GET
, DELETE
.
Create REST service
After creating a REST service click on the root item of the tree and you will see the screen shown below.
- This is the location of the server. You do not need to provide the full path here. You can add fragments and arguments later on.
- If you are creating your own web service, no location is necessary
- Here you must specify the XSD schema set or the Domain schema that you want to use for sending and receiving data.
Operations
Add an operation by clicking on the + and select the newly created operation. Give it a name, for example:
In the operation editor screen, you can provide documentation that will be part of the service's Swagger feed.
Request
When calling an external REST service, this part defines the request you send to the service.
When setting up a web service (BaaS), this part defines the format for incoming requests.
- Select a singleton entity in which you store data concerning your request (for BaaS: the entity in which the request data format is modeled).
- This is the composed target URL which will be called. This URL consists of location, fragments and arguments. The target is the actual request.
- Fragments are part of your URL. Constant fragments never change.
- Dynamic fragments are determined during runtime. Select an attribute from the request entity (1) which will be read.
- Arguments are similar to fragments, with the difference that they consist of 2 parts. Example: format = xml
- Here the operation type is specified. Choose between
PUT
,POST
,GET
andDELETE
. - Here the message header can be specified. The headers must be attributes from the request entity.
For domain schemas
- Some services need a request header, for instance the header Accept that specifies the type of response.
- For parsing a message Blueriq supports
application/json
andapplication/xml
out of the box. The headers can be multivalued. - Another header type is the Content-Type. The Content-Type specifies the message format and is not multivalued. If the Content-Type is not set, then the default is application/json.
For XSD schema set
- By default the message format is XML. Therefore Accept headers and Content-Type headers are set automatically.
If you choose PUT
, POST
or DELETE
then you need to specify the request as well. See the description at Response.
Dynamic arguments
When adding a dynamic argument, it is possible to add validation rules and set if the argument is required or not. By default dynamic arguments are required. When the argument is not required, it can be left out of the url when calling the webservice.
Response
The following paragraph describes the configuration of the response, this is split into XSD schema set and domain schema.
When calling an external REST service, this part defines the message you (expect to) receive from the service.
When setting up a web service (BaaS), this part defines the response Blueriq will give to an incoming request.
XSD Schema Set
The image below is an example of response when using an XSD Schema Set.
- The entity that is the singleton where you start capturing the response.
- Define the headers of your message using attributes of the response instance.
- You can select an entity as body element. This is the entity that captures the actual content of the response.
- The schema element can be added when you want to receive data that is not part of your profile, for example the justification tree.
- This is the 1:1 relation between the entity in (1) and the entity in (3).
- Here you can add validations for the response.
- The validations can only be validation types. It is not possible to use validation rules.
- The Body relation is only shown when the body element has a value. It can switch to Body attribute when you only want to receive an attribute without selecting a body element. You want this if the response consist only of a single value without any representation of a structure.
Domain schema
- Select the domain schema that you want to use for the response.
- Select the 1:1 relation from the response singleton to the domain entity that links to the content of the response.