Transaction Response

Feedback


Response description

In response to a transaction request, the Network Element Service generates an XML document indicating the final status of the transaction. In addition, if the transaction request includes an <Insert> operation, the network element service must report all newly created element identifiers. If the transaction is change password failed, the network element service also asserts in the response.

The XML-encoded WFS transaction response is defined by the following XML schema predicate:

<xsd:element name="WFS_TransactionResponse"

                       type="wfs:WFS_TransactionResponseType"/>

<xsd:complexType name="WFS_TransactionResponseType">

      <xsd:sequence>

            <xsd:element name="InsertResult"

                                   type="wfs:InsertResultType"

                                   minOccurs="0" maxOccurs="unbounded"/>

             <xsd:element name="TransactionResult"

                                    type="wfs:TransactionResultType"/>

      </xsd:sequence>

      <xsd:attribute name="version"

                              type="xsd:string" use="required" fixed="1.0.0"/>

</xsd:complexType>

<xsd:complexType name="TransactionResultType">

      <xsd:sequence>

            <xsd:element name="Status" type="wfs:StatusType"/>

            <xsd:element name="Locator" type="xsd:string" minOccurs="0"/>

            <xsd:element name="Message" type="xsd:string" minOccurs="0"/>

      </xsd:sequence>

      <xsd:attribute name="handle" type="xsd:string" use="optional"/>

</xsd:complexType>

<xsd:complexType name="InsertResultType">

      <xsd:sequence>

            <xsd:element ref="ogc:FeatureId" maxOccurs="unbounded"/>

      </xsd:sequence>

      <xsd:attribute name="handle" type="xsd:string" use="optional"/>

</xsd:complexType>

<xsd:complexType name="StatusType">

     <xsd:choice>

            <xsd:element ref="wfs:SUCCESS"/>

            <xsd:element ref="wfs:FAILED"/>

            <xsd:element ref="wfs:PARTIAL"/>

      </xsd:choice>

</xsd:complexType>

<xsd:element name="SUCCESS" type="wfs:EmptyType"/>

<xsd:element name="FAILED" type="wfs:EmptyType"/>

<xsd:element name="PARTIAL" type="wfs:EmptyType"/>

The <WFS_Transaction Response> element contains zero or more <InsertResult> elements and one <TransactionResult> element.

The <InsertResult> element contains the element identifiers of one or more newly created element instances. A <InsertResult> element reports the results of a <Insert> element in a request. The order in which <Insert> results are reported follows the order of operations in the <Transaction> element. In addition, they can be associated with each other if the handle attribute is specified.

All results of the transaction request are specified using the <TransactionResult> element. The <TransactionResult> element must contain a <Status> element. It can contain a <Locator> element and a <Message> element.

The <Status> element is used to indicate the status of the completion of a transaction, which has the following end status:

Response status Description
SUCCESS The transaction is fully completed.
FAILED An exception occurred while transacting one or more elements in the request.
PARTIAL The transaction was partially successful and the data may be in an inconsistent state. When the system does not support atomic transactions, it is quite possible to output a partially successful result.

When a transaction request fails, the <Locator> element is used to indicate which part of the transaction failed. If the element that failed is marked with the handle attribute, the network element service reports its value to locate the failure. Otherwise, the element service locates the failure from the beginning of the transaction request, using a line number or other convenient mechanism.

The <Message> element is used to report an error message.

 

Response example

In the Request example , the response results of adding, updating, and deleting elements are as follows:

  1. Adding element request, the server-side returns the corresponding XML text as follows:

<?xml version="1.0" encoding="UTF-8"?>

<wfs:WFS_TransactionResponse version="1.0.0"

        xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://www.opengis.net/wfs null">

        <wfs:InsertResult>

                <ogc:FeatureId fid="World.Capitals.164" />

        </wfs:InsertResult>

        <wfs:TransactionResult>

                <wfs:Status>

                        <wfs:SUCCESS />

                </wfs:Status>

        </wfs:TransactionResult>

</wfs:WFS_TransactionResponse>

  1. Updating element request , the XML text returned by the server is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<wfs:WFS_TransactionResponse version="1.0.0"

        xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://www.opengis.net/wfs null">

        <wfs:TransactionResult>

                <wfs:Status>

                        <wfs:SUCCESS />

                </wfs:Status>

        </wfs:TransactionResult>

</wfs:WFS_TransactionResponse>

  1. Deleting the element request , and the XML text returned by the server is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<wfs:WFS_TransactionResponse version="1.0.0"

        xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://www.opengis.net/wfs null">

        <wfs:TransactionResult>

                <wfs:Status>

                        <wfs:SUCCESS />

                </wfs:Status>

        </wfs:TransactionResult>

</wfs:WFS_TransactionResponse>