I installed the app-schema JARs and the tutorial data directory on a local GeoServer 2.12.2 instance.
Doing (an abbreviated version of) the demo query from http://docs.geoserver.org/latest/en/user/data/app-schema/tutorial.html#installation results in a broken document:
$ curl 'http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=gsml:MappedFeature&maxFeatures=1' | xml fo
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tut="http://example.org/tutorial" xmlns:gml="http://www.opengis.net/gml" xmlns:gsml="urn:cgi:xmlns:CGI:GeoSciML:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberOfFeatures="1" timeStamp="2018-03-14T11:00:23.512Z" xsi:schemaLocation="urn:cgi:xmlns:CGI:GeoSciML:2.0 http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<gml:featureMember>
<gsml:MappedFeature gml:id="mf.25699">
<gml:name>Some basalt</gml:name>
<gml:name>urn:x-test:GeologicUnit:16777549126931093</gml:name>
<gsml:observationMethod>
<gsml:CGI_TermValue>
<gsml:value codeSpace="urn:ietf:rfc:2141">urn:ogc:def:nil:OGC:missing</gsml:value>
</gsml:CGI_TermValue>
</gsml:observationMethod>
<gsml:positionalAccuracy>
<gsml:CGI_TermValue>
<gsml:value codeSpace="urn:ietf:rfc:2141">urn:ogc:def:nil:OGC:missing</gsml:value>
</gsml:CGI_TermValue>
</gsml:positionalAccuracy>
<gsml:specification href="urn:x-test:GeologicUnit:16777549126931093"/>
<gsml:shape>
<gml:Polygon srsDimension="2" srsName="http://www.opengis.net/def/crs/EPSG/0/4283">
<gml:exterior>
<gml:LinearRing srsDimension="2">
<gml:posList>-38.532217 143.561948 -38.53336 143.561012 -38.52647 143.549986 -38.532217 143.561948</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</gsml:shape>
</gsml:MappedFeature>
</gml:featureMember>
</wfs:FeatureCollection>
Note missing xlink namespace on href attribute of gsml:specification, and missing xmlns:xlink namespace prefix declaration on the root element.
I actually ran into this issue with a custom schema. A proximate cause for missing namespace prefix declaration seems to be that the namespace prefixes declared in AppSchemaDataAccess/namespaces are never added to the XSD Schema when the Encoder is created in GML3OutputFormat.
|