Profile as SOAP Web Service (dynamic response)
This section explains how to create a profile that is acting as a SOAP web service and sends a dynamic response back to the client that called this web service.
Please import the following profile and set it to active: Profile-Profile_as_web_service_dynamic_response.pak
Phase 1
Open the profile and navigate to phase 1. There you can see the event-driven Input Agent of type HTTP.
(1) Specifies the URL under which your web service can be accessed. So here https://<URL/IP Integration Server>/dw/Request/addition_web_service
(2) Use option POST.
(3) Must be set.
(4) Use this value. This has the effect that the WSDL file is generated on the basis of the source and target structure. In addition, the response of the web service is then dynamic, i.e. based on the data of the target tree (more on this later). More details in section WSDL File .
(5) Must be set.
(6) This option must be set so that we can generate the response for the web service from the target tree (more on this later).
Phase 2
The document type here must be XML (is set in the Main Settings), as we want to process incoming SOAP XML messages.
(7) Set this checkbox.
(8) Necessary for parsing the received XML file into the source structure. See section Phase 3 below and section XML (Document Type).
(9) Use the value V3. Note: The XML parser V4 can also be used, but this is not necessary.
Phase 3
Now switch to phase 3. We want to create a simple calculator web service that adds two numbers and returns the result in the response.
To do this, we first need an XML source structure that holds the two numbers to be added in the fields intA and intB in node Add, see also (8). Note: Note the match codes of the fields and nodes that are required for XML source structures.
In the target structure, we simply create the node AddResult with field result, on which we use a function to add the values of the source structure fields intA and intB.
Integration Unit
Select the XMLNoTemplateUnit and enter the value AddResult in parameter Root node name. You can ignore all other parameters.
Response Route
Insert a Response Route Custom Class with class DefaultWebServiceResponse and set the content to Output of IU.
This Response Route provides the XML response of the web service. See items (4) and (6), target structure and Integration Unit.
Note: The response has the encoding UTF-8.
WSDL File
Now we can look at the WSDL file of the web service. The WSDL file is created automatically by Lobster_data.
To do this, enter the following URL in the browser. This is the same URL that is used to call the web service (1), but the suffix ?wsdl is added at the end.
https://<URL/IP Integration Server>/dw/Request/addition_web_service?wsdl |
Below you will find further information on the WSDL file, which you can ignore for the time being.
Calling the Web Service
We will show you how to call such a web service in sections Calling SOAP Web Service with Profile in Input Agent, Calling SOAP Web Service with Profile in Function and Calling SOAP Web Service with Profile in Response Route.