@Override
public void write(Object value, OutputStream output, Operation operation) throws IOException,
ServiceException {
CSWRecordsResult result = (CSWRecordsResult) value;
RequestBaseType request = (RequestBaseType) operation.getParameters()[0];
CSWInfo csw = gs.getService(CSWInfo.class);
// check the output schema is valid
if (result.getRecords() != null) {
FeatureType recordSchema = result.getRecords().getSchema();
if (recordSchema != null && !recordType.equals(recordSchema)) {