Mime type issue with Geoserver and Spring
Trying to code a simple client for OGC WFS implemented with GeoServer I got the exception: Invalid mime type "text/xml; subtype=gml/2.1.2": Invalid token character '/' in token "gml/2.1.2" The source of the problem is Content-Type header value - " text/xml; subtype=gml/2.1.2 ", which makes Spring insane when getContentType() is executed. How to deal with that? Create the following custom RestTemplate that replaces "text/xml; subtype=gml/2.1.2" with "text/xml" : class WfsRestTemplate extends RestTemplate { @Override protected <T> T doExecute(URI url, HttpMethod method, RequestCallback callback, final ResponseExtractor<T> responseExtractor) throws RestClientException { return super.doExecute(url, method, callback, response -> { response.getHeaders().setContentType(MediaType.TEXT_XML); return resp...