ERP Integration Service
The ERP Integration Service provides ERP data inbound and outbound APIs, as well as APIs for checking the status of related jobs and acquiring logs. Among them, [downloadESSJobExecutionDetails](https://docs.oracle.com/cd/E51367_01/financialsop_gs/OESWF/ERP_Integration_Service_ErpIntegrationService_svc_6.htm#oracle.apps.financials.commonModules.shared.model.erpIntegrationService.ErpIntegrationService. It is an API to get the log and output file of the job by specifying the ID.
To get the service, call it with the WSDL and service name as arguments.
URL wsdl = new URL(
"https://〇〇〇.oraclecloud.com/publicFinancialCommonErpIntegration/ErpIntegrationService?WSDL");
QName serviceName = new QName(
"http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/",
"ErpIntegrationService");
erpIntegrationServiceService = new ErpIntegrationService_Service(wsdl, serviceName);
SecurityPoliciesFeature securityFeatures = new SecurityPoliciesFeature(
new String[] { "oracle/wss_username_token_over_ssl_client_policy" });
erpIntegrationService = erpIntegrationServiceService.getErpIntegrationServiceSoapHttpPort(securityFeatures);
Set a username and password to gain access.
Map<String, Object> reqContext = ((BindingProvider) erpIntegrationService).getRequestContext();
reqContext.put(BindingProvider.USERNAME_PROPERTY, jobUser);
reqContext.put(BindingProvider.PASSWORD_PROPERTY, jobPass);
Specify the process ID and "log" of the target job in the argument of downloadESSJobExecutionDetails.
try (BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(new File(logDir + "\\" + logFilename + ".zip")))) {
List<DocumentDetails> docList = erpIntegrationService
.downloadESSJobExecutionDetails(essProcId, "log");
for (DocumentDetails docDetail : docList) {
bos.write(docDetail.getContent());
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Recommended Posts