ESS Job의 로그를 WebAPI로 취득하는 Java 프로그램
                                            
                                                
                                                
                                                
                                                
                                                
                                                 6153 단어  SOAP오라클WebAPIoraclecloud자바
                    
ERP 통합 서비스
ERP Integration Service는 ERP 데이터 인바운드 및 아웃바운드 API와 관련 작업의 상태 확인 및 로깅을 위한 API를 제공합니다.
이 중 downloadESSJobExecutionDetails은 ESS 작업의 프로세스 ID를 지정하여 해당 작업의 로그 및 출력 파일을 검색하는 API입니다.
 
 Java 프로그램
 API 서비스 취득 및 액세스 권한 취득
서비스를 얻으려면 WSDL과 서비스 이름을 인수로 호출합니다.
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);
액세스 권한을 얻기 위해 사용자 이름과 암호를 설정합니다.
Map<String, Object> reqContext = ((BindingProvider) erpIntegrationService).getRequestContext();
reqContext.put(BindingProvider.USERNAME_PROPERTY, jobUser);
reqContext.put(BindingProvider.PASSWORD_PROPERTY, jobPass);
 로그 획득
downloadESSJobExecutionDetails의 인수에 대상 작업의 프로세스 ID와 "log"를 지정합니다.
※출력 파일을 취득하고 싶은 경우는 "out"을 지정합니다.
※응답의 데이터는 Zip 파일 형식이므로 Zip 파일에 씁니다.
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();
}
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(ESS Job의 로그를 WebAPI로 취득하는 Java 프로그램), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/fastso/items/a9ebedc581d318ed86e8
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                 우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
API 서비스 취득 및 액세스 권한 취득
서비스를 얻으려면 WSDL과 서비스 이름을 인수로 호출합니다.
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);
액세스 권한을 얻기 위해 사용자 이름과 암호를 설정합니다.
Map<String, Object> reqContext = ((BindingProvider) erpIntegrationService).getRequestContext();
reqContext.put(BindingProvider.USERNAME_PROPERTY, jobUser);
reqContext.put(BindingProvider.PASSWORD_PROPERTY, jobPass);
로그 획득
downloadESSJobExecutionDetails의 인수에 대상 작업의 프로세스 ID와 "log"를 지정합니다.
※출력 파일을 취득하고 싶은 경우는 "out"을 지정합니다.
※응답의 데이터는 Zip 파일 형식이므로 Zip 파일에 씁니다.
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();
}
Reference
이 문제에 관하여(ESS Job의 로그를 WebAPI로 취득하는 Java 프로그램), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/fastso/items/a9ebedc581d318ed86e8텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)