﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
16824	400 Bad Request Error with a WMS provider	naoliv	team	"Add a new WMS layer in JOSM with `http://bdgex.eb.mil.br/mapcache?service=WMS&request=GetCapabilities` as the URL, get the layers, choose any (the first `capitais (Capitais dos estados brasileiros.)`, for example) and then add this new layer in JOSM.

It only errors with HTTP 400 (Bad Request)

With `--trace` it's possible to see that the problem is related with an `unsuitable wms request: no <grid> with suitable srs found for layer capitais`

{{{
2018-10-08 17:41:54.646 DETALHADO: JCS - Caching empty object http://bdgex.eb.mil.br/mapcache?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=capitais&STYLES=&SRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=-5635549.8403892,-2348144.5468108,-5557278.3267892,-2269873.0332108
2018-10-08 17:41:54.646 DETALHADO: tileLoadingFinished() tile: Tile 10/184/285@http://bdgex.eb.mil.br/mapcache?: capitais (Capitais dos estados brasileiros.) [loaded] [ERROR] success: false
2018-10-08 17:41:54.700 INFORMAÇÕES: GET http://bdgex.eb.mil.br/mapcache?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=capitais&STYLES=&SRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=-5635549.8403892,-2348144.5468108,-5479006.8131892,-2191601.5196108 -> 400 (361 B)
2018-10-08 17:41:54.700 DETALHADO: RESPONSE: {null=[HTTP/1.1 400 Bad Request], Server=[Apache/2.4.10 (Debian)], Connection=[close], Vary=[Host], Content-Length=[361], Date=[Mon, 08 Oct 2018 20:41:54 GMT], Content-Type=[application/vnd.ogc.se_xml]}
2018-10-08 17:41:54.701 DETALHADO: java.io.IOException: Server returned HTTP response code: 400 for URL: http://bdgex.eb.mil.br/mapcache?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=capitais&STYLES=&SRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=-5635549.8403892,-2348144.5468108,-5479006.8131892,-2191601.5196108. Causa: java.io.IOException: Server returned HTTP response code: 400 for URL: http://bdgex.eb.mil.br/mapcache?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=capitais&STYLES=&SRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=-5635549.8403892,-2348144.5468108,-5479006.8131892,-2191601.5196108
2018-10-08 17:41:54.701 DETALHADO: Baixando dados...
2018-10-08 17:41:54.702 DETALHADO: Response body: 
2018-10-08 17:41:54.702 DETALHADO: <?xml version='1.0' encoding=""UTF-8"" standalone=""no"" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM ""http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd"">
<ServiceExceptionReport version=""1.1.1"">
<ServiceException>
<![CDATA[
received unsuitable wms request: no <grid> with suitable srs found for layer capitais
]]>
</ServiceException>
</ServiceExceptionReport>
}}}

Adding the same layer in QGIS it's possible to properly view the data, without doing anything.

JOSM:
{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-10-08 01:00:47 +0200 (Mon, 08 Oct 2018)
Revision:14306
Build-Date:2018-10-08 01:32:48
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (14306 pt_BR) Linux Debian GNU/Linux testing (buster)
Memory Usage: 759 MB / 6144 MB (215 MB allocated, but free)
Java version: 10.0.2+13-Debian-1, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1600x900, :0.1 1280x1024
Maximum Screen Size: 1600x1024
Java package: openjdk-10-jre:amd64-10.0.2+13-1
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-21
VM arguments: [-Dawt.useSystemAAFontSettings=gasp]
}}}"	defect	closed	normal		Core imagery		othersoftware	wms	wiktorn
