In this blog we will test the Integration which we have developed in previous blog
Prerequisite : SoapUI Tool
Lets see the testing steps in detail :
- Activate the Integration and open the URL which get generated after integration activation.
- Copy the Endpoint URL
- Advertisement -
- Open SoapUI Tool and create a REST Project. Paste the copied Endpoint URL.
- Select Method = Post and Media Type =application/xml and then click 🔓 Auth to add basic Authorization
- Select Add New Authorization and select Type = Basic and then click Ok.
- Enter your OIC Instance User Id and Password in Username and Password box respectively.
- Advertisement -
- Now Download the Request Payload from below link and paste the same in SoapUI Request Box
- Hit the Run button and you will see the respective Output in right side response window.
We have tested the Integration successfully. It is working as of our usecase.
Now lets check our Error Handling Scenario. We will intentionally made the Service to get Error Out by passing some random data as Input and then check whether the Error Handling is working properly or not .
Lets first check "Global Fault Handler" :
- Advertisement -
Now Hit the Run Button. The service will get error out because "XYZ" is a STRING not an INTEGER. So Addition operation got failed
i.e. XYZ + 5 = ERROR
- Now to check where the service exactly failed, Lets see its Flow Instance in OIC. Open the OIC Instance --> Go to Monitoring Window--> select Tracking and then open the failed Instance.
Once the Flow get opened you can see the service get failed at Addition
Operation Execution. This error get handled by "GLOBAL FAULT HANDLER"
because it is not inside any scope and the Flow execution will stop.
If you click on Global Fault, you can see its flow. It handled the error and
sent email notification.
Now check your email, You have got one Error Email Notification similar like
below
- Advertisement -
Now lets first check "Scope Fault Handler" :
- Change the Input XML Data of
Element i.e. in-place of " 4 " passXYZ (a string in-place of integer)
*Make sure you have removed XYZ and passing some Integer as input in element which we have configured above to test Global Fault Handler.
(check below image for you reference)
Hit the Run Button. This time you can see output in SoapUI response window because the error handled by Scope Fault Handler and execution of Flow continues without getting stopped.
Addition OutPut = 4+5 = 9
Multiplication Output :
- 1st Iteration : 41*25 = 1025
- 2nd Iteration : XYZ*90= ERROR Out -- >handled by Scope Fault Handler -- >Move for next Iteration )
- 3rd Iteration : 4*5= 20
Total Multiplication Value = 41*25+4*5 = 1045 (You can see the same value as multiplication output ,check below image)
- Lets see its Flow Instance in OIC. Open the OIC Instance --> Go to Monitoring Window--> select Tracking and then open the recent Instance.
Now check your email, You have got one Error Email Notification from Scope Fault Handler similar like below :
That's it. I hope this blog helped you to understand basic Error Handling in OIC.
Thank You ! & Stay Happy :)
- Advertisement -
Excellent.. Can you please let me know, how to process error records. I mean out of 100 records if 20 records got error out, then how to process these records
ReplyDeleteyou can store that 20 records(ex-inside a database or FTP server) and later can reprocess these records invoking same integration. You can also edit the data(of these 20 records) once they get store in database or FTP
DeleteDisclaimer :Dear this is just a suggestion, you can use different approach also for reprocessing. Its totally depends on your requirement and resource availability :)
Excellent explanation.Very deatil with POC .Many Thanks
ReplyDeleteThanks Uday 😊
DeleteExcellent post on Exception handling in OIC.
ReplyDeleteThank You :)
Deletebro after uploading my request payload, it is showing nothing in the output in the right side for me.Can u tell me what am i doing wrong
ReplyDeletebro! share me the screenshot at "thekabiryadav@outlook.com"
Delete