I am using the Apache Wink REST Client in my Java EE application running in WebSphere Liberty Profile to call external services. There are two separate services that I need to call. Calls to the first service always works.
Calls to the second service only work once, and from then on I always get a "Connection reset" error unless I recycle my WLP server. The only difference I see between the one that works and the one that doesn't, is that the failing one has the 'Connection: Keep-Alive' header in the response.
Could the Keep-Alive be causing the issue? Is there some way to handle or override that from the REST client? I have all the Wink REST client code in one method, and it never reuses any of the objects such as RestClient, Resource, ClientResponse, etc. - I always get new objects every time.