Implementing a client by using the unmanaged RESTful web services JAX-RS 2.0 client
WebSphere® Application Server provides a thin Java™ Platform, Standard Edition 8 (Java SE 8) RESTful web services client run time to enable application developers to quickly and easily create JAX-RS client applications. The Thin Client for JAX-RS with WebSphere Application Server is a stand-alone Java SE 8 client environment that enables running unmanaged JAX-RS RESTful web services client applications in a non-WebSphere environment to invoke JAX-RS RESTful web services that are hosted by the application server.
Before you begin

Before you set up a JAX-RS unmanaged client execution environment, obtain the Thin Client for JAX-RS Java archive (JAR) file. To obtain the Thin Client for JAX-RS, install WebSphere Application Server Version 9.0 or the Application Client for WebSphere Application Server Version 9.0. The Thin Client for JAX-RS JAR file, com.ibm.jaxrs2.0.thinclient_9.0.jar, is located in the app_server_root\runtimes directory.
Copy the Thin Client for JAX-RS com.ibm.jaxrs2.0.thinclient_9.0.jar file to other machines to create a lightweight client environment that enables communications with the product. Copies of the Thin Client for JAX-RS are subject to the same terms and conditions of the license agreement for the WebSphere product where you obtained the Thin Client for JAX-RS. Refer to the license agreements for correct usage and other limitations.
The Thin Client for JAX-RS works with IBM® Software Development Kits (SDKs) Version 8.0 and higher. The Thin Client for JAX-RS is also supported on non-IBM software development kits that are V8.0 and higher.
About this task
Procedure
What to do next
- Use com.ibm.ws.jaxrs.client.connection.timeout and
com.ibm.ws.jaxrs.client.receive.timeout Thin Client properties to set the timeout
values.
- com.ibm.ws.jaxrs.client.connection.timeout
javax.ws.rs.client.ClientBuilder cb = ClientBuilder.newBuilder(); cb.property("com.ibm.ws.jaxrs.client.connection.timeout", "1000"); Client c = cb.build();
- com.ibm.ws.jaxrs.client.receive.timeout
javax.ws.rs.client.ClientBuilder cb = ClientBuilder.newBuilder(); cb.property("com.ibm.ws.jaxrs.client.receive.timeout", "1000"); Client c = cb.build();
Tip: The value of the timeout property is millisecond, and the type must be long or integral. If the type of the value is invalid, the following message is displayed:CWTRS0700E: The timeout value {0} that you specified in the property com.ibm.ws.jaxrs.client.receive.timeout on the JAX-RS Client side is invalid. The value is set to default 30000. {3}
- com.ibm.ws.jaxrs.client.connection.timeout
- Use the following Thin Client properties for Thin Client proxy support:
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.portTip: The type of the proxy server port value must be integral. The default value is 80. If the value type is invalid, the following message is displayed:
CWTRS0701E: 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.typeTip: The value of the proxy server type must be HTTP or SOCKS. The default value is HTTP. If the type of the proxy server is invalid, the following message is displayed:
CWTRS0702E: 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}
- Configure the JAX-RS 2.0 client to validate LTPA token authentication information.
- Secure JAX-RS thin client by using SSL.
- Use the com.ibm.ws.jaxrs.client.disableCNCheck Thin Client property to
disable the common name
check.
ClientBuilder cb = ClientBuilder.newBuilder(); cb.property("com.ibm.ws.jaxrs.client.disableCNCheck", true);