/** */ public Wcs10CapsTransformer getCapabilities(GetCapabilitiesType request) { // do the version negotiation dance List<String> provided = new ArrayList<String>(); provided.add("1.0.0"); List<String> accepted = null; if (request.getVersion() != null) { accepted = new ArrayList<String>(); accepted.add(request.getVersion()); } String version = RequestUtils.getVersionPreOws(provided, accepted); if ("1.0.0".equals(version)) { Wcs10CapsTransformer capsTransformer = new Wcs10CapsTransformer(geoServer); capsTransformer.setEncoding( Charset.forName((getServiceInfo().getGeoServer().getSettings().getCharset()))); return capsTransformer; } throw new WcsException("Could not understand version:" + version); }
public void testBasic() throws Exception { String request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<wcs:GetCapabilities service=\"WCS\" updateSequence=\"1\" " + "xmlns:ows=\"http://www.opengis.net/ows/1.1\" " + "xmlns:wcs=\"http://www.opengis.net/wcs\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; // smoke test, we only try out a very basic request GetCapabilitiesType cap = (GetCapabilitiesType) reader.read(null, new StringReader(request), null); assertEquals("WCS", cap.getService()); assertEquals("1.0.0", cap.getVersion()); assertEquals("1", cap.getUpdateSequence()); }
@Test public void testBasic() throws Exception { String request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<wcs:GetCapabilities service=\"WCS\" updateSequence=\"1\" " + "xmlns:ows=\"http://www.opengis.net/ows/1.1\" " + "xmlns:wcs=\"http://www.opengis.net/wcs\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; // smoke test, we only try out a very basic request GetCapabilitiesType cap = (GetCapabilitiesType) reader.read(null, new StringReader(request), null); assertEquals("WCS", cap.getService()); assertEquals("1.0.0", cap.getVersion()); assertEquals("1", cap.getUpdateSequence()); } }