사용자 정의 보안 알고리즘 구현

WSDL 보안 편집기에서 사용할 수 있는 사용자 정의 보안 Java™ 인터페이스를 구현하여 SOAP 보안 프로파일의 사용자 보안 알고리즘을 정의할 수 있습니다. 사용자 보안 알고리즘을 사용하면 메시지 컨텐츠를 보내기 전과 받은 후에 XML을 변환하는 전용 보안 알고리즘을 구현할 수 있습니다.

시작하기 전에

사용자 정의 보안 인터페이스 및 이를 포함한 JAR 파일은 com.ibm.rational.ttt.common.models.core 플러그인의 customsecuritydefinition 폴더에 제품과 함께 제공됩니다. 사용자의 알고리즘을 작성하려면 이러한 인터페이스가 필요합니다. IBM® Rational® Performance Tester 또는 IBM Rational Service Tester for SOA Quality를 사용하는 경우 Java 코드로 테스트 기능을 확장하는 데 대한 자세한 정보는 사용자 정의 코드로 테스트 실행 확장을 참조하십시오.

프로시저

  1. 테스트 네비게이터 또는 프로젝트 탐색기에서 웹 서비스 테스트 프로젝트 폴더에 새 Java 클래스를 작성하십시오.
  2. 다음 인터페이스를 사용하여 Java로 보안 알고리즘을 구현하십시오.
    /**
    * ***************************************************************
    * IBM Confidential
    * 
    * (c) Copyright IBM Corporation. 2008. All Rights Reserved. * 
    * The source code for this program is not published or otherwise
    * divested of its trade secrets, irrespective of what has been
    * deposited with the U.S. Copyright Office.
    * *************************************************************** 
    * 
    */
    
    package com.ibm.rational.test.lt.models.wscore.datamodel.security.xmlsec;
    
    import java.util.Properties;
    import org.w3c.dom.Document;
    
    
    public interface ICustomSecurityAlgorithm {
    	
    	/**
    	 * The following methods can be used in both case:
    	 * Execution in the workbench and execution of the test.
    	 */
    	
    	
    	/**
    	 * Called to process de Document that is sent over a transport.
    	 * @param subject
    	 */
    	void process(Document subject);
    	/**
    	 * Called to un process a document that is received from a server.
    	 * @param subject
    	 */
    	void unProcess(Document subject);
    	
    	/**
    	 * Properties defined in the UI of the CustomSecurityAlgorithm.
    	 * @param map
    	 */
    	void setProperties(Properties map);
    	
    	/**
    	 * The following methods can only be used in terms of cast to test service interface,
    	 * or in terms of access to the previous XML  information, when the jar containing
    	 * the custom security algorithm is deployed in the performance test project. In
    	 * this case you cannot use the algorimth directly from the workbench.
    	 */
    	
    	/**
    	 * This object corresponds to the ITestExecutionService object.
    	 * This applies only to an algorithm that must link to the execution of the test.
    	 * If you plan to use this object you will need to deploy the jar containing the
    	 * implementation into your performance test project and not directly into the JRE.
    	 * 
    	 * In case of a need of the previous xml document received from the execution you can 
    	 * obtain the value using:
    	 * IDataArea area = ((ITestExecutionService)executionObject).findDataArea(IDataArea.VIRTUALUSER);
    	 *String previousXML = (String) area.get("PREVIOUS_XML"); //$NON-NLS-1$
    	 * 
    	 */
    	void setExecutionContext(Object executionObject);

    process 메소드는 XML이 서버로 전송되기 전에 XML을 수정합니다.

    unprocess 메소드는 XML이 서버에서 수신된 후 XML을 수정합니다.

    setProperties 메소드는 이 사용자 정의 보안 인터페이스의 보안 편집기에 정의된 특성을 검색합니다.

    setExecutionContext 메소드는 이 사용자 정의 보안 인터페이스를 사용하여 메시지에 해당하는 ITestExecutionServices 오브젝트로 테스트하는 동안 호출됩니다.

  3. 사용자 정의 보안 인터페이스는 웹 서비스의 WSDL 보안 편집기 또는 로컬 XML 보안 탭의 XML 호출 요소에서 사용할 수 있습니다.
    • WSDL 기반 웹 서비스를 테스트하는 경우 테스트 네비게이터 또는 프로젝트 탐색기에서 WSDL 파일을 마우스 오른쪽 단추로 클릭하여 WSDL 보안 편집기를 열고 보안 알고리즘 페이지를 선택한 후 선택한 보안 알고리즘 스택의 세부사항에서 추가 > 사용자 정의 보안 알고리즘을 클릭하십시오.
    • XML 호출을 테스트하는 경우 테스트 편집기에서 XML 호출 요소를 열고 로컬 XML 보안 탭을 선택한 후 추가 > 사용자 정의 보안 알고리즘을 클릭하십시오.
  4. 사용자 정의 보안에서 클래스 찾아보기를 클릭하여 사용자 정의 보안 알고리즘의 클래스 이름(예: ICustomSecurityAlgorithm)을 선택하십시오.
  5. 사용자 정의 보안 알고리즘의 알고리즘 이름을 입력하십시오.
  6. 특성 목록에서 추가, 제거 또는 편집을 사용하여 사용자 정의 보안 알고리즘에서 setProperties 메소드가 사용하는 특성을 지정하십시오.

다음에 수행할 작업

보안 구성 또는 호출 요소를 저장하면 웹 서비스 프로토콜 데이터 보기에 웹 서비스의 XML 데이터에 대한 보안 알고리즘의 영향이 표시됩니다.

피드백