log.debug("Setting userAgent: " + userAgent);
httpget.addHeader(HttpHeaders.USER_AGENT, userAgent);
properties.put(HttpHeaders.USER_AGENT, userAgent);
}
ServiceDocument doc = null;
try {
HttpResponse response = client.execute(httpget);
StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode();
// store the status code
status = new Status(statusCode, statusLine.getReasonPhrase());
if (status.getCode() == HttpStatus.SC_OK) {
String message = readResponse(response.getEntity().getContent());
log.debug("returned message is: " + message);
doc = new ServiceDocument();
lastUnmarshallInfo = doc.unmarshall(message, properties);
} else {
throw new SWORDClientException(
"Received error from service document request: "
+ status);
}