Versions Compared

Key

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

...

In order to interpret an XML response from a REST web service, Blueriq needs to import an XSD. In contrast to SOAP, there may not be an explicit contract available for REST. You can use the API of the REST service to get XSD files.

Tip

If the REST service only gives example answers, you can generate an XSD file from the examples (see for instance http://www.freeformatter.com/xsd-generator.html).

Close your project and go to File → Import → Import XSD and provide the location of the XSD file. If you have multiple files (for example: your XSD is importing/including an XSD schema), provide a zip file with all needed files. This is essentially the same as importing a WSDL (Chapter 4 - Calling a SOAP service). Select the project for the import and you can choose whether to create a new module, or overwrite an existing one. The option 'Generate Domain' will automatically generate a domain model for you, based on the XSD schema. When this button is checked, entities, attributes and relations are created based on the type definitions in the XSD. When using an existing module, there may already be a domain model present, that uses identical names as in the XSD. When overwriting, conflicting elements are not created. Obviously, these problems do not occur if you use a new module. When 'Generate Domain' is unchecked, no domain model is generated for you. In that case, you can later match map the elements from the XSD to you your own domain (explained later). In general, it is advised to use a separate module in order not to mix the domain model for the web service with the domain of your business.

You should get the message that the import was successful.

...