WebCenter 콘텐츠 일반 SOAP 웹 서비스를 사용하여 HCM 데이터 로더 ZIP 파일 업로드

Oracle WebCenter Content 서버는 파일을 업로드하는 데 사용할 수 있는 SOAP 웹 서비스 인터페이스(GenericSoapPort)를 노출합니다.

인라인 콘텐츠가 포함된 WebCenter 콘텐츠 일반 SOAP 웹 서비스를 호출합니다.

인라인 콘텐츠를 GenericSoapPort 웹 서비스 호출과 함께 전송할 수 있습니다.

다음 위치에서 웹 서비스에 대한 WSDL 파일을 가져옵니다.

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

호스트는 Oracle Fusion Cloud Applications URL입니다.

요청 본문은 다음 매개변수를 포함합니다.

매개변수 의미 HCM 데이터 로더에 대한 의견
IdcService

호출할 서비스입니다.

파일 업로드용 CHECKIN_UNIVERSAL

dDocName

콘텐츠 항목에 대한 콘텐츠 ID입니다.

HcmDataLoader로 전달된 값

dDocAuthor

콘텐츠 항목 작성자(제공자)입니다.

 
dDocTitle

콘텐츠 항목 제목입니다.

임포트/익스포트 UI에 표시되는 파일 제목

dDocType

콘텐츠 항목 유형입니다.

문서

dSecurityGroup

보안 그룹(예: Public 또는 Secure)입니다.

FAFusionImportExport

dDocAccount

콘텐츠 항목에 대한 계정입니다. 계정이 사용으로 설정된 경우에만 이 값이 필요합니다.

hcm$/dataloader$/import$

primaryFile

서버에서 볼 수 있는 파일 위치에 대한 절대 경로입니다.

 

dDocName 값은 응답의 일부이며 추가 HCM 데이터 로더 처리에 사용할 콘텐츠 ID를 나타냅니다.

선택적으로 요청을 보낼 때 봉투를 사용할 수 있습니다. 예를 들면 다음과 같습니다.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ucm="http://www.oracle.com/UCM" xmlns:wsse="http://schemas.xmlsoap.org/ws/2003/06/secext">
    <soapenv:Header />
    <soapenv:Body>
        <ucm:GenericRequest webKey="cs">
            <ucm:Service IdcService="CHECKIN_UNIVERSAL">
                <ucm:User />
                <ucm:Document>
                    <ucm:Field name="dDocTitle">Department Load File</ucm:Field>
                    <ucm:Field name="dDocType">Document</ucm:Field>
                    <ucm:Field name="dDocAuthor">YOUR_HCM_USER_NAME</ucm:Field>
                    <ucm:Field name="dSecurityGroup">FAFusionImportExport</ucm:Field>
                    <ucm:Field name="dDocAccount">hcm$/dataloader$/import$</ucm:Field>
                    <ucm:Field name="primaryFile">YourZipFile.zip</ucm:Field>
                    <ucm:File href="YourZipFile.zip" name="primaryFile">
                        <ucm:Contents>hQEMA+8YN513c6VEAQf9EstURU0V2erP9hNIP34P6cvwdi2G8hmtTY4dj+jpjSBiBwF28SzOGO5Q T/S6LDM1lAd9fHDFO4CFTEUkiMiAfa4jCpkh2kjvrV05GYiy9rlYGbgjRa38t0Boj0G8dkZia4kw lD5zloegTb4k9dp2ZXtAkJjVPTlmaVs7wPjqHJOk1Dtj+zUL/Dvq/X+rcmBtnvZ6+gX1r/PSBYsI ANiUK36pUac916p1wrYbePtmLs9rLB8dZTIdKE3pbi3aIKECnqnfXN3Rx8BT3afI2kWA9xEsEBwL XSgD4EUlYY2lWKM0wQrSCIfz1jit4zK+vs1Jp3zP3kSFfMH9h5b70ATYCNLpAXTmolmJxhvg9nPN RbgWGM0jWuVE7tXEVL66s2XJuV6HCyJ+3QDTSS/hEzUorpbaH7gOPdd2d9uIJayseWmgkCLhpgNM Ml4dGGDEL7ISZNKbu39MWvptFC5wrFX/VyB0E3kZF3xJ9dHz5UzVN3hiji6/ZLnUKRI+mpY41gEQ BdLm/WehWRLkF9yWhdkKOK1imBa+oLCeZg2YcCPNVqMaf42atoix9kSR+PCdB46SGnyQ2kvx0z9V t+4A/70psaMEOgPmUciQ/CNoC3vPdDs/G+p8Run/9MHoZoW5o2KpGC1M4j593BulKnfE7JZdYopG b1MS9Vrd6e4Oj3ZD7ISyrf8gEsEhvRu4se0CnAA8W2Fj2u88TOBn/rX+9NMffGwwO040a00N4upV 70xY0I0mvMzPKh4u4kHHQLaV7+fChTHIRCXFjvN2ziyGdSCYxiZ9tfhms39jPp2LxJKPnsV5GgC8 XSqpzxipYjbZjpqvKAu0k9VhIF4vHlGjTbzZuhz/CETs5Aj2LXvJksIBpDq6whUK7/LKR3hmfKXi e4xng6B4TwSEvhvRDY0+V2np1RMxzlqW0W3XNpKYqkS2kjO7vQM65CBAqeQjYAW9p1tE1k1S5G2N 1whW46eYIQvN68SzkCQIsafzoAtgKKYClEwJuxGE004i6AluJ0keWx+ZzXohyIxx8eTiw7vp5PIS tm2WTriBJ/x0gMB9CWfdymOFK9Mf</ucm:Contents>
                    </ucm:File>
                </ucm:Document>
            </ucm:Service>
        </ucm:GenericRequest>
    </soapenv:Body>
</soapenv:Envelope>

그러나 HCM 데이터 로더 파일이 일반적으로 크므로 XML 바이너리 최적화 패키징(XOP)과 함께 MTOM(메시지 전송 최적화 방식)을 사용하여 웹 서비스를 호출하는 것이 좋습니다. 다음 요청 예는 MTOM/XOP가 있는 HCM 데이터 로더 ZIP 파일을 업로드하는 요청 페이로드를 보여줍니다.

POST http://{host}/idcws/GenericSoapPort HTTP/1.1 
Accept-Encoding: gzip,deflate
Content-Type: multipart/related; type="application/xop+xml"; start="<rootpart@example.com>"; start-info="text/xml"; boundary="----=_Part_7_163289738.1476693003095" 
SOAPAction: "urn:GenericSoap/GenericSoapOperation"
Authorization: Basic YOUR_AUTHORIZATION_TOKEN 
MIME-Version: 1.0 
Content-Length: 4030385
Host: {host} User-Agent: Apache-HttpClient/4.1.1 (java 1.5) 
Connection: close 

------=_Part_7_163289738.1476693003095 
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" 
Content-Transfer-Encoding: 8bit 
Content-ID:<rootpart@example.com>


        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ucm="http://www.oracle.com/UCM" xmlns:wsse="http://schemas.xmlsoap.org/ws/2003/06/secext">
            <soapenv:Header>
                <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                    <wsse:UsernameToken wsu:Id="UsernameToken-12345">
                        <wsse:Username>YOUR_HCM_USER_NAME</wsse:Username>
                        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">YOUR_HCM_ACCOUNT_PASSWORD</wsse:Password>
                        <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">ckNXKVpwBU01PD2ENXg5nw==</wsse:Nonce>
                        <wsu:Created>2018-07-01T08:30:03.094Z</wsu:Created>
                    </wsse:UsernameToken>
                </wsse:Security>
            </soapenv:Header>
            <soapenv:Body>
                <ucm:GenericRequest webKey="cs">
                    <ucm:Service IdcService="CHECKIN_UNIVERSAL">
                        <ucm:User/>
                        <ucm:Document>
                            <ucm:Field name="dDocTitle">Department Load File</ucm:Field>
                            <ucm:Field name="dDocType">Document</ucm:Field>
                            <ucm:Field name="dDocAuthor">HCM_IMPL</ucm:Field>
                            <ucm:Field name="dSecurityGroup">FAFusionImportExport</ucm:Field>
                            <ucm:Field name="dDocAccount">hcm$/dataloader$/import$</ucm:Field>
                            <ucm:Field name="primaryFile">YourZipFile.zip</ucm:Field>
                            <ucm:File href="YourZipFile.zip" name="primaryFile">
                                <ucm:Contents>
                                    <inc:Include href="cid:YourZipFile.zip" xmlns:inc="http://www.w3.org/2004/08/xop/include" />
                                </ucm:Contents>
                            </ucm:File>
                        </ucm:Document>
                    </ucm:Service>
                </ucm:GenericRequest>
            </soapenv:Body>
        </soapenv:Envelope> 
------=_Part_7_163289738.1476693003095 
Content-Type: application/zip; name=YourZipFile.zip 
Content-Transfer-Encoding: binary 
Content-ID:<YourZipFile.zip> 
Content-Disposition: attachment; name="YourZipFile.zip"; filename="YourZipFile.zip"

 <<< binary content ommitted for brevity>>> 
 	
------=_Part_7_163289738.1476693003095--

WebCenter Content 문서 전송 유틸리티 업로드 도구 정보

WebCenter Content 문서 전송 유틸리티를 프로그래밍 방식으로 사용하여 ZIP 파일을 WebCenter Content 서버에 업로드할 수 있습니다.

oracle.ucm.fa_genericclient_11.1.1.jar에 포함된 oracle.ucm.idcws.client.UploadTool는 기본 일반 SOAP 기반 전송 유틸리티입니다. 라이브러리를 지원하는 Oracle JRF 웹 서비스가 필요하며 HTTPS를 통한 JAX/WS를 사용하여 WebCenter Content 서버와 통신합니다. oracle.ucm.idcws.client.UploadTool는 로컬 파일에서 스트림된 WebCenter 콘텐츠에 파일을 업로드하는 데 사용됩니다.

일반 SOAP 기반 전송 유틸리티는 GenericSoapPort 웹 서비스 (/idcws/GenericSoapPort를 통해 WebCenter Content 서버에 액세스하고 클라이언트가 적합한 UsernameToken 기반 Oracle Web Services Manager 보안 클라이언트 정책을 지정해야 합니다.

Java Runtime Environment 요구 사항 정보

Oracle Java 6 SE 릴리스 1.6.0_20은 WebCenter Content 문서 전송 유틸리티 도구를 사용하여 성공적으로 테스트한 가장 빠른 버전의 Oracle Java Runtime Environment입니다. Oracle은 최신 Java 6 SE 또는 Java 7 SE 릴리스를 사용하여 최신 버그 수정 및 보안 업데이트를 적용할 것을 권장합니다.

업로드 도구 매개변수 정보

oracle.ucm.idcws.client.UploadTool를 호출할 때 다음 매개변수를 제공해야 합니다.

  • url: WebCenter Content 서버 GenericSoapPort 웹 서비스 위치입니다(예: https://<Your_Oracle_WebCenter_Content_Server_URL>/idcws/GenericSoapPort).

  • policy: 서버의 구성된 서비스 정책(예: oracle/wss_username_token_over_ssl_client_policy 또는 oracle/wss_username_token_client_policy 정책)과 일치하는 적합한 UsernameToken 기반 Oracle Web Services Manager 보안 클라이언트 정책입니다.

  • username: Oracle Cloud HCM 사용자 이름입니다.

  • password: Oracle Cloud HCM 암호입니다.

  • primaryFile: 업로드할 로컬 파일의 정규화된 경로입니다.

  • dDocAccount: 대상 보안 계정입니다.

  • dDocTitle: 문서 제목입니다.

  • dDocName: 파일의 dDocName 값을 제공하여 기존 파일의 버전을 지정하려면 이 매개변수를 사용합니다.

  • 체크아웃: 새 개정을 추가하는 경우 먼저 체크아웃을 수행합니다. 이 매개변수의 값은 true 또는 false(기본값)일 수 있습니다.

디버깅 또는 자동 호출 사용 사례에 대해 일부 선택적 매개변수를 전달할 수도 있습니다.

  • version: UploadTool 개정 및 버전을 인쇄합니다.

  • ping: PING_SERVER 테스트를 수행하여 연결 URL 및 자격 증명을 검증합니다.

  • verbose: 전체 요청 및 응답 데이터 바인더를 기록하도록 상세 정보 출력을 구성합니다.

  • quiet: 최소 로그 출력을 구성합니다.

  • silent: 로그 메시지를 사용 안함으로 설정합니다.

  • log_file_name: 로그 정보를 System.out와 다른 외부 파일로 보냅니다.

  • log_file_append: 로그를 추가할지 겹쳐쓸지 여부를 구성합니다.

일반 SOAP 웹 서비스를 사용하여 프로그래밍 방식으로 HCM 데이터 로더 파일 업로드

HCM 데이터 로더 ZIP 파일을 업로드할 때 제공되는 프로그래밍 방식 옵션 중 하나는 Java 프로그래밍 언어를 사용하여 일반 SOAP 웹 서비스 API를 사용하는 것입니다.

  1. Java 프로그램에서 다음 라이브러리를 임포트합니다.
    import java.io.ByteArrayInputStream;
    import java.io.File;
    import java.io.IOException;
    import java.io.InputStream;
    import java.nio.charset.Charset;
    import java.util.ArrayList;
    
    import java.util.List;
    import java.util.Map;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    
    import oracle.stellent.ridc.IdcClientException;
    import oracle.ucm.idcws.client.UploadTool;
    import oracle.ucm.idcws.client.UploadTool.UploadResults;
    import oracle.ucm.idcws.client.bulk.UploadException;
    import oracle.ucm.idcws.client.model.content.CheckinSource;
    import oracle.ucm.idcws.client.model.content.TransferFile;
    import oracle.ucm.idcws.client.model.response.CheckinResponse;
  2. 일반 SOAP 웹 서비스를 사용하여 WebCenter 콘텐츠 서버에 파일을 업로드하는 함수를 생성합니다.
    public static String uploadFileToUCMwithSOAP(String url, String username, String password, File uploadFile, 
    			String identifier, String dDocName, String dDocTitle, String dSecurityGroup, String dDocAccount, String dDocType) throws Exception {
    		//Insert all the code in the next steps in the body of this function		
    	}
  3. 함수 본문에서 url, username, password 및 OWSM 보안 정책과 같은 핵심 인수를 포함할 List 객체를 생성합니다. 예:
    		List<String> coreArgs = new ArrayList<String>();
    		coreArgs.add("url=" + url);
    		coreArgs.add("policy=oracle/wss_username_token_over_ssl_client_policy");
    		
    		
    		coreArgs.add("username=" + username);
    		coreArgs.add("password=" + password);
    		coreArgs.add("silent=false"); // minimal log output
    		coreArgs.add("verbose=true"); // verbose log output
    
    		List<String> argsList = new ArrayList<String>();
    		argsList.addAll(coreArgs);
    
    		argsList.add("threads=3");
    		argsList.add("throwOnThreadException=false"); // run() will not throw an exception should a thread error
    		
    		String[] uploadArgs = argsList.toArray(new String[0]);
  4. UploadTool 객체를 만들고 uploadArgs 배열을 사용하여 초기 구성을 설정합니다. 예:
    		UploadTool uploadTool = new UploadTool();
    
    		// Setup the tool's initial configuration from the supplied arguments.
    		boolean terminateEarly = uploadTool.setup(uploadArgs);
    		if (terminateEarly) {
    			throw new Exception("Error with the UCM UploadTool's initial configuration from the supplied arguments, please check arguments and try again.");
    		}
  5. 웹 서비스 매개변수를 추가하고 요청을 생성합니다.
    	List < CheckinSource > items = new ArrayList < CheckinSource > ();
    	items.add(new LocalFileSource(identifier, dDocName, dDocTitle, dSecurityGroup, dDocAccount, dDocType,
    	    uploadFile.getAbsolutePath()));
    
    	uploadTool.setCheckinItems(items);
    	UploadResults uploadResults = uploadTool.run();
    	if (uploadResults != null) {
    	    Map < Integer, Exception > failedCheckins = uploadResults.getAllFailedCheckinsKeyedByTaskNum();
    	    Map < Integer, UploadException > failedCheckinsDetailed = uploadResults.getFailedCheckinsKeyedByTaskNum();
    	    for (Map.Entry < Integer, Exception > entry: failedCheckins.entrySet()) {
    	        if (failedCheckinsDetailed.containsKey(entry.getKey())) {
    	            UploadException e = failedCheckinsDetailed.get(entry.getKey());
    	            logger.info("Checkin with task number " + e.getTaskNumber() + " and identifier " +
    	                e.getIdentifier() + " failed with message " + e.getMessage());
    	        } else {
    	            logger.info("Checkin with task number " + entry.getKey() + " failed with message " +
    	                entry.getValue().getMessage());
    	        }
    	    }
    
    	    Map < Integer, CheckinResponse > successfulCheckins = uploadResults.getSuccessfulCheckinsKeyedByTaskNum();
    	    for (Map.Entry < Integer, CheckinResponse > entry: successfulCheckins.entrySet()) {
    	        CheckinResponse response = entry.getValue();
    	        logger.info("Checkin with task number " + response.getTaskNumber() + " and identifier " +
    	            response.getIdentifier() + " succeeded. dID=" + response.getDId() + " dName=" + response.getDDocName());
    
    
    
    	    }
    	}
    	return dDocName; // dDocName is whats used by HDL Import	

    요청이 실행 중인 경우 각 항목이 별도로 처리됩니다. 로거 객체에 전송된 모든 실패한 항목이 한쪽에 나타납니다. 모든 성공한 항목은 응답에서 확인되고 다른 쪽에서 기록됩니다. 콘텐츠 ID인 dDocName가 응답에 반환되고 파일이 WebCenter 콘텐츠 서버에 성공적으로 업로드되었음을 나타냅니다.