view Side-By-Side changes
SIMPLE J. Rosenberg Internet-Draft dynamicsoft Expires:April 26,August 15, 2004 February 15, 2004October 27, 2003The Extensible Markup Language (XML) Configuration Access Protocol (XCAP)draft-ietf-simple-xcap-01draft-ietf-simple-xcap-02 Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http:// www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire onApril 26,August 15, 2004. Copyright Notice Copyright (C) The Internet Society(2003).(2004). All Rights Reserved. Abstract This specification defines the Extensible Markup Language (XML) Configuration Access Protocol (XCAP). XCAP allows a client to read, write and modify application configuration data, stored in XML format on a server. XCAP is not a new protocol. XCAP maps XML document sub-trees and element attributes to HTTP URIs, so that these components can be directly accessed by HTTP. Rosenberg ExpiresApril 26,August 15, 2004 [Page 1] Internet-Draft XCAPOctober 2003February 2004 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . .. 34 2. Overview of Operation . . . . . . . . . . . . . . . . . .. 45 3. Terminology . . . . . . . . . . . . . . . . . . . . . . .. 56 4. Application Usages . . . . . . . . . . . . . . . . . . . . 7 4.1 Application Usage ID (AUID) .6 5. URI Construction. . . . . . . . . . . . . . 7 4.2 Data Validation . . . . . . . .8 5.1 Identifying the XML Document. . . . . . . . . . . . . 7 4.3 Data Semantics . . .8 5.2 Identifying the XML Nodes. . . . . . . . . . . . . . . . .9 6. Client Operations. . 8 4.4 Naming Conventions . . . . . . . . . . . . . . . . . . .12 6.1 Creating a New Document. 8 4.5 Data Interdependencies . . . . . . . . . . . . . . . . .12 6.2 Replace an Existing Document. 8 4.6 Authorization Policies . . . . . . . . . . . . . . . . .12 6.3 Deleting a Document. 8 4.7 Data Extensibility . . . . . . . . . . . . . . . . . . .12 6.4 Fetching a Document. 9 4.7.1 XML Schema . . . . . . . . . . . . . . . . . . .12 6.5 Creating a New Element. . . . . 10 4.8 Documenting Application Usages . . . . . . . . . . . . . .12 6.6 Replacing an Element in the Document10 5. URI Construction . . . . . . . . . . . .13 6.7 Delete an Element. . . . . . . . . 11 5.1 Identifying the XML Document . . . . . . . . . . . .13 6.8 Fetch an Element. . . 11 5.2 Identifying the XML Nodes . . . . . . . . . . . . . . . . 12 6. Client Operations . . .13 6.9 Create an Attribute. . . . . . . . . . . . . . . . . 15 6.1 Create or Replace a Document . . .14 6.10 Replacing Attributes. . . . . . . . . . . . 15 6.2 Delete a Document . . . . . . . .14 6.11 Deleting Attributes. . . . . . . . . . . . 15 6.3 Fetch a Document . . . . . . . .14 6.12 Fetching Attributes. . . . . . . . . . . . . 15 6.4 Create or Replace an Element . . . . . . .14 6.13 Read/Modify/Write Transactions. . . . . . . . 16 6.5 Delete an Element . . . . . . .15 7. Server Behavior. . . . . . . . . . . . . 17 6.6 Fetch an Element . . . . . . . . .16 7.1 POST Handling. . . . . . . . . . . . 17 6.7 Create or Replace an Attribute . . . . . . . . . . .16 7.2 PUT Handling. . . 17 6.8 Delete an Attribute . . . . . . . . . . . . . . . . . . . 18 6.9 Fetch an Attribute . .17 7.3 GET Handling. . . . . . . . . . . . . . . . . . 18 6.10 Read/Modify/Write Transactions . . . . . .18 7.4 DELETE Handling. . . . . . . . 19 6.11 Reading Server Assigned Data . . . . . . . . . . . . . .18 7.5 Managing Etags. 19 7. Server Behavior . . . . . . . . . . . . . . . . . . . . . 21 7.1 POST Handling .19 8. Examples. . . . . . . . . . . . . . . . . . . . . 21 7.2 PUT Handling . . . . .20 9. Security Considerations. . . . . . . . . . . . . . . . . .23 10. IANA Considerations22 7.2.1 Detailed Conflict Reports . . . . . . . . . . . . . . . . 23 7.2.1.1 XML Schema . . . .24 Normative References. . . . . . . . . . . . . . . . . . . . 25Informative References7.3 GET Handling . . . . . . . . . . . . . . . . . . .26 Author's Address. . . . 27 7.4 DELETE Handling . . . . . . . . . . . . . . . . . .27 Intellectual Property and Copyright Statements. . . 28 7.5 Managing Etags . . . .28 Rosenberg Expires April 26, 2004. . . . . . . . . . . . . . . . . . 28 8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 30 9. Security Considerations . . . . . . . . . . . . . . . . . 33 10. IANA Considerations . . . . . . . . . . . . . . . . . . . 34 10.1 XCAP Application Usage IDs . . . . . . . . . . . . . . . . 34 10.2 application/xml-fragment-body MIME Type . . . . . . . . . 34 10.3 application/xml-attribute-value MIME Type . . . . . . . . 35 10.4 application/xcap-error+xml MIME Type . . . . . . . . . . . 36 10.5 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:xcap-must-understand . . . . . . . 37 10.6 URN Sub-Namespace Registration for Rosenberg Expires August 15, 2004 [Page 2] Internet-Draft XCAPOctober 2003 1. IntroductionFebruary 2004 urn:ietf:params:xml:ns:xcap-error . . . . . . . . . . . . 38 10.7 XCAP Error Schema Registration . . . . . . . . . . . . . . 38 10.8 XCAP Mandatory Namespace Schema Registration . . . . . . . 39 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . 40 Normative References . . . . . . . . . . . . . . . . . . . 41 Informative References . . . . . . . . . . . . . . . . . . 43 Author's Address . . . . . . . . . . . . . . . . . . . . . 44 Intellectual Property and Copyright Statements . . . . . . 45 Rosenberg Expires August 15, 2004 [Page 3] Internet-Draft XCAP February 2004 1. Introduction In many communications applications, such as Voice over IP, instant messaging, and presence, it is necessary for network servers to access per-user information in the process of servicing a request. This per-user information resides within the network, but is managed by the end user themselves. Its management can be done through a multiplicity of access points, including the web, a wireless handset, or a PC application. Examples of per-user information are presence [17] authorization policy and presence lists. Presence lists are lists of users whose presence is desired by a watcher. One way to obtain presence information for the list of is to subscribe to a resource which represents that list [20]. In this case, the Resource List Server (RLS) requires access to this list in order to process a SIP [15]SUBSCRIBE [25] request for it. Another way to obtain presence for the users on the list is for a watcher to subscribe to each user individually. In that case, it is convenient to have a server store the list, and when the client boots, it fetches the list from the server. This would allow a user to access their resource lists from different clients. Requirements for manipulation of presence lists and authorization policies have been specified by the SIMPLE working group [21]. This specification describes a protocol that can be used to manipulate this per-user data. It is called the Extensible Markup Language (XML) Configuration Access Protocol (XCAP). XCAP is not a new protocol. Rather, it is a set of conventions for mapping XML documents and document components into HTTP URIs, rules for how the modification of one resource affects another, data validation constraints, and authorization policies associated with access to those resources. Because of this structure, normal HTTP primitives can be used to manipulate the data. XCAP is based heavily on ideas borrowed from the Application Configuration Access Protocol (ACAP) [23], but it is not an extension of it, nor does it have any dependencies on it. Like ACAP, XCAP is meant to support the configuration needs for a multiplicity of applications, rather than just a single one. Rosenberg Expires August 15, 2004 [Page 4] Internet-Draft XCAP February 2004 2. Overview of Operation Each application that makes use of XCAP specifies an application usage (Section 4). This application usage defines the XML schema [2] for the data used by the application, along with other key pieces of information. The principal task of XCAP is to allow clients to read, write, modify, create and delete pieces of that data. These operations are supported using HTTP 1.1 [5]. An XCAP server acts as a repository for collections of XML documents. There will be documents stored for each application. Within each application, there are documents stored for each user. Each user can have a multiplicity of documents for a particular application. To access some component of one of those documents, XCAP defines an algorithm for constructing a URI that can be used to reference that component. Components refer to any subtree of the document, or any attribute for any element within the document. Thus, the HTTP URIs used by XCAP point to pieces of information that are finer grained than the XML document itself. With a standardized naming convention for mapping components of XML documents to HTTP URIs, the basic operations for accessing the data are provided by existing HTTP primitives. Reading one of the components is accomplished with HTTP GET, creating or modifying one of the components is done with an HTTP PUT, and removing one of the components is done with an HTTP DELETE. To provide atomic read/ modify/write operations, HTTP entity tags are used. Rosenberg Expires August 15, 2004 [Page 5] Internet-Draft XCAP February 2004 3. Terminology In this document, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in RFC 2119 [6] and indicate requirement levels for compliant implementations. Rosenberg Expires August 15, 2004 [Page 6] Internet-Draft XCAP February 2004 4. Application Usages A central concept in XCAP is that of an application usage. An application usage defines the way in which a specific application makes use of XCAP. 4.1 Application Usage ID (AUID) Each application usage is associated with a name, called an AUID. This name uniquely identifies the application usage, and is different from all other AUIDs. AUIDs exist in one of two namespaces. The first namespace is the IETF namespace. This namespace contains a set of tokens, each of which is registered with IANA. These registrations occur with the publication of standards track RFCs [24] based on the guidelines in Section 10. The second namespace is the vendor-proprietary namespace. Each AUID in that namespace is prefixed with the reverse domain name name of the organization creating the AUID, followed by a period, followed by any vendor defined token. As an example, the example.com domain can create an AUID with the value "com.example.foo" but cannot create one with the value "org.example.foo". AUIDs within the vendor namespace do not need to be registered with IANA. The vendor namespace is also meant to be used in lab environments where no central registry is needed. The syntax for AUIDs, expressed in ABNF [11] (and using some of the BNF defined in RFC 2396 [12]) is: AUID = global-auid / vendor-auid global-auid = auid auid = alphanum / mark vendor-auid = rev-hostname "." auid rev-hostname = toplabel *( "." domainlabel ) domainlabel = alphanum / alphanum *( alphanum / "-" ) alphanum toplabel = ALPHA / ALPHA *( alphanum / "-" ) alphanum 4.2 Data Validation One of the responsibilities of the server is to validate the data generated by the client. This is done using two mechanisms. Firstly, all application usages MUST describe their document contents using XML schema [2]. Unfortunately, XML schemas cannot represent every form of data constraint. As an example, one XML element may contain an integer which defines the maximum number of instances of another element. This constraint cannot be represented with XML schema. However, such constraints may be important to the application usage. The application usage defines any additional constraints beyond those Rosenberg Expires August 15, 2004 [Page 7] Internet-Draft XCAP February 2004 in the schema. 4.3 Data Semantics For each application usage, the data present in the XML document has a well defined semantic. The application usage defines that semantic, so that a client can properly construct a document in order to achieve the desired result. 4.4 Naming Conventions In addition to defining the meaning of the document in the context of a particular application, and application usage has to specify how elements in that application obtain the various documents necessary for operation of that application. In particular, what the relevant URIs are that point to documents used by the application. As an example, one application that can make use of XCAP is a SIP event list subscription [20]. In this application, an entity is defined called a Resource List Server (RLS). When the RLS receives a subscription to a SIP URI that represents a list, it "expands" the list and subscribes to its members. The XCAP resource list application usage [22] specifies how the RLS uses XCAP to find the XML document that defines the contents of the list. These conventions are defined as naming conventions. 4.5 Data Interdependencies In manycommunications applications, suchcases, when a user modifies an XCAP resource, other data managed by the server needs to change asVoice over IP, instant messaging, and presence,well. Such interdependencies are application usage dependent. As an example, when a user performs a PUT operation to create a new presence list, the server may need to fill in the URI associated with that list. These interdependencies need to be specified by the application usage. 4.6 Authorization Policies By default, an XCAP server will only allow a user to access (read, write, delete or modify) their own documents. The application usage can specify differing default authorization policies. An application usage can also specify whether another application usage is used to define the authorization policies. An application usage for setting authorization policies can also be defined subsequent to the definition of the the main application usage. In such a case, the main application usage needs only to specify that such a usage will be defined in the future. Rosenberg Expires August 15, 2004 [Page 8] Internet-Draft XCAP February 2004 4.7 Data Extensibility An XCAP server MUST understand an application usage in order to process an HTTP request made against a resource for that particular application usage. However, it isnecessarynot required fornetwork serversthe server toaccess per-user information inunderstand all of theprocesscontents ofservicingarequest. This per-user information resides within the network, butdocument used by an application usage. A server ismanagedrequired to understand the baseline schema defined by theend user themselves. Its managementapplication usage. However, those schemas canbe done through a multiplicitydefine points of extensibility where new content can be added from other namespaces and corresponding schemas. Sometimes, the server will understand those namespaces and therefore have accesspoints, includingto their schemas. Sometimes, it will not. A server MUST allow for documents that contain elements from namespaces not known to theweb,server. In such awireless handset, orcase, the server cannot validate that such content is schema compliant; it will only verify that the XML is well-formed. Unfortunately, it may be the case that aPC application. Examples of per-user information are presence [12] authorization policy andclient needs the server to understand these new namespaces in order to process a document. This will be the case when the new content contains data interdependcies that the server has to understand. To allow for this, this specification defines an XML element called "mandatory-ns". A server will look for the presencelists. Presence lists are listsofusers whose presencethis element as the child of the root node of any document. If it finds it, the server will make sure that it isdesired by a watcher. Presence informationfamiliar with any namespaces (and their corresponding schemas) listed there. The implication is that the schema for all XCAP application usages MUST allow for thelist"mandatory-ns" element to be present as a child ofusersthe root node of any document. This can beobtaineddone bysubscribingexplicitly importing its namespace and including it in the schema, or allowing elements from other namespaces toa resourcebe present in the schema as children of the root node. Rosenberg Expires August 15, 2004 [Page 9] Internet-Draft XCAP February 2004 4.7.1 XML Schema <?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="urn:ietf:params:xml:ns:xcap-must-understand" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:ietf:params:xml:ns:xcap-must-understand" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="mandatory-ns"> <xs:complexType> <xs:sequence> <xs:element name="ns" type="xs:anyURI" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> 4.8 Documenting Application Usages Application usages are documented in specifications whichrepresents that list [15].convey the information described above. Inthis case,particular, an application usage specification MUST provide theResource List Server (RLS) requires access to this listfollowing information: Application Usage ID (AUID): The application usage MUST register the AUID using the IANA procedures defined inorder to processSection 10. MIME Type: Each application usage will have aSIP [11]SUBSCRIBE [20] request for it. RequirementsMIME type formanipulation of presence lists and authorization policies have been specified by the SIMPLE working group [16].its documents. Thisspecification describes a protocol thatcan either beused to manipulate this per-user data. It is called the Extensible Markup Language (XML) Configuration Access Protocol (XCAP). XCAP is notan existing MIME type, or a newprotocol. Rather, it is a set of conventions for mappingone registered by the application usage. XMLdocuments and document components into HTTP URIs, rulesSchema: The schema forhowdocuments used by themodification of one resource affects another, data validation constraints, and authorization policies associated with access to those resources. Because of this structure, normal HTTP primitivesapplication. Additional Constraints: Any constraints that can not beused to manipulaterepresented by thedata. XCAP is based heavily on ideas borrowed fromXML schema. Data Semantics: Naming Conventions: Resource Interdependencies: Authorization Policies: If the application usage changes theApplication Configuration Access Protocol (ACAP) [18], butdefault authorization policies, itis not an extension of it, nor doesshould specify that. If not, ithave any dependencies on it. Like ACAP, XCAP is meant to supportshould specify that theconfiguration needs for a multiplicity of applications, rather than just a single one.default is used. Rosenberg ExpiresApril 26,August 15, 2004 [Page3]10] Internet-Draft XCAPOctober 2003 2. Overview of Operation Each application that makes useFebruary 2004 5. URI Construction In order to manipulate a piece ofXCAP specifiesconfiguration data, the data must be represented by anapplication usage (Section 4). This application usageHTTP URI. XCAP definesthe XML schema [1]a specific naming convention for constructing these URIs. In particular, thedata used byhost part identifies theapplication, along with other key pieces of information. The principal task ofXCAPis to allow clients to read, write, modify, create and delete piecesserver. The abs_path component ofthat data. These operations are supported usingthe HTTP1.1 [2]. An XCAP server acts as a repository for collectionsURI identifies the specific piece ofXML documents. There willdata to be modified. This path is broken into a two parts. The first part identifies the particular XML document. XCAP servers organize XML documentsstored for each application. Within each application, there are documents stored for each user. Each user can havein amultiplicityspecific hierarchical fashion, as described in Section 5.1. The second part ofdocuments forthe path is called aparticular application. To access somenode selector. When present, it contains an XML component identifier formatted according to Section 5.2. The node selector identifies the specific component ofone of those documents, XCAP defines an algorithm for constructing athe XML document. The HTTP URI without the node selector is called the document URI. Note thatcan be used to reference that component. Components refer to any subtree ofthere is nothing in thedocument, or any attributegrammar forany element within the document. Thus,the HTTPURIs used by XCAP point to pieces of informationURI thatare finer grained thanseparates theXMLdocumentitself. With a standardized naming convention for mapping components of XML documents to HTTP URIs,URI from thebasic operations for accessingnode selector. The path extends naturally from thedata are provided by existing HTTP primitives. Reading one ofdocument into the XML hierarchy within the document. Separating the two components isaccomplished with HTTP GET, creating or modifying onesomething a server can do based on its awareness of thecomponents is done with an HTTP PUT, and removing onestructure of thecomponentsdocument directory. 5.1 Identifying the XML Document XCAP mandates that a server MUST organize documents according to a defined hierarchy. The root of this hierarchy isdone withan HTTPDELETE. To provide atomic read/ modify/write operations, HTTP entity tags are used. Rosenberg Expires April 26, 2004 [Page 4] Internet-DraftURI called the XCAPOctober 2003 3. Terminology In this document,services root URI. This URI identifies thekey words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL"root of the tree within the domain where all XCAP documents aretostored. It can beinterpreted as described in RFC 2119 [3] and indicate requirement levels for compliant implementations. Rosenberg Expires April 26, 2004 [Page 5] Internet-Draftany valid HTTP URL, but MUST NOT contain a query string. As an example, http://xcap.example.com/services might be used as the XCAPOctober 2003 4. Application Usages A central concept inservices root URI within the example.com domain. Typically, the XCAP services root URI isthat of an application usage. An application usage definesprovisioned into client devices for bootstrapping purposes. Beneath theway in which a specific application makes use of XCAP. This definitionXCAP services root URI iscomposeda tree structure for organizing documents. The first level ofseveral piecesthis tree consists ofinformation, such as an XML schema and constraints on valuesthe XCAP AUID. So, continuing the example above, all ofone element given values in another. Application usages are documented in specifications which convey this information. In particular, an application usage specification MUST providethefollowing information: Application Usage ID (AUID): Eachdocuments used by the presence list applicationusagewould be under http://xcap.example.com/ services/presence-lists. It isassociated withassumed that each application will have data that is set by users, and/or it will have global data that applies to all users. As aname, called an AUID. This name uniquely identifiesresult, within the directory structure for each application usage, there are two sub-trees. One, called "users", holds the documents that are applicable to specific users, andis different fromthe other, called "global", holds documents applicable to allother AUIDs. AUIDs exist in one of two namespaces. The first namespace isusers. Within theIETF namespace. This namespace contains"users" tree are zero or more sub-trees, each of which identifies documents that apply to a specific user. XCAP does not Rosenberg Expires August 15, 2004 [Page 11] Internet-Draft XCAP February 2004 itself define what it means for documents to "apply" to aset of tokens, each of which is registered with IANA. These registrations occur with the publicationuser, beyond specification ofstandards track RFCs [19] based on the guidelinesa baseline authorization policy, described below in Section10. The second namespace is the vendor-proprietary namespace.7. EachAUID in that namespace is prefixed withapplication usage can specify additional authorization policies which depend on data used by thereverse domain name nameapplication itself. The remainder of theorganization creatingURI (the path following "global" or theAUID, followed by a period, followedspecific user) is not constrained by this specification. The application usage MAY introduce constraints, or may allow anyvendor defined token. As an example, the example.com domain can create an AUID with the value "com.example.foo" but cannot create one with the value "org.example.foo". AUIDs within the vendor namespace do not needstructure to beregistered with IANA.used. 5.2 Identifying the XML Nodes Thevendor namespace is also meantnode selector specifies specific nodes of the XML document which are to beused in lab environments where no central registry is needed. The syntax for AUIDs, expressed in ABNF [7] (and using someaccessed. A node refers to either an XML element or an attribute ofthe BNF defined in RFC 2396 [8])an element. The node selector is an expression which identifies an element or attribute. Its grammar is:AUIDnode-selector =global-auidelement-selector ["/" attribute-selector] element-selector = step *( "/" step) step = by-name /vendor-auid global-auidby-pos / by-attr by-name = QName ; from XML Namespaces by-pos =auid auidQName "[" position "]" position =alphanum / mark vendor-auid1*DIGIT by-attr =rev-hostname "." auid rev-hostnameQName "[" "@" att-name "=" <"> att-value <"> "]" att-name =toplabel *( "." domainlabel ) domainlabelQName att-value =alphanum / alphanum *( alphanum / "-" ) alphanum toplabelAttValue ; from XML specification attribute-selector =ALPHA / ALPHA *( alphanum / "-" ) alphanum MIME Type: Each application usage MUST register a MIME type for its"@" att-name The QName grammar is defined the XMLdocuments. Thisnamespaces specification [3]. The node selector isdonebased on theprocedures of RFC 3023 [4]. XML Schema: Each application will have a unique schema which defines the data needed byconcepts in XPath [9]. Indeed, theapplication. In XCAP, this schema is represented using XML schema [1]. Rosenberg Expires April 26, 2004 [Page 6] Internet-Draft XCAP October 2003 Additional Constraints: XML schemas can representnode selector expression happens to be avariety of constraints about data, such as ranges and types.valid XPath expression. However,schemas cannot cover all types of data constraints, including constraints introduced by data interdependencies. For example, one XML element may contain an integer which defines the maximum number of instances of another element. The application usage defines these additional constraints. Data Semantics: The application usage needs to define detailed semantics for each pieceXPath provides a set ofdata in the schema. Naming Conventions: The data defined byfunctionality far richer than is needed here, and its breadth would introduce complexity into XCAP. To determine the XMLschema will be usedelement or attribute selected byany number of entities participating intheapplication. Innode selector, processing begins at thecaseroot ofpresence list,thedataXML document. The first step in the element selector isused bythen taken. Each step chooses a specific XML element within theResource List Server (RLS), which readscurrent document context. The document context is thedata, and bypoint within theclients,XML document from whichwrite it. Duringa specific step is evaluated. The document context begins at theexecutionroot of theapplication (i.e., the processing ofdocument. When a step determines an element within that context, that element becomes thelist subscription), specific documents will need to be read or written. In ordernew context for evaluation of theapplication to function properly, there needs to be agreement on exactly which documents are readnext step. Each step can select an element by its name, by a combination of name and attribute value, orwrittenby name and position. If theapplication. Thisstep isan issue of naming conventions; agreeing on how an application constructsattempting selection by name, theURI representingserver looks for all Rosenberg Expires August 15, 2004 [Page 12] Internet-Draft XCAP February 2004 elements within thedocumentcurrent context with that name. Name matching isto be read or written. The application usage spells out this information. Resource Interdependencies: In many cases, when a user modifies an XCAP resource, many other resources need to changeperformed aswell. Such interdependencies are application usage dependent. As an example, when a user performs a PUT operation to createdescribed below. If there is more than one element with the specified name, the result is considered anew presence list,no-match. If the step is attempting selection by name and attribute, the server looks for all elements within the current document context with that name. Of those that match, it looks for ones that have theserver may need to fill ingiven attribute name, where that attribute has theURI associated withgiven value. If there is no match, or if more than one element matches, the result is considered a no-match. Note thatlist. These interdependencies need toelements cannot bespecifiedselected based on any namespace attributes. Any such attributes are effectively ignored in terms of the matching operations defined here. If the step is attempting selection by name and position, theapplication usage. Note that, if aserverneeds to modify datalooks for all elements withinathe current documentjust PUTcontext with that name. These are then sorted in document order, as defined by Xpath. The position-th element is then selected. If there are fewer than position number of elements with that name, theclient, this modificationresult iseffectively accomplished asconsidered aseparate transaction. Concretely, this means that, after the server modifies the data,no-match. Once theentity tags are updated aslast step is executed, if there is no attribute selector, theclient had maderesult of thechange itself. Authorization Policies: By default,node selection is the last selected element. If there is anXCAPattribute selector, the serverwill only allow a userchecks toaccess (read, write, delete or modify) their own documents. The application usage can specify differing default authorization policies. An application usage can also specify whether another application usagesee if there is an attribute with that name within the currently selectoed element. If there is not, the result is considered a no-match. Otherwise, that attribute is selected. Note that namespace attributes cannot be selected. Matching of element names and attributes isused to defineperformed by expanding them into theauthorization policies. An application usage for setting authorization policies can also be defined subsequent toexpanded name form, as described in XML Namespaces, and then performing thedefinitioncomparison of the results. When evaluating themain application usage. In such a case,QNames in themain application usage needs only to specify thatnode selector, the default namespace and namespace definitions from the document URI apply. Comments, text content, and processing declarations in the XML document cannot be selected by the expressions defined here. Of course, if such information is present in ausage willdocument, and a user selects an XML element enclosing that data, that information would bedefinedincluded in a resulting GET, for example. As an example, consider thefuture. Application usages are similar to dataset classes in ACAP.following XML document: Rosenberg ExpiresApril 26,August 15, 2004 [Page7]13] Internet-Draft XCAPOctober 2003 5. URI Construction In order to manipulate a piece of configuration data,February 2004 <?xml version="1.0"?> <watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo" version="0" state="full"> <watcher-list resource="sip:professor@example.net" package="presence"> <watcher status="active" id="8ajksjda7s" duration-subscribed="509" event="approved" >sip:userA@example.net</watcher> <watcher status="pending" id="hh8juja87s997-ass7" display-name="Mr. Subscriber" event="subscribe">sip:userB@example.org</watcher> </watcher-list> </watcherinfo> The node selector "watcherinfo/watcher-list/ watcher[@id="8ajksjda7s"]" would select the following XML element: <watcher status="active" id="8ajksjda7s" duration-subscribed="509" event="approved" >sip:userA@example.net</watcher> Rosenberg Expires August 15, 2004 [Page 14] Internet-Draft XCAP February 2004 6. Client Operations An XCAP client is an HTTP 1.1 compliant client. Specific datamust be representedmanipulation tasks are accomplished byaninvoking the right set of HTTPURI. XCAP defines a specific naming convention for constructing these URIs. In particular,methods with thehost part identifiesright set of headers on theXCAPserver.The abs_path component ofThis section describes those in detail 6.1 Create or Replace a Document To create or replace a document, theHTTPclient constructs a URIidentifiesthat references the location where thespecific XMLdocument is to bemodified. XCAP servers organize XML documents in a specific hierarchical fashion, as described in Section 5.1. Theplaced. This URIMAYMUST NOT contain aquery. This query is calledNodeSelector component. The client then invokes anode selector. When present, it containsPUT method on that URI. The content in the request MUST be an XMLcomponent identifier formatted accordingdocument compliant toSection 5.2. The node selector identifies the specific component oftheXML document. The HTTP URI withoutschema associated with thequery is calledapplication usage defined by thedocumentURI., and makes use the specification for identifying nodes of an XML document. 5.1 IdentifyingFor example, if theXML Document XCAP mandates thatclient performs aserver organizes documents accordingPUT operation toa defined hierarchy. The root of this hierarchyhttp:// xcap.example.com/services/presence-lists/users/joe/mybuddies, presence-lists isan HTTP URI calledtheXCAP services root URI. This URI identifiesapplication unique ID, and theroot ofschema defined by it would dictate thetree withinbody of thedomain where all XCAP documents are stored. It can be any valid HTTP URL, but MUST NOT contain a query string. As an example, http://xcap.example.com/services mightrequest. The MIME content type SHOULD beusedasthe XCAP services root URI within the example.com domain. Typically, the XCAP services root URI is provisioned into client devicesspecific as possible. For example, "application/ resource-lists+xml" forbootstrapping purposes. Beneath the XCAP services root URI isatree structure for organizing documents. The first level of this tree consistsresource list [22], instead of just "application/xml". If theXCAP AUID. So, continuingRequest-URI identifies a document that already exists in theexample above, allserver, the PUT operation replaces that document with the content of thedocuments used byrequest. If thepresence list application would be under http://xcap.example.com/ services/presence-lists. ItRequest-URI does not identify an existing document, the document isassumed that each application will have datacreated on the server at that specific URI. If the result of the PUT isset by users, and/or it will have global data that applies to all users. Asaresult, within200 or 202 response, thedirectory structure for each application usage, there are two sub-trees. One, called "users", holdsoperation was successful. If it was a 409, thedocuments that are applicableuser performed some action which resulted in an invalid document. The 409 response may contain an XML body, formatted according tospecific users, andtheother, called "global", holds documents applicable to all users. Withinschema in Section 7.2.1.1, which provides further information on the"users" tree are zero or more sub-trees, eachnature ofwhich identifies a documents that applythe error. The client MAY use this information toa specific user. XCAP does not itself define whattry and alter the request so that this time, itmeans for documents to "apply" to a user, beyond specificationmight succeed. The client SHOULD NOT simply retry the request without changing some aspect of it. 6.2 Delete abaseline authorization policy. Specifically,Document To delete a document, thedefault authorization policy is that onlyclient constructs auser who authenticates themself as user X can read, write, or otherwise access in any wayURI that references thedocuments within sub-tree X. Each application usage can specify additional authorization policies which dependdocument to be deleted. By definition this URI will not contain a NodeSelector component. The client then invokes a DELETE operation on the URI to delete the document. 6.3 Fetch a Document As one would expect, fetching a document is trivially accomplished by Rosenberg ExpiresApril 26,August 15, 2004 [Page8]15] Internet-Draft XCAPOctober 2003 data used by the application itself. The remainder ofFebruary 2004 performing an HTTP GET request with the Request URI(the path following "global" or the specific user) is not constrained by this specification. The application usage MAY introduce constraints, or may allow any structureset tobe used. 5.2 Identifying the XML Nodes The second component of the XCAP URI specifies specific nodes oftheXMLdocumentwhich areto beaccessed. A node refers to either an XML element or an attribute of an element. The node selectorfetched. When a client fetches a document, and there is anexpression which identifiesolder version cached, it is useful for clients to perform conditional GETs using the If-Match header field, in order to reduce network usage if the cached copy is still valid. An HTTP server MUST return Etags for entities that represent resources managed by XCAP. 6.4 Create or Replace anelementElement To create orattribute. Its grammar is: node-selector = element-selector ["/" attribute-selector] element-selector = step *( "/" step) step = by-name / by-pos / by-attr by-name = QName ; from XML Namespaces by-pos = QName "[" position "]" position = 1*DIGIT by-attr = QName "[" "@" att-name "=" <"> att-value <"> "]" att-name = QName att-value = AttValue ; from XML specification by-pos = QName "[" position "]" position = *DIGIT attribute-selector = "@" att-namereplace an XML element within an existing document, the client constructs a URI whose document URI points to the document to be modified. The node selectoris based on the conceptsMUST be present inXPath [5]. Indeed,the URI. The node selectorexpression happens to be a valid XPath expression. However, XPath provides a set of functionality far richer thanisneeded here, and its breadth would introduce complexity into XCAP. To determneconstructed such that, if theXMLelementor attribute selectedwas added to the document as desired by thenode selector, processing begins atclient, theroot ofnode selector would select that element. The client then invokes theXML document.HTTP PUT method. Thefirst stepcontent in theelement selector is then taken. Each step chooses a specificrequest MUST be an XMLelement withinelement. Specifically, it contains thecurrent document context. The document context iselement, starting with thepoint withinopening bracket for theXML document from which a specific step is evaluated. The document context begins atbegin tag for that element, including therootattributes and content ofthe document. When a step determines an element within that context,that elementbecomes(whether it be text or other child elements), and ending with thenew contextclosing bracket forevaluation ofthenext step. Each step can select anend tag for that element. The MIME type in the request SHOULD be "application/xml-fragment-body", defined in Section 10.2. The server will insert the elementby(including all itsname, by a combination of name and attribute value, or by nameattributes andposition. Ifits content) into thestep is attempting selectiondocument such that the node selector, if evaluated byname,theserver looks for all elements withinserver, would return thecurrent context with that name. Name matching is performed as described below.content present in the request. Ifthere is more than one element withthespecified name,node selector, when evaluated against theresult is consideredcurrent document, results in ano-match. Rosenberg Expires April 26, 2004 [Page 9] Internet-Draft XCAP October 2003no-match, the server performs a creation operation. If thestep is attempting selection by name and attribute,node selector, when evaluated against theserver lookscurrent document, is a match forall elements withinan element in the currentdocument context with that name. Of those that match,document, the server replaces itlooks for ones that havewith thegiven attribute name, where that attribute hascontent of thegiven value. If therePUT request. This replacement isno match, or if more than one element matches,complete; that is, theresult is considered a no-match. Ifold element (including its attributes and content) are removed, and thestep is attempting selection by namenew one, including its attributes andposition,content, is put in its place. The client SHOULD be certain, before making theserver looks for all elements withinrequest, that thecurrentresulting modified documentcontext withwill also be conformant to the schema. It is important to note thatname. These are then sortedthe element might potentially be inserted in the documentorder, asin several different ways, and still meet the constraints definedby Xpath. The position-th elementabove. This isthen selected. If there are fewer than position number of elements with that name,analagous to theresult is consideredcase when ano-match. Once the last step is executed, if therenew file isno attribute selector,PUT into a directory on a server; theresultlocation of that file within thenode selectiondirectory isthe last selected element. If therenot specified, and isan attribute selector,up to theserver checkslocal file system tosee if theredecide. The only guarantee isan attribute withthatname within the currently selectoed element.GET(PUT(x)) returns document x. Ifthere is not,the resultis considered a no-match. Otherwise, that attribute is selected. Matchingofelement names and attributes is performed by expanding them into the expanded name form, as described in XML Namespaces, and then performingthecomparison ofPUT is a 200 or 202 response, theresults. When evaluatingoperation was successful. If it was a 409, theQNamesuser performed some action which resulted inthe node selector, the default namespace and namespace definitions from the document URI apply. Asanexample, consider the following XML document: <?xml version="1.0"?> <watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo" version="0" state="full"> <watcher-list resource="sip:professor@example.net" package="presence"> <watcher status="active" id="8ajksjda7s" duration-subscribed="509" event="approved" >sip:userA@example.net</watcher> <watcher status="pending" id="hh8juja87s997-ass7" display-name="Mr. Subscriber" event="subscribe">sip:userB@example.org</watcher> </watcher-list> </watcherinfo>invalid document. Thenode selector "watcherinfo/watcher-list/ watcher[@id="8ajksjda7s"]" would select the following409 response may contain an XMLelement:Rosenberg ExpiresApril 26,August 15, 2004 [Page10]16] Internet-Draft XCAPOctober 2003 <watcher status="active" id="8ajksjda7s" duration-subscribed="509" event="approved" >sip:userA@example.net</watcher> Rosenberg Expires April 26,February 2004[Page 11] Internet-Draft XCAP October 2003 6. Client Operations An XCAP client is an HTTP 1.1 compliant client. Specific data manipulation tasks are accomplished by invokingbody, formatted according to theright set of HTTP methods withschema in Section 7.2.1.1, which provides further information on theright setnature ofheaders ontheserver. This section describes those in detail 6.1 Creating a New Documenterror. The client MAY use this information to try and alter the request so that this time, it might succeed. The client SHOULD NOT simply retry the request without changing some aspect of it. 6.5 Delete an Element Tocreatedelete an element from anewdocument, the client constructs a URIthat references the location wherewhose document URI points to the documentiscontaining the element to beplaced. This URIdeleted. The node selector MUSTNOT contain a NodeSelector component.be present, and identify the specific element to be deleted. The client then invokesa PUT method on that URI.the HTTP DELETE method. Thecontent inserver will remove therequest MUSTelement from the document (including its attributes and its content, such as any children). The client SHOULD bean XMLcertain, before making the request, that the resulting modified documentcompliantwill also be conformant to theschema associated with the application usage defined byschema. If theURI. For example, ifresult of theclient performs a PUT operation to http:// xcap.example.com/services/presence-lists/users/joe/mybuddies, presence-listsDELETE is a 200 response, theapplication unique ID, and the schema defined byoperation was successful. If itwould dictate the body ofwas a 409, therequest. 6.2 Replaceuser performed some action which resulted in anExisting Document To replaceinvalid document. The 409 response may contain anexisting document with a new one,XML body, formatted according to theprocedures ofschema in Section6.1 are followed; the Request-URI merely refers to an existing document7.2.1.1, whichis to be replaced withprovides further information on thecontentnature of therequest. 6.3 Deleting a Document To delete a document, theerror. The clientconstructs a URI that references the documentMAY use this information tobe deleted. By definitiontry and alter the request so that thisURI will not contain a NodeSelector component.time, it might succeed. The clientthen invokesSHOULD NOT simply retry the request without changing some aspect of it. 6.6 Fetch an Element To fetch an element of aDELETE operation on the URI to deletedocument, thedocument. 6.4 Fetching a Document As one would expect, fetchingclient constructs a URI whose documentis trivially accomplished by performing an HTTP GET request with the RequestURIsetpoints to the document containing the element to be fetched.It is useful for clients to perform conditional GETs usingThe node selector MUST be present, and must identify theIf-Match header field, in orderelement tocheck if a locally cached copybe fetched. The client then invokes the GET method. The response will contain that XML element. Specifically, it contains the content of thedocument is still valid. An HTTP server MUST return EtagsXML document, starting with the opening bracket for the begin tag forentitiesthatrepresent resources managed by XCAP. 6.5 Creatingelement, and ending with the closing bracket for the end tag for that element. This will, as aNew Elementresult, include all attributes and child elements of that element. 6.7 Create or Replace an Attribute To createa new XML element withinor replace an attribute in an existing element of a document, the clientRosenberg Expires April 26, 2004 [Page 12] Internet-Draft XCAP October 2003constructs a URI whose document URI points to the document to be modified. The node selector MUST bepresent in the URI.present. The node selectorisMUST be constructed suchthat it meets two constraints. First, if evaluated against the current document, the result is a no-match. Secondly,that, if theelementattribute wasadded to the documentRosenberg Expires August 15, 2004 [Page 17] Internet-Draft XCAP February 2004 created or replaced asdesired by the client,desired, the node selector would select thatelement.attribute. If the node selector, when evaluated against the current document, results in a no-match, it is a creation operation. If it matches an existing attribute, it is a replacement operation. The client then invokes the HTTP PUTmethod [[OPEN ISSUE: what is the content type?]].method. The contentindefined by the request MUST beancompliant to the grammar for AttValue as defined in XMLelement.1.0. This request MUST be sent with the Content-Type of "application/xml-attribute-value" as defined in Section 10.3. The server willinsert the element into the document suchadd that attribute such that, if the nodeselector, ifselector is evaluatedbyon theserver, would returnresulting document, it returns thecontentattribute present in the request. The client SHOULD be certain, before making the request, that the resulting modified document will also be conformant to the schema.ItIf the result of the PUT isimportant to note thata 200 or 202 response, theelement might potentially be inserted inoperation was successful. If it was a 409, thedocumentuser performed some action which resulted inseveral different ways, and still meet the constraints defined above. This is analagousan invalid document. The 409 response may contain an XML body, formatted according to thecase when a new file is PUT into a directoryschema in Section 7.2.1.1, which provides further information ona server;thelocationnature ofthat file withinthedirectory is not specified,error. The client MAY use this information to try andis upalter thelocal file system to decide. The only guarantee isrequest so thatGET(PUT(x)) returns document x. 6.6 Replacingthis time, it might succeed. The client SHOULD NOT simply retry the request without changing some aspect of it. 6.8 Delete anElement inAttribute To delete attributes from theDocument Replacingdocument, the client constructs a URI whose document URI points to the document containing the attributes to be deleted. The node selector MUST be present, and evaluate to anelement ofattribute in the documentis also accomplished with PUT.to be deleted. Theonly difference withclient then invokes thebehavior above for insertion isHTTP DELETE method. The server will remove the attribute from the document. The client SHOULD be certain, before making the request, that thenode selector, when evaluated againstresulting modified document will also be conformant to the schema. If thecurrent document,result of the DELETE is amatch for200 response, the operation was successful. If it was a 409, the user performed some action which resulted in anelementinvalid document. The 409 response may contain an XML body, formatted according to the schema in Section 7.2.1.1, which provides further information on thecurrent document. That element is removed,nature of the error. The client MAY use this information to try andreplaced withalter thecontent ofrequest so that this time, it might succeed. The client SHOULD NOT simply retry thePUT request. 6.7 Deleterequest without changing some aspect of it. 6.9 Fetch anElementAttribute Todelete elements fromfetch an attribute of a document, the client constructs a URI Rosenberg Expires August 15, 2004 [Page 18] Internet-Draft XCAP February 2004 whosedocument URIDocument-URI points to the document containing theelementsattribute to bedeleted.fetched. The node selector MUST be present,and identifycontaining an expression identifying thespecific elementattribute whose value is to bedeleted.fetched. The client then invokes theHTTP DELETE method. TheGET method. The response will contain an "application/xml-attribute-value" document with the specified attribute, formatted according to the grammar of AttValue as defined in the XML 1.0 specifications. 6.10 Read/Modify/Write Transactions It is anticipated that a common operation will be to read the current version of a document or element, modify it on the client, and then write the change back to the server. In order for the results to be consistent with the client's expectations, the operation must be atomic. To accomplish this, the client makes use of entity tags returned by the server in a GET operation used to read the element, attribute, or document that is to be modified. To guarantee atomicity, the PUT operation used to write the changes back to the serverwill removeMUST contain an If-Match header field, whose value is equal to theelemententity tag from thedocument. The client SHOULD be certain, before makingprior GET response. If therequest,request fails with a 412 response, the client knows that another update of theresulting modified document will also be conformantdata has occurred before it was able to write theschema. 6.8 Fetch an Element Toresults back. The client can then fetchan element of a document,theclient constructsmost recent version, and attempt its modification again. Because there are no batching operations defined in HTTP that would allow for aURI whose document URI pointsnumber of separate create, modify or delete operations tothe document containing the elementbe performed atomically, designers of application usages should take care to structure their schemas so that operations that need to befetched. The node selector MUSTperformed atomically can bepresent, and must identifydone in a single operation. 6.11 Reading Server Assigned Data In some application usages, components of theRosenberg Expires April 26, 2004 [Page 13] Internet-Draft XCAP October 2003 element todocument cannot befetched. The client then invokesset by theGET method. The response will contain that XML element. Specifically, it containsuser. Rather, they must be filled in by thecontentserver. Such cases are documented as part of theXML document, starting withapplication usage. Frequently, theopening bracket forclient will want to know thebegin tagvalue assigned by the server. As an example, in the resource list application usage [22], the server assigns the uri forthat element, and ending witha resource list. The client will need this URI to subscribe to theclosing bracketresource list, for example. There are two ways such discovery can be accomplished. In theend tag for that element. 6.9 Create an Attribute To create an attribute in an existing element of a document,first, once the clientconstructsPUTs aURI whosedocumentURI points toor element that requires thedocumentdata to bemodified. The node selector MUST be present. The node selector is constructed such that it meets two constraints. First, if evaluated against the current document,filled in, theresult isclient can do ano-match. Secondly, if the attribute was addedsubsequent GET to find thedocument as desired byURI. This GET can be for theclient,entire document, thenode selector would selectsame URI thatattribute. The client then invokes the HTTP PUT method. The content defined bywas used in therequest MUST be compliantPUT, or a URI that points just to thegrammar for Attribute as defined in XML 1.0 [[OPEN ISSUE: content type?]].specific data assigned Rosenberg Expires August 15, 2004 [Page 19] Internet-Draft XCAP February 2004 by the server. Theserverresult of the GET willadd that attribute such that, iftell thenode selector is evaluated onclient about theresulting document, it returnsassigned data. Note that theattributeEtag present in therequest. The client SHOULDresponse is significant, as it will becertain, before makingdifferent from therequest, thatone returned in theresulting modified document will also be conformantprevious response tothe schema. 6.10 Replacing Attributes Replacing an attributePUT. That's because, as a result of the server's assignment, the document has changed, and isalso accomplished with PUT.therefore assigned a new Etag. Theonly difference withsecond way a client can learn about thebehavior above for insertionchange is through an event package that might be used to find out about changes to XCAP resources. It is important to note that the 200 OK response to a PUT isthatalways empty, and will not contain thenode selector, when evaluated againstdocument or element after thecurrent document,server has computed the necessary data. Rosenberg Expires August 15, 2004 [Page 20] Internet-Draft XCAP February 2004 7. Server Behavior An XCAP server isa match foranattributeHTTP 1.1 compliant origin server. The behaviors mandated by this specification relate to the way in which thecurrent document. That attributeHTTP URI isremoved,interpreted andreplaced withthe content is constructed. An XCAP server MUST be explicitly aware of thePUT request. 6.11 Deleting Attributes To delete attributes fromapplication usage against which requests are being made. That is, thedocument,server must be explicitly configured to handle URIs for each specific application usage, and must be aware of theclient constructsconstraints imposed by that application usage. When the server receives aURI whose document URI points torequest, thedocument containingtreatment depends on theattributes to be deleted. The node selector MUST be present, and evaluateURI. If the URI refers to anattribute inapplication usage not understood by thedocument to be deleted. The client then invokesserver, theHTTP DELETE method. Theserverwill remove the attribute from the document. The client SHOULD be certain, before makingMUST reject therequest, thatrequest with a 404 (Not Found) response. If theresulting modified document will also be conformantURI refers tothe schema. 6.12 Fetching Attributes Rosenberg Expires April 26, 2004 [Page 14] Internet-Draft XCAP October 2003 To fetch an attribute ofadocument,user that is not recognized by theclient constructsserver, it MUST reject the request with aURI whose Document-URI points to404 (Not Found). Next, thedocument containingserver authenticates theattribute to be fetched. The node selectorrequest. All XCAP servers MUSTbe present, containingimplement HTTP Digest [10]. Furthermore, servers MUST implement HTTP over TLS, RFC 2818 [13]. It is RECOMMENDED that administrators use anexpression identifyingHTTPS URI as theattribute whose value is to be fetched. TheXCAP root services URI, so that the digest clientthen invokesauthentication occurs over TLS. Next, theGET method. The response will contain document withserver determines if thespecified attribute, formatted accordingclient has authorization to perform thegrammar of Attribute as defined inrequested operation on theXML 1.0 specifications. 6.13 Read/Modify/Write Transactions Itresource. The default authorization policy isanticipatedthata common operation will be to read the current version of a document or element,only client X can access (create, read, write, modifyit onor delete) resources under theclient, and then"users/X" directory. Only priviledged administrators can write resources under thechange back"global" directory, but all users can read them. An application usage can specify an alternate default authorization policy specific tothe server. In orderthat usage. The server may also know of an application usage that itself defines authorization policies for another application usage. Of course, an administrator or privileged user can override theresults to be consistent withdefault authorization policy, although this specification provides no means for doing that. Once authorized, theclient's expectations,specific behavior depends on theoperation must be atomic. To accomplish this,method and what theclient makes useURI refers to. 7.1 POST Handling Resources managed by XCAP do not represent processing scripts. As a result, POST operations to XCAP URIs are not defined. A server receiving such a request for an xcap resource SHOULD return a 405. Rosenberg Expires August 15, 2004 [Page 21] Internet-Draft XCAP February 2004 7.2 PUT Handling The behavior ofentity tags returned by thea server in receipt of aGET operation used to read the element, attribute, or document that is to be modified. To guarantee atomicity, thePUToperation used to writerequest is as specified in HTTP 1.1 Section 9.6 - thechanges back tocontent of theserver MUST contain an If-Match header field, whose valuerequest isequalplaced at the specified location. This section serves to define theentity tag fromnotion of "placement" and "specified location" within theprior GET response.context of XCAP resources. If the requestfails withURI represents a412 response,document (i.e., there is no node selector component), theclient knows that another updatecontent of thedata has occurred before it was ablerequest MUST be a valid XML document, and MUST be compliant towritetheresults back. The client can then fetchschema associated with themost recent version, and attempt its modification again. Because there are no batching operations defined in HTTP, that would allow for a number of separate create, modify or delete operations to be performed atomically, designers ofapplicationusages should take care to structure their schemas so that operations that need to be performed atomically can be doneusage ina single operation. Rosenberg Expires April 26, 2004 [Page 15] Internet-Draft XCAP October 2003 7. Server Behavior An XCAP serverthe URI. If it isan HTTP 1.1 compliant origin server. The behaviors mandated by this specification relate tonot, theway in whichrequest MUST be rejected with a 409 response. If theHTTPrequest URI matches a document that exists on the server, that document isinterpreted andreplaced by the contentis constructed. An XCAP server MUST be explicitly awareof theapplication usage against which requests are being made. That is,request. If the request URI does not match a document that exists on the server, the servermust be explicitly configuredadds the document tohandle URIs for each specific application usage,its repository, andmust be aware of the constraints imposed by that application usage. Furthermore, an XCAP server MUST be aware of all ofassociates it with theXML namespaces presentURI inany documents it manages. This is to ensure that any data constraints or data interdependencies imposed by a future application usage are properly supported bytheserver. It is also required to ensurerequest URI. Note thatauthorization policies are properly implemented. When the server receives a request,this may require thetreatment dependscreation of one or more "directories" on theURI.server. If the Request URIrefers torepresents anapplication usage not understoodXML element (i.e., it contains a node selector, but no attribute selector) the server MUST verify that the document defined by the document URI exists. If no such document exists on the server, the server MUST reject the request with a 404(Not Found) response.response code. The content of the request MUST be a single XML element and associated content (including children elements), whose MIME type is "application/xml-fragment-body". If the request does not contain a valid XML fragment body, the request is rejected with a 409 response code. If the request URI matches an element within the document, that element is removed, and replaced with the content of the request. If the request URIrefers to a user that isdoes notrecognized bymatch an element in theserver, it MUST rejectdocument, the server inserts the content of the requestwithas a404 (Not Found). Next,new element in theserver authenticatesdocument, such that therequest. All XCAP servers MUST support HTTP Digest [6]. Furthermore, servers MUST support HTTP over TLS, RFC 2818 [9]. Itresulting document isRECOMMENDED that administrators use an HTTPS URI ascompliant to theXCAP root services URI, soschema, and such that thedigest client authentication occurs over TLS. Next, the server determines ifrequest URI, when evaluated, would now point to theclient has authorizationelement which was inserted. There may be more than one way to perform such an insertion; in that case, it is therequested operation ondiscretion of theresource. The default authorization policyimplementor as to how it is done. It may also be possible thatonly client X can access (create, read, write, modifythe insertion cannot be done because the parent of the element does not exist in the document, ordelete) resources undercannot be done because document, after the"users/X" directory. An application usage can specify an alternate default authorization policy specificelement is added, would not be compliant tothat usage. The server may also know of an application usage that itself defines authorization policies for another application usage. Of course, an administratorthe schema, orprivileged user can overridebecause thedefault authorization policy, although this specification providesnew element cannot be described by the node-selector nomeans for doing that. Once authorized,matter what its point of insertion. In such a case, the server MUST return a 409 response code. In all cases, thespecific behavior depends onresulting document MUST be compliant to themethod and whatschema. If the Request URIrefers to. 7.1 POST Handling Resources managed by XCAP do not represent processing scripts. Asrepresents an XML attribute (i.e., it contains aresult, POST operations to XCAP URIs is not defined. Anode selector and an attribute selector) the serverreceivingMUST verify that the document defined by the document URI exists. If no suchadocument exists on the server, the server MUST reject the requestSHOULD returnwith a405.404 Rosenberg ExpiresApril 26,August 15, 2004 [Page16]22] Internet-Draft XCAPOctober 2003 7.2 PUT HandlingFebruary 2004 response code. Thebehaviorcontent of the request will be aserver in receiptMIME object of type "application/xml-attribute-value", which represents aPUTsingle XML attribute. This attribute will be compliant to the grammar for AttValue as defined in XML 1.0. If the content is not a valid xml-attribute-value, the server rejects the request with a 409 response. If the request URI matches an existing attribute within the document, that attribute isas specifiedremoved, and replaced with the content of the request. If the request URI does not match an attribute inHTTP 1.1 Section 9.6 -the document, the server inserts the content of the request as a new attribute in the document, such that the resulting document is compliant to the schema, and such that the request URI, when evaluated, would now point to the attribute which was inserted. There may be more than one way to perform such an insertion; in that case, it isplaced atthespecified location. This section serves to definediscretion of the implementor as to how it is done. It may also be possible that the insertion cannot be done because thenotion of "placement" and "specified location" withincontaining element does not exist, or cannot be done because thecontextresult ofXCAP resources. Iftherequest URI representschange would be a document(i.e., therethat isno node selector component),not compliant to thecontent ofschema. In such a case, therequestserver MUSTbereturn avalid XML document, and409 response code. The server MUST check the resulting document for the presence of the "mandatory-schemas" element, which will always becompliant toa child of theschema associated withroot element. If this element is present, theapplication usage inserver checks each of theURI.schemas listed. Ifita schema isnot,listed which therequestserver does not support, the server MUSTbe rejectedreject the request with a 409 response. If therequest URI matches a document that exists on the server,application usage indicates thatdocumentthere isreplaced bya data dependency, thecontent ofserver checks to see if therequest. Ifinformation contained in therequest URI does not match a document that exists onPUT requires theserver,server to compute some component of the document. If it does, the serveraddsMUST perform thedocument to its repository,computation, andassociates it withthen update theURI indocument with therequest URI. Note that this may requireresult. Since thecreationdocument has changed, it represents a new instance ofone or more "directories" ontheserver.resource, and the server MUST assign a new etag. If theRequest URI represents an XML element (i.e., it containsapplication usage indicates that there is anode selector, but no attribute selector)data dependency, and that dependency requires the server to perform some kind of data validation beyond that specified in the XML schema, the server MUSTverify that the document defined byperform thedocument URI exists.validation. Ifno suchthe documentexists onfails theserver,validation, the server MUST reject the request with a 409response code.response. Thecontentserver MAY add an error report to the response, indicating the nature of therequestvalidation error. If the creation or insertion was successful, the server returns a 200 OK or 201 Created, as appropriate. This response MUSTbenot contain any content. 7.2.1 Detailed Conflict Reports In cases where the server returns asingle XML element and associated content (including children elements). If409 error response due to any of Rosenberg Expires August 15, 2004 [Page 23] Internet-Draft XCAP February 2004 therequest URI matches an element withinconditions described above, it MAY include a document in the body of the response which provides further details on the nature of the error. This document is an XML document,that elementformatted according to the schema of Section 7.2.1.1. Its MIME type, registered by this specification, isremoved, and replaced with"application/xcap-error+xml". The document structure is simple. It contains the root element "xcap-error". The content of this element is a specific error condition. Each error condition is represented by a different element. This allows for different error conditions to provide different data about the nature of therequest. Iferror. All error elements support a "phrase" attribute, which can contain text meant for rendering to a human user. The "schema-validation-error" element indicates that the document was not compliant to the schema after the requested operation was performed. The "not-xml-frag" element indicates that the requestURI doeswas supposed to contain a valid XML fragment body, but did not. Most likely this is because the XML in the body was malformed or notmatchbalanced. The "no-parent" element indicates that an attempt to insert an elementinfailed, because thedocument,element into which theserver insertsinsertion was supposed to occur did not exist. This element can contain an optional "ancestor" element, which provides an HTTP URI pointed to thecontent ofxcap resource that identifies therequest as a newclosest ancestor element that does exist in thedocument, suchdocument. The "cannot-insert" element provides a generic catch-all for other insertion cases. The "no-xml-att-value" element indicates that theresulting document is compliantrequest was supposed tothe schema, and suchcontain a valid XML attribute value, but did not. The "no-element" element indicates thatthe request URI, when evaluated, would now pointan attempt to insert an attribute was made, but the element in which the attribute wasinserted. There may be more than one waytoperform such an insertion; inbe inserted does not exist. The "uri-exists" element supports application usages thatcase, it is the discretion of the implementor as to howdefine data constraints. In particular, it isdone. It may also be possibleexpected that many application usages will require theinsertion cannot be done without other additional elements being inserted, or cannot be done because the new element is not compliantserver tothe schema. In suchcompute acase,URI, or allow theserver MUST returnclient to provide a409 response code.URI. Inall cases,either case, theresulting document MUST be compliantURI needs to be unique within theschema.domain of the server. If theRequest URI represents an XML attribute (i.e., it containsclient provides anode selectorURI, andan attribute selector)theserver MUST verifyURI already exists, it would be an error. This element describes thatthe document defined by the documentcondition. For each URIexists. If no such document exists on the server,provided by theserver MUST rejectclient which already exists, an "exists" element is present as therequest with a 409 response code. Thecontent ofthe request MUST be"uri-exists". Each "exists" element has asingle XML attribute, compliant to the grammar for Attribute as defined in XML 1.0 (i.e., name=value). If"uri" attribute that contains therequestURImatches an ent withinwhich exists. The "exists" element, in turn, can optionally contain a list of suggested alternate URIs which do not currently exist on thedocument,server. The "unknown-mand-ns" element indicates thatattribute is removed, and replaced withthe document contained a "mandatory-ns" element that listed a namespace not understood by the server. The content of therequest. If the request"unknown-mand-ns" element is a list of "ns" elements, each one containing a URIdoes not match an attribute in theidentifying a namespace Rosenberg ExpiresApril 26,August 15, 2004 [Page17]24] Internet-Draft XCAPOctober 2003February 2004 listed as mandatory in the document, but was not understood by theserver insertsserver. As an example, thecontent offollowing document indicates that therequest asuser attempted to create anew attribute inresource list using thedocument, suchURI sip:friends@example.com, but thattheURI already exists: <?xml version="1.0" encoding="UTF-8"?> <xcap-error xmlns="urn:ietf:params:xml:ns:xcap-error" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <uri-exists> <exists uri="sip:friends@example.com"> <alt-uri>sip:friends2@example.com</alt-uri> </exists> </uri-exists> </xcap-error> 7.2.1.1 XML Schema <?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="urn:ietf:params:xml:ns:xcap-error" xmlns="urn:ietf:params:xml:ns:xcap-error" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="xcap-error"> <xs:annotation> <xs:documentation>Indicates the reason for the error.</xs:documentation> </xs:annotation> <xs:complexType> <xs:choice> <xs:element name="schema-validation-error"> <xs:annotation> <xs:documentation>The resulting documentiswas not compliant to theschema, and such that theschema.</xs:documentation> </xs:annotation> <xs:complexType> <xs:attribute name="phrase" type="xs:string" use="optional"/> </xs:complexType> </xs:element> <xs:element name="not-xml-frag"> <xs:annotation> <xs:documentation>The requestURI, when evaluated, would now point to the attribute which was inserted. There maydid not contain a valid xml fragment body.</xs:documentation> </xs:annotation> <xs:complexType> <xs:attribute name="phrase" type="xs:string" use="optional"/> </xs:complexType> </xs:element> <xs:element name="no-parent"> <xs:annotation> Rosenberg Expires August 15, 2004 [Page 25] Internet-Draft XCAP February 2004 <xs:documentation>The element could not bemore than one way to perform such an insertion;inserted because its parent does not exist inthat case, it is the discretion oftheimplementor asdocument.</xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element name="ancestor" type="xs:anyURI" minOccurs="0"> <xs:annotation> <xs:documentation>Contains an HTTP URI that points tohow itthe element which isdone. It may also be possible thattheinsertion cannotclosest ancestor that does exist.</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> <xs:attribute name="phrase" type="xs:string" use="optional"/> </xs:complexType> </xs:element> <xs:element name="cannot-insert"> <xs:annotation> <xs:documentation>The element could not bedone without other additional content being inserted, or cannotinserted.</xs:documentation> </xs:annotation> <xs:complexType> <xs:attribute name="phrase" type="xs:string" use="optional"/> </xs:complexType> </xs:element> <xs:element name="not-xml-att-value"> <xs:annotation> <xs:documentation>The request did not contain a valid xml attribute value.</xs:documentation> </xs:annotation> <xs:complexType> <xs:attribute name="phrase" type="xs:string" use="optional"/> </xs:complexType> </xs:element> <xs:element name="no-element"> <xs:annotation> <xs:documentation>The attribute could not bedoneinserted because thenew attribute iselement in which to insert does notcompliantexist.</xs:documentation> </xs:annotation> <xs:complexType> <xs:attribute name="phrase" type="xs:string" use="optional"/> </xs:complexType> </xs:element> <xs:element name="uri-exists"> <xs:annotation> <xs:documentation>The user tried tothe schema. In suchset acase,URI that the serverMUST return a 409 response code. In all cases,must constrain to be unique, and this URI exists.</xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element name="exists" maxOccurs="unbounded"> <xs:annotation> <xs:documentation>There is an instance of this element for each URI in theresultingdocumentMUSTwhich suffered this failure.</xs:documentation> </xs:annotation> <xs:complexType> Rosenberg Expires August 15, 2004 [Page 26] Internet-Draft XCAP February 2004 <xs:sequence minOccurs="0"> <xs:element name="alt-uri" type="xs:string" maxOccurs="unbounded"> <xs:annotation> <xs:documentation>An optional set of alternate URIs can becompliant to the schema. If the creation or insertionprovided.</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> <xs:attribute name="uri" type="xs:anyURI" use="required"/> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="phrase" type="xs:string" use="optional"/> </xs:complexType> </xs:element> <xs:element name="unknown-mand-ns"> <xs:annotation> <xs:documentation>The document had a mandatory namespace which wassuccessful,not understood by theserver returns a 200 OK or 201 Created, as appropriate.server.</xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element name="ns" type="xs:anyURI" maxOccurs="unbounded"> <xs:annotation> <xs:documentation>Each unknown namespace is listed.</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema> 7.3 GET Handling The semantics of GET are as specified in RFC 2616. This section clarifies the specific content to be returned for a particular URI that represents an XCAP resource. If the request URI contains only a document URI, the server returns the document specified by the URI if it exists, else returns a 404 response. The MIME type of the response SHOULD be the most specific type known for that document (i.e., "application/resource-lists+xml" instead of "application/xml"). If the request URI contains a node selector, and that node selector identifies an XML element in an Rosenberg Expires August 15, 2004 [Page 27] Internet-Draft XCAP February 2004 existing document, that element is returned in the 200 response. The MIME type of the response MUST be "application/xml-fragment-body". The content of the response is the portion of the XML document starting with the left bracket of the begin tag of the element, ending with the right bracket of the end tag of the element. If the request URI contains a node selector, and that node selector contains an attribute selector, and that attribute exists in the specified document, the server returns thatattribute,attribute. The MIME type of the response MUST be "application/xml-attribute-value", which contains an XML attribute value formattedas Attributeaccording to the grammar of AttValue in the XML 1.0 specifications. In all cases, if the referenced resource does not exist, a 404 is returned. 7.4 DELETE Handling The semantics of DELETE are as specified in RFC 2616. This section clarifies the specific content to be deleted for a particular URI that represents an XCAP resource. If therequest URI contains only a Document-URI,request URI contains only a Document-URI, the server deletes the document specified by the URI if it exists and returns a 200 OK response, else returns a 404 response. If the request URI specifies a Node-Selector, the server verifies that the document specified by the Document-URI exists. If it does not exist, the server returns a 404 (Not Found) response. If the document does exist, and the node selector specifies an XML element that exists, that element is removed from the document. If the document does exist, and the node selector specifies an XML attribute that exists in the document, that attribute is removed from the document. If the node selector returns a no-match, a 404 (Not Found) is returned. However, if removal of the element or attribute would result in a document which does not comply with the XML schema for the application usage, the serverdeletes the document specified byMUST NOT perform theURI if it existsdeletion, andreturns a 200 OK response, else returns a 404 response. IfMUST reject the request with a 409 (Conflict). 7.5 Managing Etags An XCAP server MUST maintain entity tags for all resources that can be referenced by a URIspecifieswithin aNode-Selector,particular document. RFC 2616 allows for entity tags for one resource to be applied to other resources. In the case of XCAP resources, a serververifiesMUST use the same etag to reference all resources that define elements within a particular document. In other words, the server effectively maintains a single etag per document, and all resources within that documentspecified byinherit theDocument-URI exists. Ifsame etag. This constraint is necessary for a client to make changes to various parts of a document even though itdoes not exist,only posesses theserver returns a 404 (Not Found) response. Ifetag for thedocument does exist, andRosenberg Expires August 15, 2004 [Page 28] Internet-Draft XCAP February 2004 overall document. Rosenberg Expires August 15, 2004 [Page 29] Internet-Draft XCAP February 2004 8. Examples This section goes through several examples, making use of thenode selector specifiesresource-lists [22] XCAP application usage. First, a user Bill creates a new document (see Section 6.1). This document is a new resource-list, initially with no users in it: PUT http://xcap.example.com/services/presence-lists/users/bill/fr.xml HTTP/1.1 Content-Type:application/presence-lists+xml <?xml version="1.0" encoding="UTF-8"?> <resource-lists xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <list name="friends" uri="sip:friends@example.com" subscribeable="true"> </list> </resource-lists> Next, Bill creates anXML element that exists, thatelementisin this document (Section 6.4). In particular, he adds an entry to the list: PUT http://xcap.example.com/services/presence-lists/users/bill/fr.xml/ resource-lists/list[@name="friends"]/entry HTTP/1.1 Content-Type:application/xml-fragment-body <entry name="Bob" uri="sip:bob@example.com"> <display-name>Bob Jones</display-name> </entry> Next, Bill fetches the document (Section 6.3): GET http://xcap.example.com/services/presence-lists/users/bill/fr.xml HTTP/1.1 And the result is: Rosenberg ExpiresApril 26,August 15, 2004 [Page18]30] Internet-Draft XCAPOctober 2003 removed from the document. If the document does exist, and the node selector specifies an XML attribute that exists inFebruary 2004 HTTP/1.1 200 OK Etag: "wwhha" Content-Type: application/presence-lists+xml <?xml version="1.0" encoding="UTF-8"?> <resource-lists xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <list name="friends" uri="sip:friends@example.com" subscribeable="true"> <entry name="Bob" uri="sip:bob@example.com"> <display-name>Bob Jones</display-name> </entry> </list> </resource-lists> Next, Bill adds another entry to thedocument, that attributelist, which isremoved from the document. If the node selector returns a no-match, a 404 (Not Found)another list that has three entries. This isreturned. However, if removal of theanother elementor attribute would result in a document which does not comply with the XML schema for the application usage,creation (Section 6.4): PUT http://xcap.example.com/services/presence-lists/users/bill/fr.xml/ presence-lists/list[@name="friends"]/list[@name="close-friends"] HTTP/1.1 Content-Type: application/xml-fragment-body <list name="close-friends" uri="sip:close-friends@example.com" subscribeable="true"> <entry name="Joe" uri="sip:joe@example.com"> <display-name>Joe Smith</display-name> </entry> <entry name="Nancy" uri="sip:nancy@example.com"> <display-name>Nancy Gross</display-name> </entry> <entry name="Petri" uri="sip:petri@example.com"> <display-name>Petri Aukia</display-name> </entry> </list> Then, Bill decides he doesnt want Petri on theserver MUST NOT performlist, so he deletes thedeletion, and MUST rejectentry (Section 6.5): DELETE http://xcap.example.com/services/presence-lists/users/bill/fr.xml/ presence-lists/list/list/entry[@name="Petri"] HTTP/1.1 Bill decides to check on therequest with a 409 (Conflict). 7.5 Managing Etags An XCAP server MUST maintain entity tagsURI forall resources that can be referenced byNancy, so he fetches aURI. Specifically, this means that each document, and within the document, each elementparticular attribute (Section 6.6): Rosenberg Expires August 15, 2004 [Page 31] Internet-Draft XCAP February 2004 GET http://xcap.example.com/services/presence-lists/users/bill/fr.xml/ presence-lists/list/list/entry[@name="Nancy"]/@uri HTTP/1.1 andattribute, MUST be associated with an entity tag maintained bytheserver. These entity tags are needed to support conditional PUT and DELETE requests. When a PUT requestserver responds: HTTP/1.1 200 OK Etag: "ad88" Content-Type:application/xml-attribute-value "sip:nancy@example.com" Rosenberg Expires August 15, 2004 [Page 32] Internet-Draft XCAP February 2004 9. Security Considerations Frequently, the data manipulated by XCAP contains sensitive information. To avoid eavesdroppers from seeing this information, it ismadeRECOMMENDED thatcreates or replaces a document,an admistrator hand out an https URI as theentity tag of that documentXCAP root services URI. This will result in TLS-encrypted communications between the client andall elementsserver, preventing any eavesdropping. Client andattributes within is updated. When a PUT requestserver authentication are also important. A client needs to be sure it ismadetalking toa URI referencing an XML element,theentity tag of that element, its attributes, and all of its enclosed children and their attributesserver it believes it isupdated. For a PUT or DELETE request for an XML element, the entity tag of all elementscontacting. Otherwise, it may be given false information, whichare ancestors of that element are updated. However, the entity tags of attributes belongingcan lead toelements that are ancestorsdenial ofthe modified element do not have their entity tags changed, because those resources have not actually changed. Whenservice attacks against aPUT request is made toclient. To prevent this, aURI referencing an XML attribute, the entityclient SHOULD attempt to upgrade [14] any connections to TLS. Similarly, authorization ofthat attributeread and write operations against the data isupdated. Forimportant, and this requires client authentication. As aPUT or DELETE request for an attribute, the entity tags forresult, a server SHOULD challenge a client using HTTP Digest [10] to establish itselement,identity, andall elements that are ancestors of that element are updated.this SHOULD be done over a TLS connection. Rosenberg ExpiresApril 26,August 15, 2004 [Page19]33] Internet-Draft XCAPOctober 2003 8. Examples This section goes throughFebruary 2004 10. IANA Considerations There are severalexamples, making use of the resource-lists [17]IANA considerations associated with this specification. 10.1 XCAPapplication usage. First, a user Bill createsApplication Usage IDs This specification instructs IANA to create a newresource-list, initially with no usersregistry for XCAP application usage IDs (AUIDs). XCAP AUIDs are registered by the IANA when they are published init: PUT http://xcap.example.com/services/presence-lists/users/bill/fr.xml HTTP/1.1 Content-Type:application/presence-lists+xml <?xml version="1.0" encoding="UTF-8"?> <resource-lists xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <list name="friends" uri="sip:friends@example.com" subscribeable="true"> </list> </resource-lists> Next, Bill adds an entry tostandards track RFCs. The IANA Considerations section of thelist: PUT http://xcap.example.com/services/presence-lists/users/bill/fr.xml? resource-lists/list[@name="friends"]/entry HTTP/1.1 Content-Type:text/plain <entry name="Bob" uri="sip:bob@example.com"> <display-name>Bob Jones</display-name> </entry> Next, Bill fetchesRFC must include thelist: GET http://xcap.example.com/services/presence-lists/users/bill/fr.xml HTTP/1.1 Andfollowing information, which appears in theresult is: Rosenberg Expires April 26, 2004 [Page 20] Internet-Draft XCAP October 2003 HTTP/1.1 200 OK Etag: "wwhha" Content-Type: application/xml <?xml version="1.0" encoding="UTF-8"?> <resource-lists xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <list name="friends" uri="sip:friends@example.com" subscribeable="true"> <entry name="Bob" uri="sip:bob@example.com"> <display-name>Bob Jones</display-name> </entry> </list> </resource-lists> Next, Bill adds another entry toIANA registry along with thelist, which is another listRFC number of the publication. Name of the AUID. The name MAY be of any length, but SHOULD be no more than twenty characters long. The name MUST consist of alphanum [15] characters only. Descriptive text thathas three entries: PUT http://xcap.example.com/services/presence-lists/users/bill/fr.xml? presence-lists/list[@name="friends"]/list[@name="close-friends"] HTTP/1.1 Content-Type:text/plain <list name="close-friends" uri="sip:close-friends@example.com" subscribeable="true"> <entry name="Joe" uri="sip:joe@example.com"> <display-name>Joe Smith</display-name> </entry> <entry name="Nancy" uri="sip:nancy@example.com"> <display-name>Nancy Gross</display-name> </entry> <entry name="Petri" uri="sip:petri@example.com"> <display-name>Petri Aukia</display-name> </entry> </list> Then, Bill decides he doesnt want Petri ondescribes the application usage. 10.2 application/xml-fragment-body MIME Type This specification registers a new MIME type according to thelist, so he deletesprocedures of RFC 2048 [7] and guidelines in RFC 3023 [8]. MIME media type name: application MIME subtype name: xml-fragment-body Mandatory parameters: none Optional parameters: Same as charset parameter application/xml as specified in RFC 3023 [8]. Encoding considerations: Same as encoding considerations of application/xml as specified in RFC 3023 [8]. Security considerations: See Section 10 of RFC 3023 [8]. Interoperability considerations: none. Published specification: The XML Fragment Interchange [4], which defines an XML fragment body as a well-balanced region of an XML document being considered as (logically and/or physically) separate from theentry: DELETE http://xcap.example.com/services/presence-lists/users/bill/fr.xml? presence-lists/list/list/entry[@name="Petri"] HTTP/1.1 Bill decides to check onrest of theURIdocument forNancy: Rosenberg Expires April 26, 2004 [Page 21] Internet-Draft XCAP October 2003 GET http://xcap.example.com/services/presence-lists/users/bill/fr.xml? presence-lists/list/list/entry[@name="Nancy"]/@uri HTTP/1.1 andtheserver responds: HTTP/1.1 200 OK Etag: "ad88" Content-Type:text/plain uri="sip:nancy@example.com"purposes of defining it as a fragment. Rosenberg ExpiresApril 26,August 15, 2004 [Page22]34] Internet-Draft XCAPOctober 2003 9. Security Considerations Frequently, the data manipulated by XCAP contains sensitive information. To avoid eavesdroppers from seeingFebruary 2004 Applications which use thisinformation, it is RECOMMENDED that an admistrator hand out an https URI as the XCAP root services URI.media type: Thiswill resultdocument type has been used to support transport of XML fragment bodies inTLS-encrypted communications betweenRFC XXXX [[NOTE TO RFC EDITOR: Please replace XXXX with theclient and server, preventing any eavesdropping. Clientpublished RFC number of this specification.]], the XML Configuration Access Protocol (XCAP). Additional Information: Magic Number: None File Extension: .xfb or .xml Macintosh file type code: "TEXT" Personal andserver authentication are also important. A client needsemail address for further information: Jonathan Rosenberg, jdrosen@jdrosen.net Intended usage: COMMON Author/Change controller: The IETF. 10.3 application/xml-attribute-value MIME Type This specification registers a new MIME type according tobe sure itthe procedures of RFC 2048 [7] and guidelines in RFC 3023 [8]. MIME media type name: application MIME subtype name: xml-attribute-value Mandatory parameters: none Optional parameters: Same as charset parameter application/xml as specified in RFC 3023 [8]. Encoding considerations: Same as encoding considerations of application/xml as specified in RFC 3023 [8]. Security considerations: See Section 10 of RFC 3023 [8]. Interoperability considerations: none. Published specification: An entity of this MIME type istalkingcompliant to theserver it believes it is contacting. Otherwise, it may be given false information,grammar for AttValue as specified in XML 1.0 [1]. Rosenberg Expires August 15, 2004 [Page 35] Internet-Draft XCAP February 2004 Applications whichcan leaduse this media type: This document type has been used todenialsupport transport ofservice attacks against a client. To prevent this, a client SHOULD attempt to upgrade [10] any connections to TLS. Similarly, authorizationXML attribute values in RFC XXXX [[NOTE TO RFC EDITOR: Please replace XXXX with the published RFC number ofread and write operations againstthis specification.]], thedata is important,XML Configuration Access Protocol (XCAP). Additional Information: Magic Number: None File Extension: .xav Macintosh file type code: "TEXT" Personal andthis requires client authentication. As a result, a server SHOULD challengeemail address for further information: Jonathan Rosenberg, jdrosen@jdrosen.net Intended usage: COMMON Author/Change controller: The IETF. 10.4 application/xcap-error+xml MIME Type This specification registers aclient using HTTP Digest [6]new MIME type according toestablish its identity,the procedures of RFC 2048 [7] and guidelines in RFC 3023 [8]. MIME media type name: application MIME subtype name: xcap-error+xml Mandatory parameters: none Optional parameters: Same as charset parameter application/xml as specified in RFC 3023 [8]. Encoding considerations: Same as encoding considerations of application/xml as specified in RFC 3023 [8]. Security considerations: See Section 10 of RFC 3023 [8]. Interoperability considerations: none. Published specification: This specification. Applications which use this media type: This document type conveys error conditions defined in RFC XXXX. [[NOTE TO RFC EDITOR: Please replace XXXX with the published RFC number of thisSHOULD be done over a TLS connection.Rosenberg ExpiresApril 26,August 15, 2004 [Page23]36] Internet-Draft XCAPOctober 2003 10. IANA ConsiderationsFebruary 2004 specification.]] Additional Information: Magic Number: None File Extension: .xe Macintosh file type code: "TEXT" Personal and email address for further information: Jonathan Rosenberg, jdrosen@jdrosen.net Intended usage: COMMON Author/Change controller: The IETF. 10.5 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:xcap-must-understand Thisspecification instructs IANA to createsection registers a newregistry for XCAP application usage IDs (AUIDs). XCAP AUIDs are registered byXML namespace, as per theIANA when they are publishedguidelines instandards track RFCs.RFC 3688 [16]. URI: TheIANA Considerations sectionURI for this namespace is urn:ietf:params:xml:ns:xcap-must-understand Registrant Contact: IETF, SIMPLE working group, (simple@ietf.org), Jonathan Rosenberg (jdrosen@jdrosen.net). XML: BEGIN <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/> <title>Resource Lists Namespace</title> </head> <body> <h1>Namespace for XCAP Must Understand Element</h1> <h2>urn:ietf:params:xml:ns:xcap-must-understand</h2> <p>See <a href="[[[URL of published RFC]]]">RFCXXXX</a>.</p> </body> Rosenberg Expires August 15, 2004 [Page 37] Internet-Draft XCAP February 2004 </html> END 10.6 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:xcap-error This section registers a new XML namespace, as per theRFC must include the following information, which appearsguidelines inthe IANA registry along with theRFCnumber3688 [16]. URI: The URI for this namespace is urn:ietf:params:xml:ns:xcap-error Registrant Contact: IETF, SIMPLE working group, (simple@ietf.org), Jonathan Rosenberg (jdrosen@jdrosen.net). XML: BEGIN <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/> <title>Resource Lists Namespace</title> </head> <body> <h1>Namespace for XCAP Error Documents</h1> <h2>urn:ietf:params:xml:ns:xcap-error</h2> <p>See <a href="[[[URL of published RFC]]]">RFCXXXX</a>.</p> </body> </html> END 10.7 XCAP Error Schema Registration This section registers an XML schema per thepublication. Nameprocedures in [16]. URI: please assign. Registrant Contact: IETF, SIMPLE working group, (simple@ietf.org), Jonathan Rosenberg (jdrosen@jdrosen.net). Rosenberg Expires August 15, 2004 [Page 38] Internet-Draft XCAP February 2004 The XML for this schema can be found as the sole content of Section 7.2.1.1. 10.8 XCAP Mandatory Namespace Schema Registration This section registers an XML schema per theAUID.procedures in [16]. URI: please assign. Registrant Contact: IETF, SIMPLE working group, (simple@ietf.org), Jonathan Rosenberg (jdrosen@jdrosen.net). Thename MAYXML for this schema can be found as the sole content ofany length, but SHOULD be no more than twenty characters long.Section 4.7.1. Rosenberg Expires August 15, 2004 [Page 39] Internet-Draft XCAP February 2004 11. Acknowledgements Thename MUST consist of alphanum [11] characters only. Descriptive text that describes the application usage.author would like to thank Ben Campbell, Eva-Maria Leppanen, Hisham Khartabil, and Chris Newman for their input and comments. Rosenberg ExpiresApril 26,August 15, 2004 [Page24]40] Internet-Draft XCAPOctober 2003February 2004 Normative References [1] Bray, T., Paoli, J., Sperberg-McQueen, C. and E. Maler, "Extensible Markup Language (XML) 1.0 (Second Edition)", W3C FirstEdition REC-xml-20001006, October 2000. [2] Thompson, H., Beech, D., Maloney, M. and N. Mendelsohn, "XML Schema Part 1: Structures", W3C REC REC-xmlschema-1-20010502, May 2001.[2][3] Bray, T., Hollander, D. and A. Layman, "Namespaces in XML", W3C REC REC-xml-names-19990114, January 1999. [4] Grosso, P. and D. Veillard, "XML Fragment Interchange", W3C CR CR-xml-fragment-20010212, February 2001. [5] Fielding, R., Gettys, J., Mogul, J.,Nielsen,Frystyk, H., Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.[3][6] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.[4][7] Freed, N., Klensin, J. and J. Postel, "Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures", BCP 13, RFC 2048, November 1996. [8] Murata, M., St. Laurent, S. and D. Kohn, "XML Media Types", RFC 3023, January 2001.[5][9] Clark, J. and S. DeRose, "XML Path Language (XPath) Version 1.0", W3C REC REC-xpath-19991116, November 1999.[6][10] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., Leach, P., Luotonen, A. and L. Stewart, "HTTP Authentication: Basic and Digest Access Authentication", RFC 2617, June 1999.[7][11] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997.[8][12] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998.[9][13] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.[10][14] Khare, R. and S. Lawrence, "Upgrading to TLS Within HTTP/1.1", RFC 2817, May 2000.[11]Rosenberg Expires August 15, 2004 [Page 41] Internet-Draft XCAP February 2004 [15] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M. and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002. [16] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004. Rosenberg ExpiresApril 26,August 15, 2004 [Page25]42] Internet-Draft XCAPOctober 2003February 2004 Informative References[12][17] Rosenberg, J., "A Presence Event Package for the Session Initiation Protocol (SIP)", draft-ietf-simple-presence-10 (work in progress), January 2003.[13][18] Rosenberg, J., "A Watcher Information Event Template-Package for the Session Initiation Protocol (SIP)", draft-ietf-simple-winfo-package-05 (work in progress), January 2003.[14][19] Rosenberg, J., "An Extensible Markup Language (XML) Based Format for Watcher Information", draft-ietf-simple-winfo-format-04 (work in progress), January 2003.[15][20] Roach, A., Rosenberg, J. and B. Campbell, "A Session Initiation Protocol (SIP) Event Notification Extension for Resource Lists", draft-ietf-simple-event-list-04 (work in progress), June 2003.[16][21] Rosenberg, J. and M. Isomaki, "Requirements for Manipulation of Data Elements in Session Initiation Protocol (SIP) for Instant Messaging and Presence Leveraging Extensions (SIMPLE) Systems", draft-ietf-simple-data-req-03 (work in progress), June 2003.[17][22] Rosenberg, J., "An Extensible Markup Language (XML) Configuration Access Protocol (XCAP) Usage for Presence Lists",draft-ietf-simple-xcap-list-usage-00draft-ietf-simple-xcap-list-usage-01 (work in progress),JuneOctober 2003.[18][23] Newman, C. and J. Myers, "ACAP -- Application Configuration Access Protocol", RFC 2244, November 1997.[19][24] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.[20][25] Roach, A., "Session Initiation Protocol (SIP)-Specific Event Notification", RFC 3265, June 2002. Rosenberg ExpiresApril 26,August 15, 2004 [Page26]43] Internet-Draft XCAPOctober 2003February 2004 Author's Address Jonathan Rosenberg dynamicsoft 600 Lanidex Plaza Parsippany, NJ 07054 US Phone: +1 973 952-5000 EMail: jdrosen@dynamicsoft.com URI: http://www.jdrosen.net Rosenberg ExpiresApril 26,August 15, 2004 [Page27]44] Internet-Draft XCAPOctober 2003February 2004 Intellectual Property Statement The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification can be obtained from the IETF Secretariat. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director. Full Copyright Statement Copyright (C) The Internet Society(2003).(2004). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assignees. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION Rosenberg ExpiresApril 26,August 15, 2004 [Page28]45] Internet-Draft XCAPOctober 2003February 2004 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.AcknowledgementAcknowledgment Funding for the RFC Editor function is currently provided by the Internet Society. Rosenberg ExpiresApril 26,August 15, 2004 [Page29]46] ----