Boomi

Develop a Synchronous Soap API

In this blog, we will develop a synchronous soap API.

In this Use case, 

  • We will expose soap which takes employee id as request.
  • We will retrieve employee data from database using employee id.
  • Then, we will send employee data as response.

Let us begin with the steps.

Step 1: Log on to Boomi platform (https://platform.boomi.com/) with required credentials i.e Email Address and Password.

IMG_256

Step 2: Once logged into Boomi platform, we will be able to view Home page.

IMG_256

Step 3: Now, click on Services followed by Integration. We will see the Build page. Click on New.

IMG_256

IMG_256

Step 4: Once, clicked on New, we will be able to see three fields i.e.Type, Component Name and Folder.

IMG_256

  • Select Type as process as we are building a process. Component Name and Folder can be given based on your choice (i.e which name to be given and where do we want to create the process). Click on create.

Step 5: We see that the process gets created with a start shape which is configured with AS2 Shared Server by default.

IMG_256

Step 6: Select the start shape and choose Web Services server from drop down in connector tab and click on “+” to add new operation.

Screenshot (142)

Step 7: Give a relevant name to the operation and configure the following.

  • Operation Type: We have to choose field based on the operation which we are going to perform. In this case, we are developing a service to display the welcome message. Therefore, Operation would be Create.

 

  • Object: It can be given any name based on the operation. Here, we are giving it as Welcome.

 

  • Expected Input Type: We have to choose input based on the profile we want to add i.e (XML, JSON etc). Here, we are considering Expected Input Type as Single XML Object as request profile is in XML format.

IMG_256

  • Request Profile: To choose the request profile, click + and give it a relevant name. Choose import

IMG_256

 

  • Once, clicked on import we will have to choose input file from the location where file is saved. Click Next and Finish

IMG_256

IMG_256

IMG_256

 

  • We see that the request profile is loaded successfully. Click Finish, Save and Close.

IMG_256

IMG_256

  • Click save and close.

IMG_256

Welcomereq.xml file looks like:

<?xml version=”1.0″ encoding=”UTF-8″?>

<class>

<id>201</id>

</class>



  • Response Output Type: We have to choose the output based on how the data should be represented as response. Here, we are expecting the output to be in XML format. Therefore, we are considering Response Output Type to be as a single XML object as response would be in XML Format.

IMG_256

 

  • Response Profile: To choose the response profile, click + and give it a relevant name. Choose import.

IMG_256

 

  • Once, clicked on import we will have to choose output file from the location where file is saved. Click Next and Finish.

IMG_256

IMG_256

IMG_256

 

  • We see that the response profile is loaded successfully. Click Finish, Save and Close.

IMG_256

IMG_256

  • Click save and close.

IMG_256

  • Post adding Request and Response profiles, the operation looks like

IMG_256

  • Welcomeres.xml file looks like

<?xml version=”1.0″ encoding=”UTF-8″?>

<class>

<empid>201</empid>

<empname>Smith</empname>

<country>Australia</country>

<age>30</age>

<salary>10000</salary>

</class>

  • Click save and close.

Step 8: We will create a table in the database using oracle database.

 

  • Open SQL plus and connect as below:


Screenshot (143)

 

  • Create a table with name “employee” as follows:

Screenshot (144)

 

  • Command: 

CREATE TABLE EMPLOYE (EMPID INTEGER, EMPNAME VARCHAR2(100), COUNTRY VARCHAR2(100),AGE INTEGER, SALARY VARCHAR2(20));

 

  • Insert values into table as follows: 

Screenshot (145)

 

  • COMMAND: 

INSERT INTO EMPLOYE VALUES (101,’SMITH’,’AUSTRALIA’,31,10000);

INSERT INTO EMPLOYE VALUES (102,’KOHLI’,’INDIA’,30,20000);

INSERT INTO EMPLOYE VALUES (103,’WILLIAMSOM’,’NEW ZEALAND’,30,30000);

INSERT INTO EMPLOYE VALUES (104,’MORGAN’,’ENGLAND’,34,40000);

Step 9: Search for database shape in search pallet. Drag and drop the it after Web Services Server connector.

 

  • Choose the action as Get and click on “+” to add a new database connection.

Screenshot (148)

Here we have to configure:

  • Driver type: It is the type of the driver we are using. In our case it is Oracle. Select Oracle from dropdown.

Screenshot (149)

 

  • User name: It is the Username of our database. Here it is SYSTEM.
  • Password: Give the password of the database.

 

Screenshot (150)

 

  • Host:  It is the address of the host. Localhost in our case.
  • Port: Port number of the database. In our case it is 1521.
  • Database Name: It is the name of the database. Here it is “XE”.

Screenshot (151)

 

  • Click on save and close.

Step 10: Click on “+” to add a new operation as below:

Screenshot (284)

 

  • Click on “+” to add a new profile.

Screenshot (153)

 

  • Click on Fields and add multiple fields as below:

Screenshot (154)

 

  • Select 5 and click on ok.

Screenshot (155)



  • Click on each field to rename as follows:

Screenshot (156)

 

  • Expand parameters tab and click on add new parameter.

Screenshot (157)

 

  • Rename parameter and select number from the datatype drop down.

Screenshot (158)  

 

  • Now we have to write a SQL statement to retrieve data from database. To write a query click on Statement as follows:

Screenshot (161)

 

 

  • Add the query in the SQL script tab as follows:

Screenshot (162)

 

  • STATEMENT:
  • SELECT * FROM SYSTEM.EMPLOYE WHERE EMPID=?

 

  • Here we are getting all fields from employee table using empid. Here “?” indicates the dynamic parameter.

 

  • Click on save and close.



  • Click on parameters to add a parameter.

Screenshot (285)

 

  • Click on “+” to add a parameter.

Screenshot (160)

 

  • Click on input tab and select parameter ad click ok.

Screenshot (163)

 

  • Click on Type tab and select profile element and click ok.

Screenshot (164)

  • Click on profile type and select XML from drop down.

Screenshot (165)

 

  • Click on profile and select welcome soap response profile which we created early.

 

Screenshot (166)

 

  • Click on element and choose empid from drop down and click ok.

 

Screenshot (168)

 

  • Close the connector by clicking ok.

Screenshot (169)

Step 11:  Search for Map shape in search pallet. Drag and drop the shape onto process canvas and place it after database connector. Click on “+”.

Screenshot (70)

  • Click on choose in map source 

Screenshot (170)

 

  • Select the database profile we have created earlier and click ok.

Screenshot (286)



  • Click on choose in the map destination.

Screenshot (172)

 

  • Click on xml from drop down and select welcome soap response profile which we have created earlier and click ok.

Screenshot (173)

Step 12: Provide one to one mapping as follows and click on save and close.

Screenshot (174)

Step 13: Search for Return documents shape in search pallet. Drag and drop the shape onto process canvas and place it after map shape.

Screenshot (287)

Step 14: Click on create packaged component to package.

Screenshot (287)

 

  • Click on add next details and Click Ok.

Screenshot (176)

 

Step 15: Click on deploy to deploy the process.

Screenshot (177)

 

  • Select the environment and click on next.

Screenshot (178)



  • Click on next and click Deploy.

Screenshot (180)

Screenshot (181)

Step 16: Click on manage and go to atom management and click on the atom which we have used to deploy the process.

Screenshot (183)

 

Screenshot (184)

 

  • Click on shared web server.

Screenshot (198)



Screenshot (199)

 

  • Click on API type and select intermediate and click on save.

Screenshot (188)

  • Click on restart plugin.

Screenshot (200)

Step 17: Click on configure in start shape and go to the operation.

Screenshot (190)

  • Copy the Soap URL address.

Screenshot (191)

Step 18: Open soap UI and paste this URL in the initial WSDL tab and click ok.

Screenshot (194)



  • Expand the Create EmpId and click on request 1

Screenshot (201)

  • Give empid as input between empId tags and click on execute as follows:

Screenshot (202)

Step 19: We see that the data has retrieved from the database.

Screenshot (203)

 

 

Author

TGH Software Solutions Pvt. Ltd.

Leave a comment

Your email address will not be published. Required fields are marked *