Monday, August 30, 2021

OIC - send Binary object as rest response

UseCase: Here, we will send .JPG object as input using rest trigger and fetch the file using FTP protocol and send as Rest binary response.

Note: we can also choose document, text or png type or other media types.


Implementations steps:

Step1: Take a rest trigger and configure. 

Verb: Get.

Add and review parameters for this endpoint checked

Configure this endpoint to trceive the response checked


Step2: Add Query paramter as Object Name


Step3: select the response payload format as Binary and choose media type as per requirement. Here, i take image/jpeg. 


Step4: Download the file using FTP and map the input object name.



Step5: Add the download response (file reference) to rest response stream reference.


The Integration looks as below:


Open the endpoint url with object name in the browser.


You can see the object in the browser.



Saturday, August 28, 2021

OIC - Search Data from CSV file

Usecase: Here, I will show you how you can search employee information from a CSV file using empid.

High level steps:

  • Add rest configure to fetch emp details based on id
  • Read csv file using FTP connection
  • Map the searching logic to show in rest response.

Implementation:

Step1: Add an App driven orchestratation integration style and add a rest connection and configure id template param and emp details as response.




Step2: Add FTP connection and read the file and use a sample csv file.



Step3: Map the fields as below:

Take XSLT view and add for each on top of Email and map for each source Emp.
Then add if block inside for each and add the condition csv file empid = template id
Map all the fields.


XSLT code view will be like that:

Now the integration flow looks like below


Step4: Add the tracking and save and activate and test


CSV file contents:





Friday, August 27, 2021

OIC - Business identifiers

Introduction:
  • Business Identifiers helps to track the messages from monitoring dashboard very easily. 
  • Suppose you are subscribing an event - supplier details from ERP and you want to track the meseages based on the unique supplier id or POid that you can achieve using this feature.
  • Without enabling the tracking or business fields, you can not activate the integration.
  • Max 3 identifiers can be assigned during design time. 
    • One is primary identifier. 
    • Others two are secondary or business identifiers.
  • One error sign will be showing in the integration untill you add the tracking fields.

Add tracking and monitor:

Step1: Whether you have a soap or rest triggerd service, go to the actions and tracking and add the 3 fields, Here i added empid as primary and ename and dept fields as secondary fields.


Step2: Go to the monitoring and integrations. Empid will be added as primary identifier and ename and dept will be added in the business identifiers



Tuesday, August 24, 2021

OIC - Using Stage file to encrypt and decrypt files.

Use Case: Here, We will download a csv file using FTP connection and encrypt the file using Stage action and then write the file using FTP connection and then read the encrypted the file using FTP connection and decrypt the file using Stage and write again to file location using FTP.

Implementation steps:

Step1: First We must have imported the PGP private and public keys to settings certificates.

https://soalicious.blogspot.com/2021/08/oic-import-pgp-keys-to-use-in-stage.html

Step2: Download the file using FTP connection.


Step3: Encrypt the file using PGP public key using Stage. Provide folllwing details:

File reference : Downloaded file response ref
File Name: Any name of the encrypted file.
Output Directory: logical directory like /writeEncrypt
PGP key to encrypt: public key

Step4: Write the file to a location and map the stage encrypted response file ref to write file reference.




Step5: Read the file using FTP connection.


Step6: Drag and drop a Stage and decrypt the file. Provide the following details:

File Reference: Read file reference
File Name: any name for decryption.
Output Directory: logical one like /writeDecrypt
PGP key to decrypt: private key



Step7: Write the file using FTP and map the decrypted file response reference to write file reference.



The Integration flow will look like below:


Source CSV file/Decrypted file:


Encrypted file:




OIC - Import PGP keys to Setting Certificates to use in Stage file to encrypt and decrypt files.

Here I will show you how to import the PGP keys in settings Certificate section which will be later on used in Stage file for encrypting and decrypring files.

Import steps:

Public Key is used for Encryption and Private Key for decryption. In order to use encrypt/decrypt files we have to upload PGP keys in OIC.

To upload PGP Keys:

Step1: From OIC Home page→ Settings → Certificates page. Click Upload at the top of the page.

Step2: In the Upload Certificate dialog box, select the certificate type. Each certificate type enables Oracle Integration Cloud to connect with external services. 

PGP: Use this option for bringing PGP Certificates.

Public Key:

Enter Alias Name and Description

Select Type as PGP

Select Category as Public

Select PGP File, Click Browse and select the public key file to be uploaded

Select ASCII-Armor Encryption Format

Select Cipher Algorithm

Click Upload.



Private key:

Enter Alias Name and Description

Select Type as PGP

Select Category as Private

Select PGP File, Click Browse and select the private key file to be uploaded

Enter the PGP Private Key Password of the private key being imported.

Click Upload.



For more details of oic certificate management, follow my below blog:

OIC - Decrypt file using FTP download operation and read reference in stage activity

Use Case: Here, we will download (with decrypt) an encrypyed csv file without schema option  and then read file reference using stage read entire file option.

Implementation steps:

Step1: First create FTP connection following below blog:

https://soalicious.blogspot.com/2021/08/oic-create-sftp-connection-with-pgp.html

Step2: Create an orchestrated intwgration and drag and drop FTP connection and download the file with pgp encrypt option.


Step3: add the stage activity and choose the read the entire file option and provide the file reference from download response object.


Step4: provide the csv sample file for reading the reference.


Now the integration flow will like as below:

Save and test.

Encrypted csv file:



From Monitoring - view activity stream:



OIC - Encrypt and Decrypt using FTP adapter and PGP

Use Case: Here, we will first read a csv file and then encrypt the file (with Write) and then read the encrypted file and decrypt the file(with Write).

Implementation steps:

Step1: Create a FTP connection using PGP keys. Follow below blog:

https://soalicious.blogspot.com/2021/08/oic-create-sftp-connection-with-pgp.html

Step2: Create a scheduled orchestrated integration and drag and drop FTP connection and configure with read operation with input directory and filename details and provide a CSV file as schema reference.


Step3: drag and drop FTP connection and Write with output directory and filename and select PGP encryption option.


Step4: map the read file details to write fields.


Step5: drag and drop FTP server and read the encrypted file with inpit directory and file name details.


Step6: map the write file fields to read encrypted file fields.


Step7: Drag and drop FTP with Write operation and select Perform PGP Decryption option as below.


Step8: map the file fields


Step9: add tracking and now the integration will like as below. Save it and test.


Input CSV file:


Encrypted file:


Decrypted file:



Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...