Thursday, June 29, 2023

OIC - Upload file to UCM using GenericSoapPort web service

Usecase: We will create a CSV file into stage and upload the base64 encoded file to UCM using GenericSoapPort webservice.

Request Payload format to upload to UCM:

<ns0:GenericRequest webKey="CS">
<ns0:Service  IdcService="CHECKIN_NEW">
<ns0:Document>
<ns0:Field name="dDocTitle">test.csv</ns0:Field>
<ns0:Field name="dDocType">Document</ns0:Field>
<ns0:Field name="dSecurityGroup">FAFusionImportExport</ns0:Field>
<ns0:Field name="dDocAccount">fin$/payables$/importExport$</ns0:Field>
<ns0:File href="test.csv" name="primaryFile">
<ns0:Contents>TmFtZSxJRCxBZ2UsRGVwdAp0ZXN0LDIsMjMsT1NQCg=</ns0:Contents>
</ns0:File>
</ns0:Document>
</ns0:Service>
</ns0:GenericRequest>

Note: we can also add dUser, dDocAuthor and other fields as required.

Detailed steps with Screenshots:

Create a soap connection with the below wsdl :

https://<erp_instance>:443/idcws/GenericSoapPort?wsdl



Integration flow:


Write a CSV file:









Call the SOAP adpater and configure:





Map the required details:



Go to UCM server and check the file:
https://<erp_instance>/cs



We can also check the file from below navigation:

Login erp instance >> tools >>File import and export >> search with file name and account details:



Friday, June 23, 2023

OIC - Download file from UCM using SOAP webservice | GenericSoapPort webservice

Usecase: Here, we will show you how to download files from UCM using GenericSoapPort  SOAP web service. 

  • Get the document id with dDocTitle or file title.
  • Get the file based on the fetched document id.
  • Write the file content to stage.
  • Read the file content.
  • Delete the file from UCM based on fetched documment id.

Soap webservice details:

https://<erp_instance>:443/idcws/GenericSoapPort?wsdl

Request payloads used:

Get the document id with dDocTitle:
<ns0:GenericRequest webKey="CS">
<ns0:Service  IdcService="GET_SEARCH_RESULTS">
<ns0:Document>
<ns0:Field name="QueryText">dDocTitle &lt;starts> `testUCMDownload`</ns0:Field>
</ns0:Document>
</ns0:Service>
</ns0:GenericRequest>

Get file with fetched document id:
<ns0:GenericRequest webKey="CS">
<ns0:Service  IdcService="GET_FILE">
<ns0:Document>
<ns0:Field name="dID">4419562</ns0:Field>
</ns0:Document>
</ns0:Service>
</ns0:GenericRequest>

DELETE the file from UCM:
<ns0:GenericRequest webKey="CS">
<ns0:Service  IdcService="DELETE_DOC">
<ns0:Document>
<ns0:Field name="dID">4419562</ns0:Field>
</ns0:Document>
</ns0:Service>
</ns0:GenericRequest>

Note: instead of dDocTitle , we can also use dDocName which is the UCM content ID.
dDocName &lt;substring> `UCMFA03374721`

Implementation Steps with screenshots:

Create SOAP connection:



Integration flow:


Assign the QueryText:
varString : "testUCMDownload"
varQueryText: concat("dDocTitle <starts> `",$varString,"`")


Call webservice to get doc id based on dDocTitle Query text.






Call webservice to get file based on fetched doc id.






Write the file to stage.






Read the file content.




Call webservice to delete the file from UCM based on fetched doc id:

OIC - Upload file to UCM | Download file from UCM

We can upload and download the files to/ from UCM using the following services:

  1. Download file from UCM using GenericSoapPort webservice
  2. Download file from UCM using ErpIntegrationService webservice
  3. Download file from UCM using ERP cloud adapter and ErpIntegration Service.
  4. Using rest services

To access content server:
https://<erp_pod_instane>:443/cs

Case1: To upload & download file to/from UCM using GenericSoapPort webservice: follow my below blogs:

Download From UCM

Upload file to UCM:


Case2: To upload and download file to/from UCM using ErpIntegrationService webservice:

Download from UCM:

Upload file to UCM:

Case3: To upload and download file to/from UCM using Oracle Cloud ERP Adapter:

Upload file to UCM:

Download file from UCM:

Case4: To upload and download file to/from UCM using Rest Api:

Upload file to UCM:

Download file from UCM:
TBD

Tuesday, June 20, 2023

OIC - While reading or writting a file from/to stage, getting translation to native failed. Element not completed

Usecase: Suppose we are reading or writting a file from/into a stage and getting the below error:

Translation Failure
Translation to native failed. Element not completed : 'Employee'.
The data does not conform to the NXSD schema. Please correct the problem.

Solution:
This error occured when we are reading /wrtting the file from/to stage, most cases we are not adding any header field names and later when we try to read/write it, we are mentioning the USE FIRST ROW AS COLUMN HEADERS AS CHECKED which was expecting header field names in the file.
  1.  Just uncheck this property - USE FIRST ROW AS COLUMN HEADERS and it will work.
  2.  Or add header field names explitcitly in the file.



Friday, June 16, 2023

OIC - How to call "upload as attachement REST integration" from another integration in Oracle Integration

Usecase: In my previous blogs, I have shown you how to upload single or multiple attachments in REST API. Here, I will show how to call that exposed REST API service from another integration.

For upload attachment in Rest API:

https://soalicious.blogspot.com/2023/06/oic-upload-attachment-in-rest-api.html

For upload multiple attachments in REST API:

https://soalicious.blogspot.com/2023/06/oic-upload-multiple-attachements-in.html


Logic steps:

  1. Create an OIC self REST invoke connection so that we can call the OIC rest upload attachment service.
  2. Confugure a rest trigger to get the employee details as json.
  3. Take a stage and write a file for example Employee.csv using sample CSV file and map the request employees to the csv file.
  4. Drag and drop the created OIC self connection and configure rest invoke with POST verb and resource URI of the upload attachment rest service. Take the request as multipart form-data.
  5. Map the stage file reference to attachement reference and provide content type as "text/CSV" and partname as filename of the stage write response.

Implementation steps with screenshots:

Create OIC self connection:


Integration flow:



Configure Rest Trigger





Stage to write a file:






Invoke rest upload attachment service






Notes: 
  • Content type should be mapped while invoking to Rest upload attachment integration. This case we have mapped as "text/CSV", otherwise you will get the error:  An error occurred while invoking the rest endpoint .[[Media type is null.]]. The 406 Not acceptable is an HTTP response statue code indicating that the client has requested a response using accept-headers that the server is unable to fulfill.

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...