* @throws IOException
* @throws CascadingIOException
*/
protected byte[] readXMLResponse(Source source, byte[] binary, ServiceManager manager)
throws SAXException, IOException, CascadingIOException {
XMLizer xmlizer = null;
try {
XMLByteStreamCompiler serializer = new XMLByteStreamCompiler();
if (source instanceof XMLizable) {
((XMLizable) source).toSAX(serializer);
} else {
final String mimeType = source.getMimeType();
if (mimeType != null) {
xmlizer = (XMLizer) manager.lookup(XMLizer.ROLE);
xmlizer.toSAX(new ByteArrayInputStream(binary),
mimeType,
source.getURI(),
serializer);
}
}