[Geoserver-devel] [JIRA] (GEOS-10558) DescribeFeatureType response contains mixed content when one type does not exist

Jason Newmoyer (SUB) created an issue

GeoServer / BugGEOS-10558

DescribeFeatureType response contains mixed content when one type does not exist

Issue Type:

BugBug

Affects Versions:

2.21.0

Assignee:

Unassigned

Components:

WFS

Created:

23/Jun/22 3:51 PM

Environment:

CentOS 7

Priority:

MediumMedium

Reporter:

Jason Newmoyer (SUB)

When invoking WFS 1.1.0 DescribeFeatureType using multiple types via TYPNAME param, if one of the layers is not available (or has some type of error when generating the schema), you’ll end up with mixed content in the response - basically you can end up with JSON with an XML exception concatenated to it as per below:

https://myserver/geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&outputFormat=application/json&TYPENAME=ngs:country_boundaries,ngs:land_polygons_simp

Response:

{"elementFormDefault":"qualified","targetNamespace":"http://newmoyergeospatial.com","targetPrefix":"ngs","featureTypes":[{"typeName":"country_boundaries","properties":[{"name":"gid","maxOccurs":1,"minOccurs":1,"nillable":false,"type":"xsd:int","localType":"int"},{"name":"geom","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"gml:MultiPolygon","localType":"MultiPolygon"},{"name":"scalerank","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:int","localType":"int"},{"name":"featurecla","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"labelrank","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"sovereignt","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"sov_a3","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"adm0_dif","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"level","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"type","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"admin","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"adm0_a3","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"geou_dif","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"geounit","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"gu_a3","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"su_dif","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"subunit","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"su_a3","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"brk_diff","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"name","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"name_long","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"brk_a3","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"brk_name","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"brk_group","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"abbrev","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"postal","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"formal_en","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"formal_fr","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"note_adm0","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"note_brk","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"name_sort","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"name_alt","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"mapcolor7","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"mapcolor8","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"mapcolor9","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"mapcolor13","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"pop_est","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"gdp_md_est","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"pop_year","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"lastcensus","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"gdp_year","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"economy","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"income_grp","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"wikipedia","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"fips_10","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"iso_a2","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"iso_a3","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"iso_n3","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"un_a3","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"wb_a2","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"wb_a3","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"woe_id","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"adm0_a3_is","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"adm0_a3_us","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"adm0_a3_un","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"adm0_a3_wb","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"continent","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"region_un","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"subregion","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"region_wb","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:string","localType":"string"},{"name":"name_len","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"long_len","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"abbrev_len","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"tiny","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"},{"name":"homepart","maxOccurs":1,"minOccurs":0,"nillable":true,"type":"xsd:number","localType":"number"}]},{"typeName":"land_polygons_simp"<?xml version="1.0" encoding="UTF-8"?><ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows https://10.0.1.64/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>java.io.IOException: Schema 'land_polygons_simp' does not exist.
Schema 'land_polygons_simp' does not exist.</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

The response’s Content-Type header is application/json, however this response will not parse with a JSON decoder.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100201-sha1:92d0e2d)

Atlassian logo