final GetMapRequest getMapRequest = (GetMapRequest) reader.read(
(GetMapRequest) reader.createRequest(), kvp, raw);
getMapRequest.setBaseUrl(RESTUtils.getBaseURL(request));
// delegate to wms reflector
final GetMapResponse getMapResponse = webMapService
.reflect(getMapRequest);
// wrap response in a reslet output rep
OutputRepresentation output = new OutputRepresentation(
new MediaType("application/vnd.google-earth.kml+xml")) {
public void write(OutputStream outputStream) throws IOException {
try {
getMapResponse.execute(getMapRequest);
getMapResponse.writeTo(outputStream);
} catch (IOException ioe) {
throw ioe;
} catch (Exception e) {
PrintStream printStream = new PrintStream(outputStream);
printStream.println("Unable to index feature due to: "