I need to read a WFS transaction from the client (OpenLayers) and do the appropriate action. I want to use geoTools! Is there a way to implement a wfs server?
Suppose I have a Transacion like this:
<wfs:Transaction service=”WFS” version=”1.0.0″
xmlns:myns=”http://www.domain.com/ns“
xmlns:ogc=”http://www.opengis.net/ogc”
xmlns:wfs=”http://www.opengis.net/wfs”>
<wfs:Update typeName=”myns:LayerToUpdate“>
<wfs:Property>
<wfs:Name>propertyToUpdate</wfs:Name>
<wfs:Value>updatedValue</wfs:Value>
</wfs:Property>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>constraintProperty</ogc:PropertyName>
<ogc:Literal>constraintValue</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Update>
</wfs:Transaction>
It will be appreciated If you suggest another way to do that!
HttpServletRequest request=...;
org.geotools.xml.parser.Parser parser = new Parser(new org.geotools.wfs.v1_1.WFSConfigration());
TransactionType tt = (TransactionType) parser.parse(request.getReader());
InsertElementType insert1 = (InsertElementType) tt.getInsert().get(0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With