This is a simple tutorial to try out SOAP service consumption in cloud integration flow.. We will perform a short exercise to go through how to use SOAP adapter using free public SOAP service which converts number to text.
https://www.dataaccess.com/webservicesserver/NumberConversion.wso
1. Check the SOAP service and it’s WSDL format.
WSDL defines the structure of the service containing field names. It could be said that it’s equivalent of metadata in Odata. To get WSDL file, add?WSDL in the end of URL and access in browser. Download it and save as file with an extension .wsdl. This file will be used later in the exercise.
https://www.dataaccess.com/webservicesserver/NumberConversion.wso?WSDL
To test how the service works, we can go into Postman web-application. It requires you to create a free account to use the application.
https://www.postman.com/cs-demo/public-soap-apis/request/rlue7u2/numbertowords?tab=body
As you can see, we are calling “NumberConversion” service in the URL and using Post method. Post means we are feeding an input and asking for information in return. In the Body part, you can see that we are feeding a number of 500 and expect to get the text of this number.
Once you click Send, you can see the response contains “five hundred” with return code 200(OK).
We will replicate this call in the integration flow.
2. Go to Integration Suite, create a package and add an integration flow.
Below is the end result once you finish. Each event is explained step by step below.
3. For easily test the flow, add a timer and set as run once.
4.Add Content Modifier from Transformation->Content Modifier and add to the next step.
Content Modifier allows you to add extra information on the incoming message header and body(equivalent to HTTP header and body, for example). We must feed the number 500 like we did on the postman in the body section therefore go to Message Body tab and paste the below body message.
<?xml version="1.0" encoding="utf-8"?>
<ns0:NumberToWords xmlns:ns0="http://www.dataaccess.com/webservicesserver/">
<ns0:ubiNum>500</ns0:ubiNum>
</ns0:NumberToWords>
5. From the top bar, choose icon for Call->External Call->Request Reply. Place inside the flow.
6. From the top bar, choose icon participant and choose Receiver. Place it outside the flow.
7. Drag an arrow from the Request Reply box and connect to the receiver outside the flow. Choose SOAP 1.x as the connection type.
Connect the previous Content Modifier with Request Reply box as well. Go to Connection tab and fill in the below information.
Address | https://www.dataaccess.com/webservicesserver/NumberConversion.wso |
Proxy type | Internet |
URL to WSDL | Upload the WSDL file downloaded in step1 |
Authentication | None |
*Please always use authentication for production environment. This is free public SOAP service for everyone to use hence no authentication is needed. OAuth2 authentication is the latest and recommended method and used widely.
8. Choose Persistence icon from the top bar and Data Strore Operations -> Write.
Place it inside the flow after Request Reply and connect using an arrow. Connect to the end event that comes after.
Click on the Write event and set the processing details as below.
9. Save the change and deploy the integration flow.
Check the data store from Monitor->Integrations and APIs from the left side pane. Go to Manage Data Store tile and find the output with your name.
Download the entry and the number 500 is converted to text “five hundred “.