I am trying to implement a transactional WFS. For now, I am only focusing on supporting the insert operation.
I have been able to successfully parse the insert XML posted by QGIS to my endpoint, but I am unable to create an output XML document to signal QGIS that the operation was successful. QGIS throws "Unhandled response: TransactionResponse"
upon receiving my response. I have based the response schema on OGC's documentation and currently don't see a mismatch.
Below is an example input XML posted by QGIS.
<?xml version="1.0" encoding="UTF-8"?>
<Transaction xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://localhost:7554/?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=1.0.0&TYPENAME=ExampleLayerName" version="1.0.0" service="WFS">
<Insert>
<ExampleLayerName>
<geom>
<gml:Polygon srsName="EPSG:4326">
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates ts=" " cs=",">-67.41570626436781311,-20.93247614942528756 -67.44912965517241332,-21.50067379310344862 -66.94777879310343849,-20.96589954022988422 -67.41570626436781311,-20.93247614942528756</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</geom>
</Distritos>
</Insert>
</Transaction>
Below is the generated response XML by my endpoint.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wfs:TransactionResponse xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:fes="http://www.opengis.net/fes/2.0"
xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0"
xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://localhost:8080/geoserver/schemas/wfs/2.0/wfs.xsd">
<wfs:TransactionSummary>
<wfs:totalInserted>1</wfs:totalInserted>
<wfs:totalUpdated>0</wfs:totalUpdated>
<wfs:totalReplaced>0</wfs:totalReplaced>
<wfs:totalDeleted>0</wfs:totalDeleted>
</wfs:TransactionSummary>
<wfs:InsertResults>
<wfs:Feature>
<fes:ResourceId rid="0" />
</wfs:Feature>
</wfs:InsertResults>
</wfs:TransactionResponse>
EDIT:
Part of the GetCapabilities
document:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wfs:WFS_Capabilities xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wfs/2.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0.0" updateSequence="1913">
<ows:ServiceIdentification>
<ows:Title>My WFS</ows:Title>
<ows:Abstract>My WFS</ows:Abstract>
<ows:ServiceType>WFS</ows:ServiceType>
<ows:ServiceTypeVersion>2.0.0</ows:ServiceTypeVersion>
</ows:ServiceIdentification>
<ows:OperationsMetadata>
<ows:Operation name="Transaction">
<ows:DCP>
<ows:HTTP>
<ows:Get xlink:href="http://localhost:7554/v1/wfs/"/>
<ows:Post xlink:href="http://localhost:7554/v1/wfs/"/>
</ows:HTTP>
</ows:DCP>
<ows:Parameter name="inputFormat">
<ows:AllowedValues>
<ows:Value>application/gml+xml; version=3.2</ows:Value>
</ows:AllowedValues>
</ows:Parameter>
<ows:Parameter name="AcceptVersions">
<ows:AllowedValues>
<ows:Value>2.0.0</ows:Value>
</ows:AllowedValues>
</ows:Parameter>
</ows:Operation>
</ows:OperationsMetadata>
</wfs:WFS_Capabilities>