Transaction Response |
In response to a Transaction transaction request, the WFS 2.0.0 service generates an XML document indicating the final status of the transaction. Also, if Transaction Insert element is included in the transaction request, the WFS 2.0.0 service needs to report the element identifier of all newly added elements.
Transaction Response is the root element of the response result after the transaction request is executed, as shown below:
<xsd:element name="TransactionResponse" type="wfs:TransactionResponseType" />
<xsd:complexType name="TransactionResponseType">
<xsd:sequence>
<xsd:element name="TransactionSummary" type="wfs:TransactionSummaryType" />
<xsd:element name="InsertResults" type="wfs:ActionResultsType"
minOccurs="0" />
<xsd:element name="UpdateResults" type="wfs:ActionResultsType"
minOccurs="0" />
<xsd:element name="ReplaceResults" type="wfs:ActionResultsType"
minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="version" type="xsd:string" use="required"
fixed="2.0.0" />
</xsd:complexType>
Transaction Summary: used to count the number of elements added, modified, replaced, or deleted after the transaction request is executed. Only operation Capabilities document, there is a Transaction Summary element.
InsertResults: If the Insert element is included in the Transaction transaction request, it is specified in the response result of the transaction request An InsertResults element that represents the result of an add feature operation. The InsertResults element can contain one or more Features Element. Newly added features are identified in each Feature element using a unique feature identifier. Newly added element in InsertResults element should press Insert The order of adding features specified in the operation is displayed.
Update Results: If the Update element is included in the Transaction transaction request, it is specified in the response results of the transaction request The Update Results element, which represents the result of an update element operation. The Update Results element can contain one or more Features Element. A unique feature identifier is used in each Feature element to identify the updated feature. Updated elements in the Update Results element should press Update The update feature order specified in the operation is displayed.
Replace Results: If the Transaction transaction request contains a replace Element, the ReplaceResults element is specified in the response result of the transaction request to represent the result of executing the replace element operation. ReplaceResults An element can contain one or more Feature elements. A unique feature identifier is used in each Feature element to identify the replaced feature. ReplaceResults The replaced features in the element should appear in the order of the replaced features specified in the Replace operation.
In the request example , the response results of adding, updating, replacing, and deleting elements are as follows:
<wfs:TransactionResponse xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" 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" version="2.0.0">
<wfs:TransactionSummary>
<wfs:totalInserted>2</wfs:totalInserted>
</wfs:TransactionSummary>
<wfs:InsertResults>
<wfs:Feature>
<fes:ResourceId rid="World.Capitals.193"/>
</wfs:Feature>
<wfs:Feature>
<fes:ResourceId rid="World.Capitals.194"/>
</wfs:Feature>
</wfs:InsertResults>
</wfs:TransactionResponse>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wfs:TransactionResponse xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" 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" version="2.0.0">
<wfs:TransactionSummary>
<wfs:totalUpdated>1</wfs:totalUpdated>
</wfs:TransactionSummary>
<wfs:UpdateResults>
<wfs:Feature>
<fes:ResourceId rid="World.Capitals.193"/>
</wfs:Feature>
</wfs:UpdateResults>
</wfs:TransactionResponse>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wfs:TransactionResponse xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" 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" version="2.0.0">
<wfs:TransactionSummary>
<wfs:totalReplaced>1</wfs:totalReplaced>
</wfs:TransactionSummary>
</wfs:TransactionResponse>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wfs:TransactionResponse xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" 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" version="2.0.0">
<wfs:TransactionSummary>
<wfs:totalDeleted>2</wfs:totalDeleted>
</wfs:TransactionSummary>
</wfs:TransactionResponse>