HTTP 콘딧 클라이언트 특성 및 사용자 사용자 정의 특성 사용

Liberty에서 JAX-WS 애플리케이션에 대한 ibm-ws-bnd.xml 파일을 사용하여 HTTP 클라이언트 특성 및 사용자 정의 특성을 정의할 수 있습니다.

시작하기 전에

ibm-ws-bnd.xml 파일은 웹 기반 웹 서비스 애플리케이션(WAR 파일)의 /WEB-INF 디렉토리 또는 EJB 기반 웹 서비스 애플리케이션(JAR 파일)의 /META-INF 디렉토리에 있어야 합니다. 클라이언트가 clientContainer에서 실행 중인 경우, ibm-ws-bnd.xml 파일이 클라이언트 EAR에 있는 JAR 파일의 /META-INF 디렉토리에 있어야 합니다.

이 태스크 정보

HTTP 클라이언트 특성 및 사용자 정의 특성은 @WebServiceRef 어노테이션에 의해 삽입되는 특정 서비스 클라이언트 또는 포트에 대한 ibm-ws-bnd.xml 파일에서 service-refport 요소를 사용하여 정의할 수 있습니다. port 요소의 특성은 service-ref 요소에서 동일한 특성을 대체합니다.
HTTP 클라이언트 특성
다음 HTTP 클라이언트 특성이 Liberty에서 지원됩니다. 이러한 특성에는 http.conduit.client 접두부가 있어야 합니다. (예: http.conduit.client.ConnectionTimeout). SOAP 메시지를 보내거나 수신하는 경우에만 다음 HTTP 클라이언트 특성이 올바릅니다. 이 특성은 WSDL URL에 연결할 때 적용할 수 없습니다.
  • ConnectionTimeout
  • ReceiveTimeout
  • AsyncExecuteTimeout
  • AsyncExecuteTimeoutRejection
  • AutoRedirect
  • MaxRetransmits
  • AllowChunking
  • ChunkingThreshold
  • Connection
  • DecoupledEndpoint
  • ProxyServer
  • ProxyServerPort
  • ProxyServerType
  • NonProxyHosts
이러한 특성에 대한 자세한 정보는 Apache CXF의 HTTP 구성 스키마클라이언트 HTTP 전송(SSL 지원 포함)을 참조하십시오.
사용자 정의 특성
Liberty에서 지원되는 HTTP 클라이언트 특성 외에, 애플리케이션에서 사용될 수 있는 사용자 정의 특성을 정의하고 클라이언트 요청 컨텍스트에서 이러한 특성을 검색할 수 있습니다. properties 요소에 정의된 모든 속성은 서비스 클라이언트 요청 컨텍스트에 놓입니다.

ibm-ws-bnd.xml 파일에서 구성할 수 있는 사용 가능한 모든 요소에 대해서는 ibm-ws-bnd.xml 파일의 내용을 참조하십시오.

프로시저

  1. HTTP 콘딧 특성을 구성하십시오. 다음 예제는 ibm-ws-bnd.xml 파일에서 HTTP 클라이언트 특성 ConnectionTimeoutReceiveTimeout을 구성하는 방법을 보여줍니다. 다음 예제는 @WebServiceRef(name="service/SimpleEchoService")를 사용하여 삽입된 서비스 클라이언트의 모든 포트에 대해, 그리고 SimpleEchoPort 포트에 대해 HTTP 클라이언트 특성 ConnectionTimeoutReceiveTimeout을 적용하는 방법을 보여줍니다. 사용자 정의 특성 vendor의 값도 적용됩니다.
    <?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">
    	<service-ref name="service/SimpleEchoService">
    		<port name="SimpleEchoPort">
    			<properties vendor="IBM" />
    		</port>    
    		<properties http.conduit.client.ConnectionTimeout="10000" 
    			http.conduit.client.ReceiveTimeout="15000" />
    	</service-ref>
    	...
    </webservices-bnd>
  2. 그런 다음 다음과 같이 @WebServiceRef(name="service/SimpleEchoService") 어노테이션에 의해 삽입되는 클라이언트의 요청 컨텍스트에서 ibm-ws-bnd.xml 파일에 정의된 특성을 검색하십시오.
    @WebServiceRef(name="service/SimpleEchoService")
    private EchoService echoService;
       ...
    Echo echo = echoService.getEchoPort();
    BindingProvider bp = (BindingProvider)echo;
    String connTimeout = bp.getRequestContext().get("http.conduit.client.ConnectionTimeout").toString(); 
    String recTimeout = bp.getRequestContext().get("http.conduit.client.ReceiveTimeout").toString(); 
    String vendor = bp.getRequestContext().get("vendor").toString(); 
    		...

주제의 유형을 표시하는 아이콘 태스크 주제

파일 이름: twlp_dep_jaxws_http_conduit.html