DescribeFeatureType dft =
new DescribeFeatureType(geoServer.getService(WFSInfo.class), catalog);
FeatureTypeInfo[] featureTypes = dft.run(request);
//generate the response
XmlSchemaEncoder schemaEncoder = null;
switch(ver) {
case V_10:
schemaEncoder = new XmlSchemaEncoder.V10(geoServer);
break;
case V_11:
schemaEncoder = new XmlSchemaEncoder.V11(geoServer);
break;
case V_20:
default:
schemaEncoder = new XmlSchemaEncoder.V20(geoServer);
}
//build a "dummy" operation descriptor and call the encoder
Operation op = new Operation("DescribeFeatureType", new Service("WFS",null,null,null),
null, new Object[]{request.getAdaptee()});
ByteArrayOutputStream bout = new ByteArrayOutputStream();
schemaEncoder.write(featureTypes, bout, op);
return new ByteArrayInputStream(bout.toByteArray());
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Unable to handle DescribeFeatureType uri: " + uri, e);
}