Chapter 17
Service Configuration on the
Internet
Many services require a mechanism for allowing users to manage their service configuration.
For example, a presence server requires presentities (users) to authorize which watchers can
see their presence information. A Push-to-talk over Cellular (PoC) service requires users to
create and manage groups. Likewise a conference may require users to configure a dial-out
or dial-in list of participants, their privileges (who can speak or who can send or receive
which media type), and so on. All of these use cases share many commonalities: a user has
to perform non-real-time operations on a server to manipulate one or more documents that
configure or personalize their instance of the service.
Usually the user creates a configuration document locally in their terminal and then
uploads it to a server. Sometimes, the user just needs to make a small change to an existing
document, so it is not worth uploading the complete document. Instead, it is desireable to
have the capability to update part of the document. In some other cases the user changes their
usual terminal and uses a different one, so they may first need to download a fresh copy of
the current configuration document, make some changes, and upload it (either complete or a
part of it) to the server.
Typically, configuration documents are highly structured. Owing to this, the trend
nowadays is to use the Extensible Markup Language (XML) (specified by the World Wide
Web Consortium in the W3C recommendation XML 1.1 [93]), for formatting documents that
personalize the instance of the service.
So, we know that configuration documents are effectively XML documents, but how are
they sent to and received from the server that stores them? The XML Configuration Access
Protocol (XCAP) solves this vacuum.
17.1 The XML Configuration Access Protocol (XCAP)
The problem of document management can be depicted in its most simplified way as in
Figure 17.1. A user creates an XML document in his computer and wants to upload it to a
server. The server will use the document at a later time to produce a personalized instance of
the service.
The problem to be solved requires designing a protocol that allows such an upload
procedure. HTTP (specified in RFC 2616 [144]) provides a good baseline, since it provides
´ıa- M ar t´ın
The 3G IP Multimedia Subsystem (IMS): Merging the Internet and the Cellular Worlds Third Edition
Gonzalo Camarillo and Miguel A. Garc
© 2008 John Wiley & Sons, Ltd. ISBN: 978- 0- 470- 51662- 1
372
CHAPTER 17. SERVICE CONFIGURATION ON THE INTERNET
server
Terminal
Figure 17.1: Overview of Document Management
the POST and PUT methods for transferring files from the client to the server. It also contains
a GET method for downloading a document from the server. However, there are additional
requirements that prevent the usage of HTTP. For example, on many occasions users just
need to modify a small piece of an existing XML document. For instance, when a user wants
to add a “buddy” to his list of friends in the presence service: the user just wants to edit a few
bytes of a potentially large document. It is not worth uploading the whole XML document
again, since the document is mostly unchanged, just the modified content. HTTP alone does
not offer that functionality.
The IETF decided then to develop a set of conventions and rules for using HTTP to upload
and download complete or portions of XML documents to and from a server. This resulted in
the creation of XCAP (specified in RFC 4825 [277]). XCAP is, therefore, not a new protocol,
but a set of conventions for using HTTP for managing remotely stored XML documents.
Figure 17.2 shows a schematic representation of the protocol stack used by XCAP.
HTTP
TCP
XCAP
IP
Figure 17.2: The XCAP protocol stack
XCAP provides a client with the means to read, write, and modify XML application
configuration data remotely stored on a server. This includes, for example, modifying the list
of users in a presence list, authorization policies (e.g., a list of authorized watchers) or the list
of participants in a conference. XCAP does not control the user interface (e.g., the graphical
representation of the list), rather, it focuses on the data structure.
XCAP defines conventions that map XML documents and their components (e.g.,
elements, attributes) to HTTP URIs. Therefore, XCAP provides a unique way to represent an
XML document or a component with an HTTP URI. It also defines the rules that govern how
17.1. THE XML CONFIGURATION ACCESS PROTOCOL (XCAP)
373
modification of one resource affects another. This means that XCAP allows users to modify
an XML document, but still the resulting document has to be compliant with the original
XML schema. In addition, XCAP also defines the basic authorization policies associated
with access to resources.
XCAP implements a set of operations that are mapped to regular HTTP 1.1 methods. The
operations also set some HTTP headers to a particular value. XCAP provides the client with
the operations that can manipulate the whole XML document, an arbitrary XML element of
the document, or an arbitrary XML attribute of an element. For each of these levels, XCAP
provides the means for creating, deleting, modifying, replacing, and fetching. So combining
all together, XCAP provides the means to create, delete, modify, replace or fetch a complete
XML document, an element, or an attribute.
Figure 17.3 shows an example of an XCAP request in which Alice is sending an HTTP
PUT request to create a new presence list. We provide details of how to manipulate presence
lists in Chapter 19. For the time being, just notice that XCAP is merely HTTP and XML with
some additional rules. We are going to describe the basics of XML in Section 17.2.
PUT /pr-lists/users/sip:alice@example.com/friends.xml HTTP/1.1
Host: xcap.example.com
Content-Type: application/resource-lists+xml
Content-Length: 460
<?xml version="1.0" encoding="UTF-8"?>
<resource-lists
xmlns="urn:ietf:params:xml:ns:resource-lists">
<list name="family" uri="sip:family@example.com">
<entry name="Bob" uri="sip:bob@home1.com">
<display-name>Bob</display-name>
</entry>
<entry name="Cynthia" uri="sip:cynthia@example.com">
<display-name>Cynthia</display-name>
</entry>
</list>
</resource-lists>
Figure 17.3: Example of an XCAP operation
XCAP defines two functional elements: an XCAP client and an XCAP server. They
are depicted in Figure 17.4. An XCAP client is an HTTP 1.1 compliant client that supports
the rules and conventions specified by XCAP; it sends HTTP requests and receives HTTP
responses. An XCAP server is an HTTP 1.1 compliant server that also supports the rules and
conventions specified by XCAP; it receives HTTP requests and generates HTTP responses.
17.1.1 XCAP Application Usage
As explained in the previous section, XCAP is a generic protocol that can be used for a
number of purposes related to application data configuration of XML documents stored in a
server. We have also seen that there are a several applications that utilize XCAP. For example,
in the presence service, presentities use XCAP to control whether watchers can see all
374
CHAPTER 17. SERVICE CONFIGURATION ON THE INTERNET
Figure 17.4: XCAP functional elements
or part of the presence information (watcher authorization is described in greater detail in
Section 19.14). In a centralized conference service, the creator of a dial-out conference can
use XCAP to configure the list of participants of the conference. In general, whenever there
is a need to configure configuration application data, such as a list remotely stored in XML
format, XCAP is a good protocol to fulfill these needs.
Owing to this versatility XCAP introduces the concept of an application usage.An
application usage defines how a particular application uses XCAP to interact with the XCAP
server. For instance, each of the previously mentioned applications of XCAP (presence
list management, authorization policies, and conference list management) constitutes an
application usage on its own. Each application usage is identified by an AUID (Application
Unique ID) that uniquely identifies the application usage. There are two types of AUIDs:
standard (i.e., application usages standardized in the IETF) and vendor-proprietary (i.e.,
private application usages).
The IETF has defined a number of XCAP application usages related to the presence
service.
XCAP application usage for resource lists. Specified in RFC 4826 [273], provides the
means to manipulate resource lists that are typically used as presence lists.
XCAP application usage for presence authorization. Defined in RFC 5025 [276], allows
a client to specify presence authorization rules, i.e., the set of rules that grants
certain watchers the permissions to access certain subsets of the presentity’s presence
information.
XCAP application usage for manipulating presence documents. Specified in RFC 4827
[175], allows users to perform hard state manipulation of presence data, i.e., set
the presence status by configuration (i.e., using XCAP), as opposed to the soft state
manipulation performed through the more common presence publication, i.e., using
the SIP PUBLISH method.
17.2 An Overview of XML
XML documents constitute a very important aspect for configuring applications. Usually,
the application configuration data are stored in XML format, therefore, XML documents (or
portions of them) are transported between the client and the server. While there is extensive
literature on XML, we provide a high-level overview that allows readers to better understand
the protocol used for manipulating XML documents.
17.2. AN OVERVIEW OF XML
375
XML documents are text-based documents and, thus, are human-readable. XML
documents contain a structured representation of data, but the document itself does not do
anything. Therefore, an XML document merely provides the means to represent structured
data.
The XML document in Figure 17.5 contains the representation of the data pertaining to
the second edition of this book, which we assume is stored in a file named ims.xml.Let
us use this example to further illustrate a few concepts. The first line of the document is
the XML declaration that defines the XML version and the encoding used in the document.
Then, the data that constitute the tree follow through the following lines. Each node in the
tree is called an XML element. XML elements start with the name of the element enclosed in
angle brackets, e.g. <book>, and terminates with a closing tag that contains a slash ’/’ and
the name of the element, e.g. </book>.
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="urn:org:miguel:book"
isbn="0470018186" edition="2">
<title>The 3G IP Multimedia Subsystem (IMS)</title>
<subtitle>Merging the Internet and the cellular worlds</subtitle>
<author id="1">Gonzalo Camarillo</author>
<author id="2">Miguel A. Garcia-Martin</author>
<publisher>John Wiley and Sons, Ltd</publisher>
</book>
Figure 17.5: Example of an XML document: ims.xml
XML elements can contain other child elements, processing instructions, namespace
declarations, comments, and text nodes. In the example in Figure 17.5, the book element
contains the title,subtitle, and so on, child elements.
XML elements usually contain a text node that represents a value. In the example in
Figure 17.5, the value of the title element is “The 3G IP Multimedia Subsystem (IMS)”.
XML elements can be also empty, in which case, a compact notation can indicate the
beginning and end tags of the empty element by including a slash ’/’ at the end of the element
name. For example, <test/> is an empty element.
Last, XML elements can contain attributes that further characterize the element, typically
by defining its metadata. In Figure 17.5, the book element contains three attributes: xmlns,
isbn,andedition. Unlike elements, attributes cannot be empty and can only appear once
in a given element.
XML is extensible, so new elements and attributes can be added whenever they are
needed. This is, perhaps, the most important property of XML.
An XML document is said to be well formed when it meets the basic constraints for all
XML documents. For example, each open tag has a closing tag (except for the compact
notation of empty elements); the names of the attributes are unique; elements are properly
nested; attributes values must be quoted, etc.
Sometimes XML documents need to be drafted according to a predefined structure that
provides additional constraints of the data. In the example of Figure 17.5, there should not be
two title elements, but there can be several author elements. All of these constraints,
which are specific to the type of data that the XML document represents, are typically
defined in separate additional documents, for example, in Document Type Definition (DTD)