Use the HCM Data Loader Integration Web Service
You can use an HCM Data Loader SOAP web service to import and load the data files that are staged on the WebCenter Content server. You can process those data files manually from the Import and Load Data page in the Oracle Cloud HCM user interface.
You must first install Oracle JDeveloper 11.1.1.9, to get the libraries required to invoke SOAP web services from Oracle Cloud HCM.
About the HCM Data Loader Integration Service
You can use an Oracle Cloud HCM SOAP web service to upload files using the SOAP API.
You can obtain the Data Loader Service web service details from Oracle Fusion Cloud Human Resources in the Developer Connect link, under Tools in the Navigator menu, just like any other SOAP web service.
You can invoke the SOAP web service after you place the ZIP file that contains the DAT files on the WebCenter Content server. Then, you can secure it with the hcm/dataloader/import
account. This web service can be used to import and load data in Oracle Cloud
HCM.
About the SOAP Envelopes for Invoking the HCM Data Loader
HCMDataLoader
SOAP web service: http://{Host}/hcmCommonDataLoader/HCMDataLoader
About the importAndLoadData method
The importAndLoadData
method initiates the processing of a data file hosted on the WebCenter Content server. It is an asynchronous job that returns only the ProcessId
of the submitted process.
Use this envelope to make a call to the importAndLoadData
function in the SOAP web service.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:importAndLoadData xmlns:ns1="http://xmlns.oracle.com/apps/hcm/common/dataLoader/core/dataLoaderIntegrationService/types/">
<ns1:ContentId></ns1:ContentId>
<ns1:Parameters></ns1:Parameters>
</ns1:importAndLoadData>
</soap:Envelope>
The parameters for the importAndLoadData
method that are sent with the envelope are:
ContentId: Content ID of the file on the WebCenter Content server (the same value as the dDocName
parameter in the WebCenter Content Java call).
Parameters: Name-value pairs. The following parameter names are available, but are not mandatory:
-
ImportMaximumErrors
: Percentage of the file lines in an error that can occur for a business object before the import process stops. -
LoadMaximumErrors
: Percentage of business object instances in an error that can occur for a business object before the validation and load processes stop. -
LoadConcurrentThreads
: Number of concurrent threads when validating or loading. -
LoadGroupSize
: Number of business objects processed as a single unit of work by a concurrent thread. -
FileEncryption
: Type of file encryption. For example, Password Based Encryption (PBE). -
DeleteSourceFile
:Y
orN
value. If set toY
or left blank, deletes the source file from the WebCenter Content server after the file content is transferred into HCM Data Loader stage tables and is no longer required.
For example the <ns1:Parameters>
tag can contain the following name and value pairs:<ns1:Parameters>ImportMaximumErrors=100,LoadMaximumErrors=100,LoadConcurrentThreads=4,FileEncryption=PGPSIGNED,DeleteSourceFile=N</ns1:Parameters>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
<env:Header> <wsa:To>http://www.w3.org/2005/08/addressing/anonymous</wsa:To>
<wsa:Action>http://xmlns.oracle.com/apps/hcm/common/dataLoader/core/dataLoaderIntegrationService/HCMDataLoader/importAndLoadDataResponse</wsa:Action>
<wsa:MessageID>urn:uuid:ab36195f-775b-4688-a0e4-8a4e531e904c</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:74c7b631-c20a-4d49-bf36-1f483f3dc43e</wsa:RelatesTo>
</env:Header>
<env:Body> <ns0:importAndLoadDataResponse xmlns:ns0="http://xmlns.oracle.com/apps/hcm/common/dataLoader/core/dataLoaderIntegrationService/types/"> <result xmlns="http://xmlns.oracle.com/apps/hcm/common/dataLoader/core/dataLoaderIntegrationService/types/">7958</result> </ns0:importAndLoadDataResponse>
</env:Body>
</env:Envelope>
About the getDataSetStatus
method
The getDataSetStatus
method returns the current status of the specified data file.
Use this envelope to make a call to the getDataSetStatus
function in the SOAP web service.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:getDataSetStatus xmlns:ns1="http://xmlns.oracle.com/apps/hcm/common/dataLoader/core/dataLoaderIntegrationService/types/">
<ns1:Parameters></ns1:Parameters>
</ns1:getDataSetStatus>
</soap:Envelope>
The parameters for the getDataSetStatus
method that are sent with the envelope are:
ContentId: Content ID of the file on the WebCenter Content server (the same value as the dDocName
parameter in the WebCenter Content Java call).
ProcessId: The ID of the process initiated and returned by the importAndLoadData
method.
Generate a Proxy Class for Invoking the HCM DataLoader
One option for invoking an Oracle Cloud HCM SOAP web service, is to use generated proxy classes.
You can generate proxy classes by providing the URL of the service WSDL file to your generator of choice. These proxy classes are used to invoke the web service.
Note:
Oracle Cloud HCM SOAP web services are protected by Oracle Web Services Manager (OWSM) security policies.About the Security Implications When Using the HCM Data Loader
When a client calls an HCM Data Loader SOAP web service, the later must satisfy the message protection policy to ensure that the payload is transported in an encrypted way or over the SSL transport layer.
The HCMDataLoader
web service is secured using the following Oracle Web Services Manager policy: oracle/wss11_saml_or_username_token_with_message_protection_service_policy
.
On the client side, you can use the following Oracle Web Services Manager policy:oracle/wss11_username_token_with_message_protection_client_policy
.
To use this policy, the message must be encrypted by using a public key that is provided by the server. When the message reaches the server, the message can be decrypted by the server's private key. You can create a KeyStore
to import the certificate provided in the service WSDL file, however for security reasons you should prompt the user for the Oracle Cloud
HCM password whenever you run your code.
You can create a properties text file that can be parsed within your code to access the Keystore
information, for example:
FUSION_USERNAME=<Your Oracle Global Human Resources Cloud User Name>
DATAPATH=C:\\My\\Assets\\cloud.asset.hcm.java-dataload-example\\data\\
HCM_DATA_LOADER_SERVICE_WSDL_LOCATION=https://<<FusionURL>/hcmCommonDataLoader/HCMDataLoader?wsdl
UCM_IDC_WEBSERVICE_LOCATION=https://<FusionURL>/idcws/GenericSoapPort
KEYSTORE_LOCATION=<Your Keystore trust location>
KEYSTORE_PASSWORD=<YourTrustPassword>
KEYSTORE_ALIAS=orakey
GETDATASETSTATUS_DELAY=5
OK=OK
ERROR=Error
WARNING=Warning
CSV_FILE_ENCODING=UTF-8
DATA_SEPERATOR=;
Prompt the user for their Oracle Cloud HCM credentials using the following:
// Accept password from user
Scanner scanReader = new Scanner(System.in); // Reading from System.in
System.out.println("Enter password for user "+propertiesFile.getProperty("FUSION_USERNAME")+" :");
fusionUserPass= scanReader.next(); // Scans the next token of the input as an int.
scanReader.close();
In the example, fusionUserPass
is a variable that can be used to store the user's Oracle Cloud
HCM password, and then passed to the HCM Data Loader SOAP web service.
Invoke the HCM DataLoader SOAP Web Service
You can load data from a ZIP file to Oracle Cloud HCM by using the HCM Data Loader SOAP web service from a Java class.
First create a ZIP file and upload it to the WebCenter Content server either manually or programmatically. Then you can load the data using the importAndLoadData
web service.
Note:
The code samples provided in this solution were tested with JDK version 8 for invoking web services on Oracle WebLogic Server 12c. For use with other JDK and Oracle WebLogic Server versions, test the code with libraries specific to the desired versions.