// the 'response' object we'll pass to our OutputFormat
FeatureCollectionType features = WfsFactory.eINSTANCE.createFeatureCollectionType();
// the 'request' object we'll pass to our OutputFormat
GetFeatureType gfreq = WfsFactory.eINSTANCE.createGetFeatureType();
gfreq.setBaseUrl(fInfoReq.getBaseUrl());
for (Iterator i = results.getFeature().iterator(); i.hasNext();) {
SimpleFeatureCollection fc = (SimpleFeatureCollection) i.next();
features.getFeature().add(fc);
QueryType qt = WfsFactory.eINSTANCE.createQueryType();
String crs = GML2EncodingUtils.epsgCode(fc.getSchema().getCoordinateReferenceSystem());
if (crs != null) {
final String srsName = "EPSG:" + crs;
try {
qt.setSrsName(new URI(srsName));
} catch (URISyntaxException e) {
throw new ServiceException(
"Unable to determite coordinate system for featureType "
+ fc.getSchema().getTypeName() + ". Schema told us '"
+ srsName + "'", e);
}
}
gfreq.getQuery().add(qt);
}
// this is a dummy wrapper around our 'request' object so that the new Dispatcher will
// accept it.