httpclient.getParams().setParameter(AuthPNames.TARGET_AUTH_PREF, authpref);
}
if (_proxyHost != null) {
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, _proxyHost);
}
HttpBindingData httpRequest = _messageComposer.decompose(exchange, new HttpRequestBindingData());
HttpRequestBase request = null;
if (_httpMethod.equals(HTTP_GET)) {
request = new HttpGet(_baseAddress);
} else if (_httpMethod.equals(HTTP_POST)) {
request = new HttpPost(_baseAddress);
((HttpPost) request).setEntity(new InputStreamEntity(httpRequest.getBodyBytes(), httpRequest.getBodyBytes().available()));
} else if (_httpMethod.equals(HTTP_DELETE)) {
request = new HttpDelete(_baseAddress);
} else if (_httpMethod.equals(HTTP_HEAD)) {
request = new HttpHead(_baseAddress);
} else if (_httpMethod.equals(HTTP_PUT)) {
request = new HttpPut(_baseAddress);
((HttpPut) request).setEntity(new InputStreamEntity(httpRequest.getBodyBytes(), httpRequest.getBodyBytes().available()));
} else if (_httpMethod.equals(HTTP_OPTIONS)) {
request = new HttpOptions(_baseAddress);
}
Iterator<Map.Entry<String, List<String>>> entries = httpRequest.getHeaders().entrySet().iterator();
while (entries.hasNext()) {
Map.Entry<String, List<String>> entry = entries.next();
String name = entry.getKey();
List<String> values = entry.getValue();
for (String value : values) {