this.generateDebugOutput();
return;
}
/* Call up the remote HTTP server */
HttpConnection connection = new HttpConnection(this.method.getHostConfiguration());
HttpState state = new HttpState();
this.method.setFollowRedirects(true);
int status = this.method.execute(state, connection);
if (status == 404) {
throw new ResourceNotFoundException("Unable to access \"" + this.method.getURI()
+ "\" (HTTP 404 Error)");
} else if ((status < 200) || (status > 299)) {
throw new IOException("Unable to access HTTP resource at \""
+ this.method.getURI().toString() + "\" (status=" + status + ")");
}
InputStream response = this.method.getResponseBodyAsStream();
/* Let's try to set up our InputSource from the response output stream and to parse it */
SAXParser parser = null;
try {
InputSource inputSource = new InputSource(response);
parser = (SAXParser) this.manager.lookup(SAXParser.ROLE);
parser.parse(inputSource, super.xmlConsumer);
} catch (ServiceException ex) {
throw new ProcessingException("Unable to get parser", ex);
} finally {
this.manager.release(parser);
this.method.releaseConnection();
connection.close();
}
}