How to Create a Simple Subtraction Web Service in Oracle SOA
Here I`ll show you a step by step procedure to create a SOAP based Subtraction Web service in Oracle Jdeveloper.
Step 1: Create a SOA Project in Jdeveloper.
Here we can see the three columns called as swimlanes
- Exposed Services – Used for Inbound services
- External References – Used for Outbound services
- Components – Used to develop integrations also called as Workspace.
Step 2: Drag and Drop BEPL Process in to the Workspace
BEPL Process is used to implement internal functionality of the Web Service. This helps in receiving input from external web service, invoke a web service adapter, reply to the web service and performs many activities that are involved in implementing a web service.
Here we use No Service as the Template Type which will be discussed later.
Step 3: Now Drag and Drop SOAP Web service on to the Exposed Services Lane (To the Left of workspace)
Select the required WSDL file for the SOAP web service. Here we used “Subtraction.wsdl” as our source. You can create your own WSDLs file based on your requirement.
Step 4: Now link the SOAP web service with BEPL process by dragging the arrow symbol of SOAP web service on to the BEPL process. Select the Transaction as empty.
Step 5: Now Double click on the BEPL process for implementing Subtraction operation. Here you can see the SOAP web service on to the left/ right in the partner links lane and an activity flow in the Middle of the workspace.
Step 6: Drag and drop the Receive service.
This receive service helps us to receive data from any external web service to BPEL and by checking create instance helps in initiation of the BEPL Process.
And wire it to the SOAP web service, now it prompts with the Receive service properties
- Check the “Create Instance”
- As it is Receive service it has only Input parameters, now click on the icon in the input to create a local input variable as shown in Fig: 015.
Step 7: Drag and drop the Reply service.
This service helps to respond back to the web service from BPEL.
And wire it to the SOAP web service, now it prompts with the Reply service properties
- As it is Reply service it has only output parameters, now click on the icon in the input to create a local output variable sa shown in Fig: 019.
Step 8: Drag and drop Assign activity on to the workspace next to the Receive service. To Map the received input and response output as shown below.
Step 9: Implement Subtraction Operation in Assign Activity
- Double Click on the Assign Activity
- Expand the input in the Left side and output to the Right side
- Right click on the output variable (or) drag and drop the expression on the output variable and click on the expression.
- Double click on the input variables to add its XPATH to the expression and use functions to perform operations (here I used add function i.e., +)
Step 10: Now deploy the project on to SOA Server.