SOAP Services for performing file operations in UCM
SOAP Services for performing file operations in UCM

 1,418 total views

In this article we will look into SOAP service used to upload, search, download and delete files from UCM. We will have to base64 encode while uploading the file and base64 decode the file after downloading it as that’s the way how SOAP services work. We will look into how to base64 decode and encode manually and using apis at the end of the article.

Want to learn Fusion Technical tools? Checkout this article

Here is the WSDL that we are going to use to perform these operations of Check in/Search/Download and Delete.

https://{host}/idcws/GenericSoapPort?wsdl

Sample Link:

https://abcd-test.fa.us6.oraclecloud.com/idcws/GenericSoapPort?WSDL

Once we have he WSDL link, we can use either SOAPUI or Postman tools to consume this WSDL and create sample payloads. I am going to demonstrate using SOAPUI today.

let’s get started:

Open SOAP UI and click on File > New SOAP Project

SOAPUI tool New SOAP Service lading page for SOAP services in Fusion HCM Oracle HCM Cloud
SOAPUI New SOAP Project Landing page

Give some name to the project and add the WSDL link in the “Initial WSDL
It loads the operations and requests in the WSDL onto SOAPUI tool.

You can expand the Operation to see the requests. If you click on the Request button, you an see the sample payload generated for this Service.

GenericSoapOperation Service Sample Payload for SOAP services in Fusion HCM Oracle HCM Cloud
GenericSoapOperation Service Sample Payload

Now, we need to provide our user credentials and authenticate in order to continue with out Check in/Search/download and delete operations.

Adding Authentication to Services in SOAPUI for SOAP services in Fusion HCM Oracle HCM Cloud
Adding Authentication to Services

Once you Click on Auth, you will get a popup, click the dropdown and click “Add New Authorization“.

In the next popup select “Basic

Authorization type Basic for SOAP services in Fusion HCM Oracle HCM Cloud
Authorization type Basic

Select the type as Basic and click OK.
In the next screen enter the Username and Password

Add the authentication details for SOAP request for SOAP services in Fusion HCM Oracle HCM Cloud

Once you add the Username and Password, you can click on Auth again and he popup will come down. Now that we have added the authentication details, we are ready to send the payload to accomplish our requirement.

Now, we have to prepare the sample payload

Check-in or Upload new documents:

This request requires the file to be included inline using Base64 encoding.

We can use the online tool https://www.base64decode.org/ to convert file into base64 encoding format

The sample file for this example is very small. A text file called Welcome.txt contains the following text:

Sample file to upload to UCM for SOAP services in Fusion HCM Oracle HCM Cloud
Sample File

Now we will base64 encode this file on https://www.base64encode.org/ website. You can ether copy the content and paste it or upload the file and click on encode.

base64 encoding of file for SOAP services in Fusion HCM Oracle HCM Cloud
Base64 encoding of file

After encoding it generates the code that we need to use in the payload to upload the file.

Sample Payload for Check-in file to UCM:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://www.oracle.com/UCM">
<ns1:GenericRequest webKey="cs">
<ns1:Service IdcService="CHECKIN_NEW">
<ns1:User/>
<ns1:Document>
<ns1:Field name="dDocTitle">Welcome</ns1:Field>
<ns1:Field name="dSecurityGroup">FAFusionImportExport</ns1:Field>
<ns1:Field name="dDocType">Document</ns1:Field>
<ns1:Field name="dDocAccount">hcm$/dataloader$/import$</ns1:Field>
<ns1:Field name="xComments">Checkin sample showing file upload using Base64 encoding.</ns1:Field>
<ns1:Field name="primaryFile">Welcome.txt=</ns1:Field>
<ns1:File name="primaryFile" href="C:\Charan\HelloWorld.txt">
<ns1:Contents>V2VsY29tZSB0byBGdXNpb24gSENNIEtub3dsZWRnZWJhc2U=</ns1:Contents>
</ns1:File>
</ns1:Document>
</ns1:Service>
</ns1:GenericRequest>
</soap:Body>
</soap:Envelope>

In the SOAP request, the encoded file must be included in the File and Contents tag. Notice within the contents tag is the encoded version of the file data:

<ns1:Field name=”primaryFile”>Welcome.txt=</ns1:Field>
<ns1:File name=”primaryFile” href=”C:\Charan\HelloWorld.txt”>
<ns1:Contents>V2VsY29tZSB0byBGdXNpb24gSENNIEtub3dsZWRnZWJhc2U=</ns1:Contents>
</ns1:File>

Security category is also one of the important thing while uploading the file to UCM – FAFusionImportExport

Now that the sample payload is created, we will go back to SOAPUI and remove the existing payload, copy and paste this payload and execute the request.

Run the payload to check in file to UCM for SOAP services in Fusion HCM Oracle HCM Cloud

Click Run.

Output after payload is run for SOAP services in Fusion HCM Oracle HCM Cloud
Output screen after the payload is run.

We can see the Content ID in the output.

Let’s navigate to Content Server and check the file using Content ID – UCMFA02534613
Sample Content Server link – https://abcd-test.fa.us6.oraclecloud.com/cs

file uploaded to ucm succesfully for SOAP services in Fusion HCM Oracle HCM Cloud
File on UCM

We can see that the file is present on UCM.

Now, lets try the Get File payload to check if it retrieves this file or not.

Sample Payload for Get File using Quick Search functionality:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://www.oracle.com/UCM">
<ns1:GenericRequest webKey="cs">
<ns1:Service IdcService="GET_SEARCH_RESULTS">
<ns1:Document><ns1:Field name="QueryText">&lt;qsch&gt;Welcome&lt;/qsch&gt;</ns1:Field></ns1:Document>
</ns1:Service>
</ns1:GenericRequest>
</soap:Body>
</soap:Envelope>
Search file process completed and provided content id for SOAP services in Fusion HCM Oracle HCM Cloud
Search Payload processed and provided the Content ID

Sample payload for Delete Document from UCM

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ucm="http://www.oracle.com/UCM">
<soapenv:Header/>
<soapenv:Body>
<ucm:GenericRequest webKey="cs">
<ucm:Service IdcService="DELETE_DOC">
<ucm:Document>
<ucm:Field name="dDocName">UCMFA02534613</ucm:Field>
</ucm:Document>
</ucm:Service>
</ucm:GenericRequest>
</soapenv:Body>
</soapenv:Envelope>
Delete file successful from UCM for SOAP services in Fusion HCM Oracle HCM Cloud
Delete file successful from UCM

How to get the document id (dID)?

Once you navigate to the Content Server and open the file that you have uploaded, when you hover over the file name you can see the link will be populated on the footer of the browser.

Getting the DID from the uploaded file for SOAP services in Fusion HCM Oracle HCM Cloud
Getting the DID from the uploaded file

Sample payload to download file from UCM using dID (Document ID):

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://www.oracle.com/UCM">
<ns1:GenericRequest webKey="cs">
<ns1:Service IdcService="GET_FILE">
<ns1:User/>
<ns1:Document>
<ns1:Field name="dID">2537354</ns1:Field>
</ns1:Document>
</ns1:Service>
</ns1:GenericRequest>
</soap:Body>
</soap:Envelope>
Downloading file using GET_FILE from UCM for SOAP services in Fusion HCM Oracle HCM Cloud
Downloading file using GET_FILE from UCM

We need to run the payload, in the results screen click on attachments and double click the text under the Name field to open the downloaded file.

Sample Payload to update document info:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://www.oracle.com/UCM">
<ns1:GenericRequest webKey="cs">
<ns1:Service IdcService="UPDATE_DOCINFO">
<ns1:User/>
<ns1:Document>
<ns1:Field name="dID">3243244</ns1:Field>
<ns1:Field name="dDocName">UCMA23244424</ns1:Field>
<ns1:Field name="xComments">Updated Comments metadata via SOAP request</ns1:Field>
</ns1:Document>
</ns1:Service>
</ns1:GenericRequest>
</soap:Body>
</soap:Envelope>

Sample payload to search results using combination of dDocTitle and a date range for dDocCreateDate

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://www.oracle.com/UCM">
<ns1:GenericRequest webKey="cs">
<ns1:Service IdcService="GET_SEARCH_RESULTS">
<ns1:Document>
<ns1:Field name="QueryText">dDocTitle &lt;starts&gt; `Melville`&lt;AND&gt; dDocCreatedDate &gt; `7/7/15`&lt;AND&gt; dDocCreatedDate &lt; `7/8/15`</ns1:Field>
<ns1:Field name="searchFormType">standard</ns1:Field>
<ns1:Field name="SortField">dDocCreatedDate</ns1:Field>
<ns1:Field name="SortOrder">DESC</ns1:Field>
<ns1:Field name="advSearch">True</ns1:Field>
<ns1:Field name="startRow">1</ns1:Field>
</ns1:Document>
</ns1:Service>
</ns1:GenericRequest>
</soap:Body>
</soap:Envelope>

The Base64 encoded content can be decoded using various methods:
1) Manually, using the online tool available here: https://www.base64decode.org/
2) From a PL/SQL client using the UTL_ENCODE package and the BASE64_DECODE Function: https://docs.oracle.com/cd/B28359_01/appdev.111/b28419/u_encode.htm#i996731

Tip: You can use SOAPUP or Postman tool to test the WSDL. If you are getting error, check the authentication details and check if the payload is formatted correctly or not. Sometimes the double quote character might go wrong while you do copy paste. Check it and correct if required.

Join our fastest growing technology social groups to interact with experts in the Fusion space and get your queries resolved – Telegram group, Facebook Page and LinkedIn Group

The following two tabs change content below.
Sricharan is a Fusion HCM Solution Architect with over 13+ years of overall experience and 5+ years of Fusion experience. He is passionate about technical aspects of Fusion HCM and writes interesting articles on HCM Extracts, HCM Data Loader, Fast Formula, BI Publisher, Integrations and Automation etc.

This Post Has 6 Comments

  1. Oracle

    Great! Thank!

    1. Sricharan

      Thank you for your feedback.

      Subscribe to the website if you haven’t done yet to get updated with latest posts.

      Regards,
      Sricharan

  2. Viswa

    Good Article Sricharan.
    Keep Posting New Articles.

    Could you pleas share the Screenshots for output response of the above article ” Sample payload to search results using combination of dDocTitle and a date range for dDocCreateDate”

    1. Sricharan

      Hi Viswa,

      Are you facing any issue when you try that?
      I haven’t tried all payloads.. I have tried 4-5 payloads and uploaded the snapshots.
      I have provided other payloads for the ease of use to audience.

      Thanks,
      SM

  3. Viswa

    Hi Sri Charan,

    I am trying with you post “Sample payload to search results using combination of dDocTitle and a date range for dDocCreateDate”

    I am not getting proper response.

    I believe date format is dd/mm/yyyy

    Could you please check the below soap request whether i had given correct format or not.

    dDocTitle <starts> `Payroll Relationship.dat`<AND> dDocCreatedDate > `5/5/20`<AND> dDocCreatedDate < `7/8/15`

    1. Viswa

      sorry it is not 7/8/15 it is 7/8/20

Leave a Reply