This page describes the steps for calling a web service using the SOAP protocol. This page also give you background information on how web services work within the Blueriq architecture. The following steps are required:

Not everything in the WSDL standard is supported. See our Web Services datasheet for the restrictions on the standard.

1. Importing

Because a SOAP service is neatly defined within a WSDL, it is possible to import such a WSDL file in Blueriq.

To import a WSDL file:

  1. Make sure that the WSDL is supported. You can check that on the Web Services datasheet.
    As Blueriq Encore cannot retrieve files from external locations, you need to provide all required files in a flat zip file. If you are using import or include statements, make sure that they are changed to not point at remote locations.

    Instead of using

    <wsdl:import location="http://www.example.com/webservices/exampleservice?wsdl=ExampleService.wsdl" 
    	namespace="http://www.example.com/">
        </wsdl:import>

    use the following, and place CRMService.wsdl in the zip file when importing:

    <wsdl:import location="ExampleService.wsdl" 
    	namespace="http://www.example.com/">
        </wsdl:import>
  2. In Blueriq Encore, select the branch level in the navigation panel → 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), provide a ZIP file with all files needed. 
  3. Select the project for the import and you can choose whether to create a new module, or overwrite an existing one.
  4. The option 'Generate Domain' will automatically generate a domain model for you, based on the XSD schema referred to from the WSDL. When this button is checked, entities, attributes and relations are created based on the type definitions of 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 the elements from the XSD to your own domain (explained later). In general, it is advised to use a separate module for every WSDL in order to not mix the domain model for the web service with the domain model of your business.
  5. After you press the "Select operations" button, you can choose which operations should be imported. These operations originate from the WSDL. You should only import the operations that you need, as the created domain model will be smaller in that case.
  6. Now press the "Import" button and the WSDL should be imported. 

2. Mapping with Domain Model

Open your project and go the module which contains the web service. The module now has a Schema Set and a SOAP Service. These can be found in the navigation panel in the category named "Connectivity".

The Schema Set defines which entitiesattributes and relations are used by the web service (they map the XSD to the domain model). The SOAP Service defines which entities are sent (the message parts from the WSDL). You use these elements to define what entities, attributes and relation in your domain correspond to concepts in the WSDL and XSD.

If the domain model was generated in a new module, you can skip this step and go directly to Creating a Service Call.

2.1 Schema set editor

Open the Schema set and unfold the schema.

  1. You can choose which entity is mapped to this type in the 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. It is good to realize that in general entities that are based on elements in a XSD schema are not singleton.
  2. When choosing simple elements, you can choose to which attributes they map. Mapping relations works in a similar way.
  3. You can add validations to attributes. These are used when exposing Blueriq as a service, and are of no interest when calling another web service.



2.2 SOAP service editor

The SOAP service editor lets you configure the messages that you want to send to your web service and how you store messages received from the web service. For each operation, the web service needs two singleton entities: a Request entity and a Response entity, which will be used to create the message. When you generate the domain model, 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 generate the domain model, see the screenshot and below.

These entities are the only singletons in your domain if you generated your domain automatically. Conceptually, they represent the envelope of your message (remember 2. Simple Object Access Protocol (SOAP)). You can recognize these entities by their name. They are postfixed with either REQUEST or RESPONSE. These entities have no attributes and only one relation. In the code, Blueriq will start at this singleton, and work its way along the relation to all (indirectly) connected instances while creating the XML for the message. When sending a message, you have to make sure that this relation is set, otherwise the SOAP envelope will be empty.



3. Creating a Service Call

Now that the web service is configured, you might want to call it. To call a web service in Encore, you need to create a service call. Choose the AQ_SoapServiceClient from the list of available service calls (do not forget to import the BlueriqBasicModelling Library). Every operation in the WSDL needs its own service call.

More information about the parameters and exit evens in the AQ_SoapServiceClient can be found here.

4. Using the Web service

After you have created your service call, you can use it inside a flow. When the service is executed, it will read the data needed from the domain model, starting from the singleton request instance. After receiving an answer from the server, the web service will store the data as new instances, starting from the singleton response instance. If a data mapping is used, the mapping is executed after the domain module in the web service 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 web service is not correctly initiated. If the web service returns an error message, Blueriq runtime will show this error.

Usually you want to use a separate module for your web service. Read more about this in 7. Modules and Data Mapping

  • No labels

2 Comments

  1. Ter informatie: ik liep tegen een probleem aan dat ik een wsdl had geimporteerd (met daarin verschillende services en bindings, die ik handmatig uit de wsdl had gehaald omdat de blueriq import maar met één port en binding overweg kan).

    Vervolgens werd hiervan perfect een datamodel gegenereerd, maar bij het aanroepen van de service waar ik netjes een response kreeg, werd er verder in Blueriq niets in het datamodel gevuld.

    Dit kwam uiteindelijk doordat de response een andere envelop tag had (xmlns:soap="http://www.w3.org/2003/05/soap-envelope" ) die niet matchte met de request envelop tag die ik opstuurde (xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ), en dit kwam uiteindelijk omdat ik de verkeerde port/binding had gehaald uit de oorspronkelijke wsdl (de soap 1.2 versie). Toen ik de 1.2 versie als port/binding gebruikte voor importeren in Blueriq werd de response wel netjes naar het datamodel gemapped.

     

     

    1. Unknown User (m.schadd)

      Thanks for the hint, I have updated this page and the web service datasheet.