HTTP tutorial - Web services

Web services are based on standard protocols, with which information and commands are transmitted. The implementation can be created using SOAP (Simple Object Access Protocol).

Note: SOAP is a protocol standard that enables the exchange of data between different systems that are connected to each other via a network. The messages are exchanged in a uniform XML format and require:

  • SOAP envelope (comparable with digital envelope),

  • SOAP header (optional, contains meta data),

  • SOAP body (user data with information to be transmitted).

The SOAP standards exist in versions 1.1 (2001) and 1.2 (2003), whereby only 1.2 is natively supported in Lobster Integration (the older version can also be used with a workaround SOAP11). For more information, see the specifications and a good overview on Wikipedia. Useful information can also be found in the Lobster online help.


Lobster Integration functions both as a web service endpoint and as a client. In order to test a web service and, if necessary, also to analyse errors in the transmission, we recommend Soap UI as a tool.

Lobster Integration as SOAP web service


To do this, use the already existing profile Lobster_Tutorial_HTTP_calculator_xml, which processes XML to build a web service. In phase 1, activate the option Publish as SOAP web service and set the Type of WSDL creation to WSDL based on destination tree.


images/download/attachments/137306108/1590-version-1-modificationdate-1686900124592-api-v2.png


After saving the changes, you can call http://<Server>/dw/Request/calculator_xml?wsdl to retrieve the associated WSDL and use it to create a new SoapUI project in the SoapUI application.


images/download/attachments/137306108/test_soap_1-version-1-modificationdate-1686898034243-api-v2.png


In the project browser, you can open a new request window by clicking on "Request 1". This contains a request area, in which the complete SOAP structure with envelope, header and body, if applicable, is displayed. Now enter the values for the parameters OP1, OP2 and OPR and send the request via the green arrow.


images/download/attachments/137306108/test_soap-version-1-modificationdate-1686898034254-api-v2.png


The answer is limited to a simple <RESULT>7.0</RESULT>. The SOAP structure with the envelope element, header and body and the namespaces is missing here. You can build this structure from the adaptation of the target structure and via the XMLNoTemplateUnit. To do this, you must create an Envelope node in the target structure and two nodes below it for Header and Body, into which you push the already existing target node. Pay attention to the assignment of the namespaces.


images/download/attachments/137306108/image-2023-6-15_11-3-0-version-1-modificationdate-1686900124606-api-v2.png

Lobster Integration as SOAP client


To call an external web service via the Lobster Integration, three possibilities are described below.

Web service call in phase 6


You want to make a request against a web service with any input data? In phase 3, these are mapped into a suitable SOAP output structure and then transferred to the web service. A detailed description of how to generate and submit such a request can be found in our online help.

In order to further process the response of the web service, activate the option Pass on HTTP response as message in the HTTP Response and create a new profile that receives the response and, if necessary, further processes the data.


images/download/attachments/137306108/image-2023-6-15_10-56-26-version-1-modificationdate-1686900124617-api-v2.png

Note: In phase 3, you can use the wizard to create a WSDL for the query and use it. Using the Input Agent, complex source structures such as SOAP can be created by first selecting the time-driven Input Agent HTTP and then, as described for Cron-HTTP web services, specifying the WSDL and using it to create an source structure. Then change the input path to Message.

Web service via time-driven Input Agent HTTP


Data can also be queried on the input side from a web service. If necessary, you can process the result further in phase 3. You will find a detailed description in our online help.

Web service calls in mapping


If you need building data from an external web service within the mapping, the function call SOAP-WebService is available. You can find a description of how to call web service methods using functions in our online help.

If you want to process complex data from a web service response in phase 3, you can use the function trigger profile(). To do this, create your own time-driven profile that requests and, if necessary, transforms the data. The response is made available to you with the help of the function.

Web service via SOAP 1.1


As already mentioned above, Lobster Integration natively only supports SOAP web services in version 1.2. This procedure also works for WSDL (< version 1.2), but the wizard does not support the WSDL query. If you receive an error when addressing a web service via the WSDL, you can most likely assume that an old version is being used here.

Basically, the WSDL wizard in Lobster Integration is used to create the appropriate structures for request or response.

Alternatively, this can also be achieved with external tools, such as SOAP-UI:


  • Create a new SOAP project.

  • Import the WSDL.

  • Execute a test request with the desired method.

  • Result: Complete request as XML and corresponding response structure.

  • Create a new file from the content of the request.

  • Use file analysis in phase 3 to create the source or target structure.

  • Alternatively, you can insert the file in the cron Input Agent via the request window.

  • If necessary, the namespaces for SOAP 1.1 must be assigned in phase 3.

  • Value for SOAP action header for version 1.1 must be stored in phase 1 - "Adapt HTTP header" - new entry "SOAPAction". You can get this from the SoapUI programme in the display area of the request under the tab "raw".