Type responseEntityType,
Object requestEntity) {
ClientRequest request =
createClientRequest(method, responseEntity, responseEntityType, requestEntity);
HandlerContext context = createHandlerContext();
ProvidersRegistry providersRegistry = request.getAttribute(ProvidersRegistry.class);
ClientRuntimeContext runtimeContext = new ClientRuntimeContext(providersRegistry);
RuntimeContext saved = RuntimeContextTLS.getRuntimeContext();
RuntimeContextTLS.setRuntimeContext(runtimeContext);
try {
ClientResponse response = context.doChain(request);
int statusCode = response.getStatusCode();
if (ClientUtils.isErrorCode(statusCode)) {
logger.trace(Messages.getMessage("clientResponseIsErrorCode", String //$NON-NLS-1$
.valueOf(statusCode)));
throw new ClientWebException(request, response);