Hi,
I'm attempting to port axis2 using commons-httpclient 3.1 to httpclient 4.0
locally. I have a few questions because in some instances I could not find
corresponding functionality in 4.0 version.
1) Is httpMethodBase.setDoAuthentication() still required in 4.0 ?
My understanding is that such a switch is no longer required, httpclient 4.0
requests will perform authentication by default if credentials are set and
authschemes are properly configured on the HttpClient object.
2) What about the Protocol interface implementations? The HostConfiguration
class also disappeared. I now use HttpHost to get equivalent functionality in
4.0. I cannot get equivalent functionality for missing Protocol class in
defunct HostConfiguration. Can somebody point in the right direction here?
3) Preemptive authentication feature. Before it was easy as:
httpClient.getParams().setAuthenticationPreemptive(true); what is easiest way
to migrate to 4.0 way of doing it ?
4) Reorder auth scheme priority. before you could do things such as:
List schemes = authenticator.getAuthSchemes();
authPrefs.add(AuthPolicy.BASIC);
authPrefs.add(AuthPolicy.NTLM);
httpClient.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY,
authPrefs);
I did not find such customizability in 4.0, any hints? Are all registered auth
scheme applied in indefinite order in 4.0?
5) connection management before you had to do:
try {
httpClient.executeMethod(config, method);
} finally {
method.releaseConnection();
}
to ensure the connection bound to the HttpMethodBase object is released. In 4.0
version, are connections always released by default whenever
httpClient.executeX() is called no matter the outcome? If not please give more
insight on how this works in 4.0.
Thank you!
-Guillaume
____________________________________________________________________________________________________
This electronic mail (including any attachments) may contain information that
is privileged, confidential, and/or otherwise protected from disclosure to
anyone other than its intended recipient(s). Any dissemination or use of this
electronic email or its contents (including any attachments) by persons other
than the intended recipient(s) is strictly prohibited. If you have received
this message in error, please notify us immediately by reply email so that we
may correct our internal records. Please then delete the original message
(including any attachments) in its entirety. Thank you.