Tuesday, 5 May 2020

Import JavaScript libraries / jar to OIC Integration and build custom function

Summary:
In this blog i'm going to explain the procedure to import JavaScript libraries into the Oracle Integration Cloud (OIC) - Integrations and build custom solutions.

Use Case:
Sometime in projects there would be requirement for which there won't be any out of the box solution provided in OIC, So in such cases we can make use of java script libraries and import them to OIC and build custom solutions.

In this blog i'm going to show you how to achieve AES encryption using JavaScript libraries in OIC as an example to show library import.


Assumption:
1. OIC instance is already configured in Oracle Cloud and the environment should be up and running


Let's begin by first creating a jar containing AES JavaScript libraries and the JavaScript file containing our custom function

Steps to create jar containing JavaScript files:
1. Import and save below mentioned JavaScript libraries into your local computer
     i. AES.js
    ii. crypto-js.min.js
   iii. enc-utf8.min.js


 NOTE: Highlighted libraries are to be imported from their source or from GitHub repository.

2. As shown in above screenshot we need to write our custom JavaScript function in the file 'encryptAndDecryptMessage.js' as shown below as per the OIC library coding specification

   

3. Post writing custom function we may need to zip all 4 .js files (3 js library files and 1 custom js function file) as a jar using below command

         jar -cvf EncryptDecrypt.jar *.js

4.  EncryptDecrypt.jar will now be created in your local computer


5.  Login to OIC Integrations instance and then click on Libraries and then click on register
     



Select below option before saving the JavaScript function
    

   


5. Now goto any of your integrations and the custom function created in earlier steps will now be listed under user functions
    


   

Hope this blog helped you with the procedure to import JavaScript libraries or to create custom functions in OIC .

Let me know in comments section for any queries.


Know Yourself Blogs...

Saturday, 2 May 2020

Import OIC Integration or .iar file into the JDeveloper IDE

Summary:
In this blog i'm going to explain the procedure to import Oracle Integration Cloud (OIC) - Integrations project or .iar file into the Oracle JDeveloper IDE.

Importing .iar file into JDeveloper will be useful for someone who has extensive experience working in JDeveloper IDE especially for XSLT coding and someone who is not comfortable working on XSLT in notepad or on OIC browser based IDE for mappings.

Assumption:
1. OIC instance already configured in Oracle Cloud and the environment should be up and running
2. Integration is already built and available for export. If not refer here to create one.
3. JDeveloper IDE is already installed in computer.

Steps:
1. Export any Integration from OIC instance with the help of below navigation.
      i.   Click on Designer from the Integrations home menu
      ii.  Click on Integrations from the Designer menu
      iii.  Select the Integration to be exported and then click on export from the menu as shown below
 
.iar file will now be downloaded to your local computer.

2. Open JDeveloper and create one Service bus application as shown below
   

3. Now create one service bus project within the application created in earlier step as shown below


4.
Now import the .iar file downloaded earlier in to the service bus project using below navigation
File-> Import -> Service bus resources



5. In the next window click on magnifier lens icon in front of zip source and select the .iar file as shown below
Click Next and then Finish.

6. The .iar file will now be imported into the JDeveloper IDE as shown below. 


Hope this blog helped you with importing .iar file or Integrations into the Oracle JDeveloper IDE. 

Let me know in comments section for any queries.


Know Yourself Blogs...

Create REST Web Service using Oracle Integration Cloud (OIC) - Integrations

Summary:
In this blog i'm going to explain the procedure to create REST web service in Oracle Integration Cloud (Integrations) which will be used to expose the integration as a web service to external consumers.

We are going to create a web service in this blog which will accept first name and second name of user and output will be greeting as described below

INPUT      :  <first name> 
                    <second name>
OUTPUT  :  Hello <first name  second name>

HTTP Method: POST

Assumption:
1. OIC instance already configured in Oracle Cloud and the environment should be up and running
2. Login user has at- least developer privilege for OIC.


Let's begin by first creating a Trigger REST connection

Steps to Create REST Connection as Trigger:
1. Goto Connections page in OIC integration with the help of below navigation.
      a.  Login to OIC instance   (e.g:  <host:port>/ic/home/)
      b.  Click on Integrations from the home menu (i.e. if landed on to OIC homepage post login)
      c.  Click on Designer from the integration menu
      c.  Click on Connection from the Designer menu
      d.  Click on Create button as shown below


2. Search for REST in the search bar and select the REST adapter or connection as shown below
  

3. Give the connection name, identifier, role and description in the window for REST connection creation as shown below and then click on 'create' button.

   


 Below are few points to be noted about the connection parameters
         i. Name: 
             This can be any name suitable for project or any project specific identifier.
         ii. Identifier: 
             This field value is auto generated by OIC and is used as a reference for integration while consuming it during integration development or could be used for uniquely identifying the connection while using OIC API's for connections.
         iii. Role: 
            Trigger is used when the connection is used as entry point for integration or for the external consumers to consume the service built. 
            Invoke is used if the integration consuming this connection want to communicate with external SOAP web services or references.
            Trigger and Invoke is used if the connection is used both as a entry point as well as a reference for invoking SOAP web services.

4. In next screen click on 'Test' and 'Save' button and then close the connection page
   

We have now successfully created REST connection as Trigger to consume in our integration. 

Let's now build our web service

Steps to Create Integration to expose as a REST web service:
1. Goto Connections page in OIC integration with the help of below navigation.
      i.   Click on Designer from the integration menu
      ii.  Click on Integration from the Designer menu
      iii.  Click on Create button as shown below

2. In the pop up window fill the Name for integration, Description, Version, Keyword and Package details if any and then click on Create button  

3. Click on the '+' icon at the top of screen and select the trigger connection which we created in earlier steps
    


4. In the pop up screen give some meaningful name for the connection and then click on next 


5. Fill the details for 'resource URI', select http method to POST under action, select check boxes to configure request and response payload for the endpoint and then click on Next button
   

6. Select the request payload format to JSON from the list of values/ drop down and then click on inline as shown below
   

7. Paste the sample JSON request payload as shown below and click on OK button
   

8.  Select the response payload format to JSON from the list of values/ drop down and then click on inline as shown below
   

9. Paste the sample JSON response payload as shown below and click on OK button

10. Then keep everything to default and click next -> done.
11. The flow will look similar to as shown in below screenshot 
    

12. Click on 'Map' activity in the flow and map output as concatenation of Hello, First name and Second Name
   


13. Update Tracking variable and Activate the integration. 
    Updating tracking variable and activating integration is described here
   
14. Copy the resource URL and test the service from Postman or any of your preferred testing tool and validate the service built as shown below



Hope this blog helped you in building REST Web Service using Oracle Integration Cloud. 

Let me know in comments section for any queries.


Know Yourself Blogs...

Friday, 1 May 2020

Create SOAP Web Service using Oracle Integration Cloud (OIC) - Integrations

Summary:
In this blog i'm going to explain the procedure to create SOAP web service using Oracle Integration Cloud - Integrations (ICS). In practical scenario such SOAP based web services are useful if the underlying interfaces need to be exposed as a service to consumers over http, i.e. for example if the database table or stored procedure or function need to be exposed as a service then this could be achieved using Integrations.

We are going to create a SOAP web service in this blog which will accept first name and second name of user and output will be greeting as described below

INPUT      :  <first name> 
                    <second name>
OUTPUT  :  Hello <first name  second name>


Assumption:
1. OIC instance already configured in Oracle Cloud and the environment should be up and running
2. Login user has at- least developer privilege for OIC.
3. SOAP trigger connection is already created and available. (Refer here for connection creation)


Steps:
1. Goto 'Integrations' page in Oracle Integration Cloud with the help of below navigation.
      a.  Login to OIC instance   (e.g:  <host:port>/ic/home/)
      b.  Click on Integrations from the home menu (i.e. if landed on to OIC homepage post login)
      c.  Click on 'Designer' from the menu
      d.  Click on 'Integrations' from the menu

2. Click on Create button on the right top corner of the screen as shown below
    


3. Select 'App Driven Orchestration' from the popup screen as shown below and then click on 'select' button
   


4. Give meaningful 'Name' for integration, 'Identifier' (auto populated by OIC), 'Version' (as per versioning need of project), 'Description' (In short summary of what integration does) and 'Package' (it is like to bundle all the integrations related to one module under one tree or package i.e. similar  to creating partition in Oracle SOA) as shown below

5. Click on the '+' icon at the top of screen and select the trigger connection which will be used to expose the integration as SOAP web service as shown below
   


6. In the pop up screen give some meaningful name for the connection and then click on next -> next -> Done
   

7. The flow will look similar to as shown in below screenshot 
    


8. Click on 'Map' activity in the flow and map output as concatenation of Hello, First name and Second Name
   


9. Click on the hamburger menu on the right top corner of the screen and select 'Tracking' as shown below
   


10. Map first name to tracking 1 and second name to tracking 2 variables as shown below  (Those variable are used as sensors for monitoring any transactions)
   
11. Click on save and close the Integration page.
12. Drag the toggle switch towards right in order to 'Activate' the integration
    

13. Click on 'Activate' button as shown below 


14. Wait for 10 seconds and refresh the integration layout. The WSDL URL for the web service is obtained by clicking on the icon as shown below
   

15. Copy the WSDL URL and test the service from SOAP UI or any of your preferred tool and validate the service built as shown below
    



Hope this blog helped you in building SOAP Web Service using Oracle Integration Cloud. 
Let me know in comments section for any queries.


Know Yourself Blogs...



Create SOAP connection as Trigger in Oracle Integration Cloud (OIC) - Integrations

Summary:
In this blog i'm going to explain the procedure to create SOAP connection in Oracle Integration Cloud (Integrations) which will be used as a trigger point or to expose the integration built as a web service to external consumers.

Assumption:
1. OIC instance already configured in Oracle Cloud and the environment should be up and running
2. Login user has at- least developer privilege for OIC.

Steps:
1. Goto Connections page in OIC integration with the help of below navigation.
      a.  Login to OIC instance   (e.g:  <host:port>/ic/home/)
      b.  Click on Integrations from the home menu (i.e. if landed on to OIC homepage post login)
      c.  Click on Connection from the integration menu
      d.  Click on Create button as shown below
 

2. Search for SOAP in the search bar and select the SOAP adapter or connection as shown below
  
3. Give the connection name, identifier, role and description in the window for SOAP connection creation as shown below and then click on 'create' button.

 Below are few points to be noted about the connection parameters
         1. Name: 
             This can be any name suitable for project or any project specific identifier.
         2. Identifier: 
             This field value is auto generated by OIC and is used as a reference for integration while consuming it during integration development or could be used for uniquely identifying the connection while using OIC API's for connections.
         3. Role: 
            Trigger is used when the connection is used as entry point for integration or for the external consumers to consume the service built. 
            Invoke is used if the integration consuming this connection want to communicate with external SOAP web services or references.
            Trigger and Invoke is used if the connection is used both as a entry point as well as a reference for invoking SOAP web services.

4. In next screen click on 'Configure Connectivity' under 'Connection Properties' as shown below
 

 5. Click on check box under 'Upload File' section and then click on 'upload' button to load the WSDL file from your local computer (or directly WSDL URL could be pasted in the 'Property value' if you want to consume any live WSDL URL i.e. with upload file check box unchecked)


By default 'Security' will be selected as username password token and the user role should have test access in order to test the service built using this connection.

Now the connection configure percentage will be at 75%.

6. Next click on 'Test' button at the top right corner of the screen and then click on 'Validate and Test' button from the pop up as shown below

7. Now the connection configure percentage will be 100% as shown shown. Next click on save button and then close.



Now the connection is ready to be consumed for building integrations and to expose it as a web service for the consumers.


Hope this blog helped you in configuring SOAP connection in OIC. Let me know in comments section for any queries.


Know Yourself Blogs...




Access Microsoft Outlook email using Outlook Version 2.0 API

Summary: This blog demonstrates the steps involved to access Microsoft Outlook email using Outlook Version 2.0 API's. Use Cas...