Response semantics Request .1 Request Semantics

76 Copyright © 2010 Open Geospatial Consortium

12.3.2 XML-encoding

The following XML Schema fragment defines the XML encoding of a LockFeature response: xsd:element name=LockFeatureResponse type=wfs:LockFeatureResponseType xsd:complexType name=LockFeatureResponseType xsd:sequence xsd:element name=FeaturesLocked type=wfs:FeaturesLockedType minOccurs=0 xsd:element name=FeaturesNotLocked type=wfs:FeaturesNotLockedType minOccurs=0 xsd:sequence xsd:attribute name=lockId type=xsd:string xsd:complexType xsd:complexType name=FeaturesLockedType xsd:sequence maxOccurs=unbounded xsd:element ref=fes:ResourceId xsd:sequence xsd:complexType xsd:complexType name=FeaturesNotLockedType xsd:sequence maxOccurs=unbounded xsd:element ref=fes:ResourceId xsd:sequence xsd:complexType In response to a LockFeature request, a web feature service shall generate a wfs:LockFeatureResponse element. This document shall contain a lock identifier that a client application may use in subsequent WFS operations to operate upon the set of locked feature instances. The response may also contain the optional elements wfs:FeaturesLocked and wfs:FeaturesNotLocked depending on the value of the lockAction attribute see 13.2.4.2. If the lock action is specified as ALL and all identified feature instances are successfully locked, a WFS shall respond with a wfs:WFS_LockFeatureResponse element that contains the wfs:FeaturesLocked element and no wfs:FeatureNotLocked element since either all identified feature instances may be locked or none at all. If some or all feature instances cannot be locked, a WFS shall respond with an exception indicating that the lock request failed because some or all feature instances are locked by other clients. If the lock action is specified as SOME, then the wfs:WFS_LockFeatureResponse element shall contain the wfs:FeaturesLocked and wfs:FeatureNotLocked elements. The wfs:FeaturesLocked element shall list the feature identifiers of all the feature instances that were locked by the LockFeature request. The wfs:FeaturesNotLocked element shall contain a list of feature identifiers for the feature instances that could not be locked by the web feature service possibly because they were already locked by someone else. If the lock request results in no features being locked, then a WFS shall respond with wfs:LockFeatureResponse document that contains a value for the lockId attribute but that contains neither a wfs:FeaturesLocked element nor a wfs:FeatureNotLocked element. In other words, an empty response. After the request is completed, the lockId shall be immediately released since no resources were locked. If that same lockId is used in a subsequent transaction an InvalidLockId exception shall be raised, as described in 7.5, since that lockId value no longer exists. No assumption is made about the format of the lock identifier. The only requirement is that it can be expressed in the character set of the transaction request.

12.4 Exceptions

If a WFS does not implement the LockFeature operation then it shall generate an OperationNotSupported exception, indicating that the operation is not supported, if such a request is encountered. In the event that a web feature service does support the LockFeature operation and encounters an error parsing the request, it shall raise an OperationParsingFailed exception as described in 7.5. In the event that a web feature service does support the LockFeature operation and encounters an error processing the request, it shall raise an OperationProcessingFailed exception as described in 7.5. Copyright © 2010 Open Geospatial Consortium 77 13 GetFeatureWithLock operation

13.1 Introduction

The GetFeatureWithLock operation is functionally similar to the GetFeature operation see Clause 11 except that in response to a GetFeatureWithLock operation, a WFS shall not only generate a response document similar to that of the GetFeature operation but shall also lock the features in the result set; presumably to update the features in a subsequent Transaction operation see Clause 15. 13.2 Request 13.2.1 Request Semantics Figure 22 describes the schema of a GetFeatureWithLock request. GetFeat ure + query [ 1..] : QueryExpression GetFeatureWithLock + expiry : TM_Duration = 300s + lockAction : LockAction = all Figure 22 — GetFeatureWithLock request 13.2.2 XML encoding The following XML Schema fragment declares the XML encoding for the GetFeatureWithLock operation: xsd:element name=GetFeatureWithLock type=wfs:GetFeatureWithLockType xsd:complexType name=GetFeatureWithLockType xsd:complexContent xsd:extension base=wfs:GetFeatureType xsd:attribute name=expiry type=xsd:positiveInteger default=300 xsd:attribute name=lockAction type=wfs:AllSomeType default=ALL xsd:extension xsd:complexContent xsd:complexType

13.2.3 KVP encoding

The KVP encoding of the GetFeatureWithLock operation is similar to that of the GetFeature operation see Table 17. Table 19 lists the additional KVP parameters that may be used with the GetFeatureWithLock operation.