Versions Compared

Key

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

Importing

Go to File → Import → Import WSDL and provide the location of the WSDL file. If you have multiple files (for example: your WSDL is importing/including an XSD schema) then provide a zip file with all needed files. Select the project for the import and you can choose whether to create a new module, or overwrite an existing one. When overwriting, as much as possible from the old module is kept. You can choose whether you also want to create a domain model. When this button is checked, entities, attributes and relations are created based on the type definitions of the XSD within the WSDL file.

Image Added

After you press the import button, you can choose which operations should be imported.

Image Added

You should get the message that the import was successful.

Mapping with Domain Model

Open your project and go the (newly-created) module which contains the webservice. The module now has a Schema Set and a Soap Service. These can be found in the bar on the left side of the screen, as can be seen below.

Image Added

The Schema Set defines which entities, attributes and relations are used by the webservice (they map the XSD to the domain model). The Soap Service defines which entities are sent. If the domain model was created automatically, then you can skip the following step, and directly go to Creating a Service Call.

Open the Schema Set, and unfold the schema. You can choose which entity is mapped to this type in XSD schema, as can be seen below. In this case, the anonymous complex type of the element “add” in the XSD schema is mapped to the entity “add” in the domain model (the red box).

Image Added

When choosing simple elements, you can choose to which attributes they map. See below. Mapping relations works in a similar way.

Image Added

For each operation, the webservice needs two singleton entities: a Request entity and a Response entity, which will be used to create the message. When you create the domain automatically, you will find these along with the other entities of the domain. You can use the soap service editor to create mappings for these, if you did not create the domain automatically, see below:

Image Added

Creating a Service Call

To call a webservice in studio, you need to create a service call. Chooses the AQ_WebServiceClient from the list of available service calls (do not forget to import the Blueriq library). Every operation in the WSDL needs its own service call.

Image Added

Here you can define several attributes.

  • Service Module: The module in which the service is located.
  • Service: Select SOAP or REST service and select which service to call.
  • Operation: This is the name of the operation which is going to be executed. You can look up the name in the WSDL.
  • Url: The URL of the webservice. If none is provided, the URL in the WSDL is used.
  • Configuration Module: The name of the module where the datamapping is located. You need to specify this if your domain model is not in the same module as the webservice.
  • Data Mapping: The name of the data mapping to be executed when this operation is called.
  • Username: A possible username, for services with logins.
  • Password A possible password, for services with logins.

Using the Webservice

After you have created your service call, you can use it inside a flow. The webservice throws a default event. When the service is executed, it will read the needed data from the domain model, starting from the singleton request instance. After receiving an answer from the server, the webservice will store the data in the domain model, starting from the singleton response instance. All data in these instances will be overwritten. If a data mapping is used, the mapping is executed after the domain module in the webservice module is filled. A common error is that an empty message is sent to the server. The reason for this is that the domain model for the webservice is not correctly initiated. If the webservice returns an error message, Blueriq runtime will show an error, because error messages are not supported yet.