Vantiv/litle-sdk-for-java

Remove dependency on CXF

Closed this issue · 1 comments

Litle client has a dependency on CXF that seems completely unnecessary. There's one line of code at the end that copies from the response (InputStream) into a String, using an IOUtils. This brings the whole CXF framework as a dependency. And in case you have your client running with other JAX-WS or JAX-RS framework, it will simply not work due some nasty classpath problems.

We fixed this by upgrading to the httpclient 4 which has a nice EntityUtils.toString(Inputstream) method.

I've created a gist at: https://gist.github.com/3939957 with that.

Please note we could make this even beter by making the HttpClient a private variable, and just creating BasicContext per invocation.

Regards

8.14.0 will not have the cxf dependency, and has an updated dependency on HTTPClient 4.0.1. Based on the pull request #3, we have also pulled the creation of HttpClient into the Communication constructor. This speeds up performance, and avoids a concurrent connection problem.