try {
delegate.encode(xmls);
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw new WPSException("An error occurred while encoding "
+ "the results of the process", e);
}
} else if(rawResult instanceof CDataEncoderDelegate) {
try {
((CDataEncoderDelegate) rawResult).encode(output);
} catch(Exception e) {
throw new WPSException("An error occurred while encoding "
+ "the results of the process", e);
}
} else if(rawResult instanceof BinaryEncoderDelegate) {
try {
((BinaryEncoderDelegate) rawResult).encode(output);
} catch(Exception e) {
throw new WPSException("An error occurred while encoding "
+ "the results of the process", e);
}
} else {
throw new WPSException("Cannot encode an object of class "
+ rawResult.getClass() + " in raw form");
}
}