We’ll demonstrate how we can use Integration Cloud Service(ICS) to expose SOAP API. In one of my blog I have showcased how to expose REST API.In this article, we will create an Orchestrated integration that will be exposed as a SOAP service.
Steps to achieve the use case
- Create DB Connection
- Create SOAP Connection
- Create Orchestrated Integration
- Test SOAP service
Let’s go ahead and achieve all the steps one by one
- Create DB Connection: DB connection will work as a Target point. Please check the blog how to create DB connection.
- Create SOAP Connection: SOAP connection will work as a Trigger point. Please check the blog how to create SOAP connection.
- Create Orchestrated Integration: Create an Orchestration integration using below steps:
- Click on Create button from Integration page and select Orchestration pattern from the dialog box
- Enter Below information and click on Create button
- Select Application event or business object radio button
- Enter Integration Name in What do you want to call your integration text box
- An Identifier would be picked up automatically from Integration name, however, we can update this
- Let the Version as it is
- Enter the description in What does this integration do box
- Leave the package box as it is
- Complete the SOAP wizard with some clicks Next -> Next -> Next -> Next – > Done. Once the SOAP wizard is complete, integration will look like below
- Enter below query then click Validate SQL Query button. Click Next -> Done button to complete the configuration wizard
select name from xx_employee_t where id=#userId
- Edit GetUserDetails map and map id -> userId
- Now let’s check if a user exists or not. To do so, drop the Switch activity below the DB adapter and configure if action. Put the condition, username is not blank
- Drop the map activity in the if block and map, name -> name
- Drop the Fault Return activity under the otherwise. A mapper will get automatically added between the otherwise and Fault Return
- Edit the newly added mapper and you will notice that fault object that was in the WSDL will be shown automatically. Put the expression ‘User doesn’t exist‘ in the reason
Now the integration is complete. Activate the integration that will provide one WSDL once the integration is activated successfully.
Let’s test the integration using SOAP UI tool.
TEST-1 : Send valid id, hit the request and notice the valid response
TEST-2 : Send invalid id, hit the request and notice fault will occur