[Geoserver-devel] [jira] (GEOS-6469) WCS Capabilities request with acceptversions and sectios is not parsed properly

Andrea Aime created an issue

GeoServer / BugGEOS-6469

WCS Capabilities request with acceptversions and sectios is not parsed properly

Issue Type:

BugBug

Assignee:

Andrea Aime

Created:

01/May/14 4:28 AM

Priority:

MajorMajor

Reporter:

Andrea Aime

http://localhost:8080/geoserver/ows?service=WCS&request=GetCapabilities&sections=OperationsMetadata,Contents&ACCEPT_VERSIONS=1.1.1

Results in:

Caused by: java.lang.ClassCastException: net.opengis.ows11.impl.SectionsTypeImpl cannot be cast to net.opengis.ows20.SectionsType
	at net.opengis.ows20.impl.GetCapabilitiesTypeImpl.eSet(GetCapabilitiesTypeImpl.java:409)
	at net.opengis.wcs20.impl.GetCapabilitiesTypeImpl.eSet(GetCapabilitiesTypeImpl.java:148)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1081)

To be noted, the code already had a work around for the acceptversions parsing, but not the sections one:

public class WcsGetCapabilitiesRequestReader extends EMFKvpRequestReader {
    public WcsGetCapabilitiesRequestReader() {
        super(GetCapabilitiesType.class, Wcs111Factory.eINSTANCE);
    }

    public Object read(Object request, Map kvp, Map rawKvp) throws Exception {
        // make sure we get the right accepts versions param -> workaround for GEOS-1719
        if(rawKvp.containsKey("acceptVersions")) {
            AcceptVersionsKvpParser avp = new AcceptVersionsKvpParser();
            AcceptVersionsType avt = (AcceptVersionsType) avp.parse((String) rawKvp.get("acceptVersions"));
            kvp.put("acceptVersions", avt);
        }
        request = super.read(request, kvp, rawKvp);

        return request;
    }
}

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v6.1.6#6162-sha1:7af547c)

Atlassian logo