Transaction Response

Feedback


Response introduction

In response to a transaction request, a web feature service shall generate an XML document indicating the termination status of the transaction. In addition, if the transaction request includes <Insert> operations, then the web feature service must report the feature identifiers of all newly created features.

The TransactionResponse element is the root element of the response result from implementing the Transaction request.

<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>

TransactionSummary: The TransactionSummary element contains a count of the number of features created, modified , replaced or deleted by the actions in a Transaction request. Only features of the types listed in the web feature service's capabilities document shall be counted when generating this summary.

InsertResults: If a transaction request contains insert actions then the InsertResults element shall be specified in the transaction response. The InsertResults element contains one or more Feature elements that indicate the feature identifiers of newly created feature instances. One Feature element shall be reported for each newly created feature instance. In addition, the Feature elements shall be presented in the order in which the insert actions were encountered in the Transaction element.

UpdateResults: If a transaction request contains update actions and the server supports versioning, then the UpdateResults element shall be specified in the transaction response to report which features have been changes and what their new identifiers are. The UpdateResults element contains one or more Feature elements that indicate the new feature identifiers of the updated feature instances. In addition, the Feature elements shall be presented in the order in which the update actions were encountered in the Transaction element.

ReplaceResults: If a transaction request contains replace actions and the server supports versioning, then the ReplaceResults element shall be specified in the transaction response to report which features have been replaced and what their new identifiers are. The ReplaceResults element contains one or more Feature elements that indicate the new feature identifiers of the replaced feature instances. In addition, the Feature elements shall be presented in the order in which the replace actions were encountered in the Transaction element.

Response example

In request examples, results for adding, updating, replacing, deleting features are as follows:

  1. Add feature request, the returned xml document returned from the server is as follows:

<?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: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>

  1. Update feature request, the returned xml document returned from the server is as follows:

<?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>

  1. Replace feature request, the returned xml document returned from the server is as follows:

<?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>

  1. Delete feature request, the returned xml document returned from the server is as follows:

<?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>