
![[8.5.5.6 이상]](../ng_v8556.gif)
JAX-RS 2.0 클라이언트 구성
Java API for XML RESTful Web Services 2.0에 대해 REST 엔드포인트에 액세스하도록 클라이언트를 구성할 수 있습니다. JAX-RS 2.0은 원격 RESTful 웹 서비스에 대한 http 요청을 작성할 수 있도록 새 표준화 클라이언트 API를 소개합니다.
이 태스크 정보
프로시저
다음에 수행할 작업
- com.ibm.ws.jaxrs.client.timeout 클라이언트 특성을 사용하여 제한시간 값을
설정하십시오.
javax.ws.rs.client.ClientBuilder cb = ClientBuilder.newBuilder(); cb.property("com.ibm.ws.jaxrs.client.timeout", "1000"); Client c = cb.build();
팁: 제한시간 특성의 값은 밀리초 단위이며 유형은 long 또는 int여야 합니다. 값의 유형이 올바르지 않으면 다음 메시지가 표시됩니다.CWWKW0700E: The timeout value {0} that you specified in the property com.ibm.ws.jaxrs.client.timeout on the JAX-RS Client side is invalid. The value is set to default 30000. {3}
- 클라이언트 프록시 지원을 위해 다음 클라이언트 특성을 사용하십시오.
ClientBuilder cb = ClientBuilder.newBuilder(); cb.property("com.ibm.ws.jaxrs.client.proxy.host", "hostname"); cb.property("com.ibm.ws.jaxrs.client.proxy.port", "8888";); cb.property("com.ibm.ws.jaxrs.client.proxy.type", "HTTP"); Client c = cb.build();
- com.ibm.ws.jaxrs.client.proxy.host
- com.ibm.ws.jaxrs.client.proxy.port팁: 프록시 서버 포트 값의 유형은 int여야 합니다. 기본값은 80입니다. 값 유형이 올바르지 않으면 다음 메시지가 표시됩니다.
CWWKW0701E: The proxy server port value {0} that you specified in the property com.ibm.ws.jaxrs.client.proxy.port on the JAX-RS Client side is invalid. The value is set to default 80. {3}
- com.ibm.ws.jaxrs.client.proxy.type팁: 프록시 서버 유형의 값은 HTTP 또는 SOCKS여야 합니다. 기본값은 HTTP입니다. 프록시 서버의 유형이 올바르지 않으면 다음 메시지가 표시됩니다.
CWWKW0702E: The proxy server type value {0} that you specified in the property com.ibm.ws.jaxrs.client.proxy.type on the JAX-RS Client side is invalid. The value is set to default HTTP. {3}
- com.ibm.ws.jaxrs.client.ltpa.handler 클라이언트 특성을 사용하여 SSO 쿠키를 설정하고 값을 true로 설정하십시오.
JAX-RS 2.0에서 SSL(Secure Sockets Layer) 함수를 사용하려면 ssl-1.0 또는 appSecurity-2.0 기능을 사용해야 합니다. LTPA 토큰 함수의 경우 appSecurity-2.0 기능은 필수입니다.ClientBuilder cb = ClientBuilder.newBuilder(); Client c = cb.build(); c.property("com.ibm.ws.jaxrs.client.ltpa.handler", "true");
참고: ssl-1.0 기능은 appSecurity-2.0 기능의 부기능입니다. jaxrsClient-2.0 기능 및 ssl-1.0 기능을 사용하는 경우 appSecurity-2.0 기능은 자동으로 사용됩니다. - com.ibm.ws.jaxrs.client.ssl.config 클라이언트 특성을 사용하여
server.xml의 SSL 참조 ID를 설정하십시오.
ClientBuilder cb = ClientBuilder.newBuilder(); cb.property("com.ibm.ws.jaxrs.client.ssl.config", "mySSLRefId"); Client c = cb.build();
참고: server.xml의 구성은 다음과 같습니다.<ssl id="mySSLRefId" keyStoreRef="clientKeyStore" trustStoreRef="clientTrustStore" />