Liberty: ibm-ws-bnd.xml 파일

Liberty에서 ibm-ws-bnd.xml 파일을 사용하여 웹 서비스 엔드포인트를 사용자 정의하고 웹 서비스 제공자 및 웹 서비스 클라이언트 모두의 보안 설정을 구성할 수 있습니다. 이 파일을 웹 애플리케이션의 /WEB-INF 디렉토리와 EJB 모듈의 /META-INF 디렉토리에 저장해야 합니다.

ibm-ws-bnd.xml 파일의 각 요소에 대한 설명은 다음과 같습니다.

<webservice-endpoint-properties>

이 요소는 동일 모듈에 있는 모든 웹 서비스 엔드포인트에 대한 기본 특성을 정의하기 위해 사용됩니다. 하나의 모듈에 대해 단 하나의 webservice-endpoint-properties 요소만 지정할 수 있습니다. webservice-endpoint-properties 요소의 속성으로 웹 서비스 엔드포인트에 적용 가능한 이름 및 값 쌍을 지정할 수 있습니다.

<enableLoggingInOutInterceptor> 특성을 추가하는 경우, 클라이언트측 및 서버측 모두에 대한 SOAP 요청 및 응답을 로깅할 수 있습니다.

<webservice-endpoint-properties enableLoggingInOutInterceptor="false">  
참고: enable LoggingInOutInterceptor="true"를 설정하는 경우 message.log에 신임 정보가 표시됩니다.

<webservice-endpoint>

이 요소는 지정된 서비스 인스턴스에 대한 바인딩을 지정하기 위해 사용됩니다. 다음과 같은 속성이 있습니다.
  • port-component-name: 이 속성은 필수 속성입니다. 포트 컴포넌트의 이름을 지정하기 위해 사용됩니다.
  • address: 이 속성은 선택사항입니다. 서비스 엔드포인트의 대체된 주소를 지정하기 위해 사용됩니다.

<enableLoggingInOutInterceptor> 특성을 추가하는 경우, 클라이언트측 및 서버측 모두에 대한 SOAP 요청 및 응답을 로깅할 수 있습니다.

	<webservice-endpoint port-component-name="Hello">         
		<properties enableLoggingInOutInterceptor="true"/>    
	</webservice-endpoint>
참고: enable LoggingInOutInterceptor="true"를 설정하는 경우 message.log에 신임 정보가 표시됩니다.

<http-publishing>

이 요소는 모든 웹 서비스 엔드포인트에 HTTP 프로토콜을 사용할 때 공개 구성을 지정하기 위해 사용됩니다. 각 모듈에서 하나의 <http-publishing> 요소만 지정할 수 있습니다. 다음과 같은 속성이 있습니다.
  • context-root: 이 속성은 선택사항입니다. 이 속성은 EJB 기반 JAX-WS 애플리케이션에서 EJB 모듈의 컨텍스트 루트를 지정하기 위해 사용됩니다.

<webservice-security>

이 요소는 POJO 웹 서비스 및 EJB 기반 웹 서비스의 역할 기반 권한을 구성하는 데 사용됩니다. 다음과 같은 속성이 있습니다.
  • security-constraint: 이 속성은 선택사항입니다. 보안 제한조건을 하나 이상의 웹 자원 콜렉션과 연관시키는 데 사용되며, 웹 애플리케이션에서 배치 디스크립터 또는 어노테이션의 보상 구성으로만 작동합니다.
  • security-role: 이 속성은 선택사항입니다. 이 속성에는 보안 역할의 정의가 포함되고, 웹 애플리케이션에서 배치 디스크립터 또는 어노테이션의 보상 구성으로만 작동합니다.
  • login-config: 이 속성은 선택사항입니다. 이 속성은 인증 방법과 영역 이름을 구성하는 데 사용되며, JAR 파일의 EJB 기반 웹 서비스에 대해서만 적용됩니다. 배치 디스크립터 파일에 동일한 속성이 지정된 경우 배치 디스크립터의 값이 사용됩니다. 이 속성의 값은 BASIC 또는 CLIENT_CERT입니다.

<service-ref>

이 요소는 웹 서비스 클라이언트에 대한 웹 서비스 참조 구성을 정의하는 데 사용됩니다. 다음과 같은 속성이 있습니다.
  • name: 이 속성은 필수 속성입니다. 웹 서비스 참조의 이름을 지정하기 위해 사용됩니다.
  • component-name: 이 속성은 선택사항입니다. 이 속성은 서비스 참조가 EJB 모듈에 사용되는 경우에 EJB Bean 이름을 지정하기 위해 사용됩니다.
  • port-address: 이 속성은 선택사항입니다. 이 속성은 참조된 웹 서비스에 하나의 포트만 있는 경우에 웹 서비스 포트의 주소를 지정하는 데 사용됩니다.
  • wsdl-location: 이 속성은 선택사항입니다. 이 속성은 대체할 WSDL의 URL을 지정하기 위해 사용됩니다.

<port>

이 요소는 웹 서비스 참조와 연관되는 포트 구성을 규정하는 데 사용됩니다. service-ref 요소에서 여러 port 요소를 정의할 수 있습니다. 다음과 같은 속성이 있습니다.
  • name: 이 속성은 필수 속성입니다. 웹 서비스 포트의 이름을 지정하기 위해 사용됩니다.
  • namespace: 이 속성은 선택사항입니다. 웹 서비스 포트의 네임스페이스를 지정하는 데 사용됩니다. namespace 속성이 존재하면, 바인딩은 동일한 이름 및 네임스페이스가 있는 포트에 적용됩니다. 그렇지 않으면 바인딩은 동일한 이름의 포트에 적용됩니다.
  • address: 이 속성은 선택사항입니다. 웹 서비스 포트의 주소를 지정하기 위해 사용됩니다. 존재하면, service-ref 요소에 정의된 port-address 속성의 값보다 우선합니다.
  • username: 이 속성은 선택사항입니다. 이 속성은 기본 인증을 위한 사용자 이름을 지정하기 위해 사용됩니다.
  • password: 이 속성은 선택사항입니다. 이 속성은 기본 인증을 위한 비밀번호를 지정하기 위해 사용됩니다. 비밀번호는 인코드할 수 있습니다.
  • ssl-ref: 이 속성은 선택사항입니다. 이 속성은 id 속성을 사용하여 server.xml 파일에서 구성된 ssl 요소를 참조합니다. 속성이 지정되지 않았지만 서버가 ssl-1.0 기능을 사용하여 전송 레벨 보안을 지원하는 경우, 서비스 클라이언트는 Liberty의 기본 SSL 구성을 사용합니다.
  • key-alias: 이 속성은 선택사항입니다. 이 속성은 클라이언트 인증서의 별명을 지정하기 위해 사용됩니다. 속성을 지정하지 않고 웹 서비스 제공자가 클라이언트 인증서를 지원하는 경우, 키 저장소에서 첫 번째 인증은 이 속성의 값으로서 사용됩니다. 속성은 또한 server.xml 파일의 ssl 요소에 정의된 clientKeyAlias 속성을 대체할 수도 있습니다.

<properties>

이 요소는 웹 서비스 엔드포인트 또는 클라이언트의 특성을 정의하는 데 사용됩니다. 속성은 어떤 이름이나 어떤 값도 가능합니다.
  • 웹 서비스 클라이언트의 경우, client.ConnectionTimeout, authorization.UserName, tlsClientParameters.disableCNcheck 및 기타 특성을 지정할 수 있습니다.
  • 웹 서비스 엔드포인트의 경우 publishedEndpointUrl, org.apache.cxf.wsdl.create.imports 및 기타 속성을 지정할 수 있습니다.
다음 예재는 ibm-ws-bnd.xml 파일의 일반적 구성을 보여줍니다.
<?xml version="1.0" encoding="UTF-8"?>
<webservices-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" 
					  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
					  xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ws-bnd_1_0.xsd"
						version="1.0">
    
    <!-- optional Web service endpoint default properties -->
    <webservice-endpoint-properties org.apache.cxf.wsdl.create.imports="true" ... />

    <!-- 0 to many endpoint descriptions -->
    <webservice-endpoint port-component-name="..." address="optional override address">
        <!-- optional Web service endpoint properties -->
        <properties publishedEndpointUrl="http://www.example.com/services/hello" 
					org.apache.cxf.wsdl.create.imports="false" />
    </webservice-endpoint>
    ...

    <!-- optional http publishing module overrides -->
    <http-publishing context-root="optional override of module's context root">
        <!-- optional web.xml fragment for security -->
        <webservice-security>    
            <!-- SECURITY CONSTRAINTS -->
            <security-constraint>
                <web-resource-collection>
                    <web-resource-name>SayHelloServiceName</web-resource-name>
                    <url-pattern>/SayHelloService</url-pattern>
                </web-resource-collection>
                <auth-constraint>
                    <description>SayHelloServiceAuth</description>
                    <role-name>group123</role-name>
                </auth-constraint>
                <user-data-constraint>
                    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
                </user-data-constraint>
            </security-constraint>
            <!-- SECURITY CONSTRAINTS -->
            <security-constraint>
                <web-resource-collection>
                    <web-resource-name>SecuredSayHelloServiceName</web-resource-name>
                    <url-pattern>/Secured*</url-pattern>
                </web-resource-collection>
                <auth-constraint>
                    <description>SecuredSayHelloServiceAuth</description>
                    <role-name>group123</role-name>
                </auth-constraint>
                <user-data-constraint>
                    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
                </user-data-constraint>
            </security-constraint>
            <!-- SECURITY ROLES -->
            <security-role id="group123_id">
                <role-name>group123</role-name>
            </security-role>
            <!-- AUTHENTICATION METHOD: Client certificate or basic authentication -->
            <login-config>
                <auth-method>BASIC</auth-method>
            </login-config>
        </webservice-security>
    </http-publishing>
       
    <!-- 0 to many client refs -->
    <service-ref name="services/sayHelloService" 
			port-address="http://productServer:productPort/context-root/SayHelloService"/>
    <service-ref name="services/securedSayHelloService" 
			port-address="http://productServer:productPort/context-root/SecuredSayHelloService" 
			wsdl-location="optional override of WSDL document" />
</webservices-bnd>

주제의 유형을 표시하는 아이콘 참조 주제

파일 이름: rwlp_jaxws_bnd.html