<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://commons.oreilly.com/wiki/skins/common/feed.css?97"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>JabChapter 6 - Revision history</title>
		<link>http://commons.oreilly.com/wiki/index.php?title=JabChapter_6&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.11.0</generator>
		<lastBuildDate>Thu, 20 Jun 2013 02:47:17 GMT</lastBuildDate>
		<item>
			<title>Uncopy: content navi added</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=JabChapter_6&amp;diff=25623&amp;oldid=prev</link>
			<description>&lt;p&gt;content navi added&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 14:23, 18 September 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{Content Programming Jabber}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=Jabber Namespaces=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=Jabber Namespaces=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;While the building blocks of the Jabber&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;While the building blocks of the Jabber&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:2068:newid:25623 --&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 18 Sep 2009 14:23:05 GMT</pubDate>			<dc:creator>Uncopy</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:JabChapter_6</comments>		</item>
		<item>
			<title>PLange: corrected one headline</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=JabChapter_6&amp;diff=2068&amp;oldid=prev</link>
			<description>&lt;p&gt;corrected one headline&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 21:48, 16 March 2007&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 726:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 726:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Discovering and using the AIM Transport's jabber:iq:gateway utility&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Discovering and using the AIM Transport's jabber:iq:gateway utility==== &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By browsing a service, we can tell whether it supports the&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&lt;/del&gt;By browsing a service, we can tell whether it supports the&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;tt&amp;gt;jabber:iq:gateway&amp;lt;/tt&amp;gt; utility:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;tt&amp;gt;jabber:iq:gateway&amp;lt;/tt&amp;gt; utility:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:1737:newid:2068 --&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 16 Mar 2007 21:48:41 GMT</pubDate>			<dc:creator>PLange</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:JabChapter_6</comments>		</item>
		<item>
			<title>Mikeh at 02:24, 16 September 2006</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=JabChapter_6&amp;diff=1737&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:24, 16 September 2006&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 580:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 580:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;{{Figure&lt;/del&gt;|&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;title=&lt;/del&gt;The example in the LDAP hierarchy&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[image:jab_0601.png&lt;/ins&gt;|The example in the LDAP hierarchy browsed|&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;center|350 px]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;browsed|&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;image=0596002025&lt;/del&gt;-&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;jab_0601.png&lt;/del&gt;&amp;lt;/code&amp;gt; Browse data isn't just something&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&lt;/ins&gt;-&amp;lt;/code&amp;gt; Browse data isn't just something&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;that can be retrieved; like presence, it can be pushed to an entity when&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;that can be retrieved; like presence, it can be pushed to an entity when&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;required. In the same way that an alert in the form of a&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;required. In the same way that an alert in the form of a&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:1736:newid:1737 --&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 16 Sep 2006 02:24:59 GMT</pubDate>			<dc:creator>Mikeh</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:JabChapter_6</comments>		</item>
		<item>
			<title>Mikeh at 02:19, 16 September 2006</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=JabChapter_6&amp;diff=1736&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Jabber Namespaces=&lt;br /&gt;
&amp;lt;br&amp;gt;While the building blocks of the Jabber&lt;br /&gt;
protocol, described in  Chapter 5, provide the groundwork for our&lt;br /&gt;
solutions, for our chess rules, something is still missing.&lt;br /&gt;
&lt;br /&gt;
A purity and elegance can be had with use of the  three core elements,&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt;, and&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt;, but a depth of  meaning is missing. While the core&lt;br /&gt;
elements define the moves we can make, it's the Jabber ''namespaces''&lt;br /&gt;
that provide us with the contextual set-moves that allow us to relate&lt;br /&gt;
Jabber to the real world.&lt;br /&gt;
&lt;br /&gt;
Namespaces provide a level of meaning, an environmental layer, above the&lt;br /&gt;
basic &amp;quot;packet-shunting&amp;quot; world that would exist if our elements were to&lt;br /&gt;
be passed back and forth bereft of context and application.&lt;br /&gt;
&lt;br /&gt;
Basic activities such as user registration, authentication, roster&lt;br /&gt;
management, and time-stamping are made possible by the application of&lt;br /&gt;
standard Jabber namespaces to our elements. This chapter serves as a&lt;br /&gt;
reference for all of Jabber's IQ and X namespaces. The IQ namespaces are&lt;br /&gt;
used to qualify attachments to &amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt; elements, while the&lt;br /&gt;
X namespaces are more ad hoc, and are used to add value, context, and&lt;br /&gt;
information to any type of packet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Namespace Usage == &lt;br /&gt;
&amp;lt;br&amp;gt;Chapter 5 frequently referred to ''namespaces''.&lt;br /&gt;
Jabber's namespaces are used within the message elements to qualify&lt;br /&gt;
payloads (distinct content) within these elements. For example:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq id='roster_0' type='result' from='dj@yak/Work'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query &amp;lt;tt&amp;gt;xmlns='jabber:iq:roster'&amp;lt;/tt&amp;gt;&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
jid='sabine@yak' name='sabine' subscription='both'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;group&amp;amp;gt;Family&amp;amp;lt;/group&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the &amp;lt;tt&amp;gt;jabber:iq:roster&amp;lt;/tt&amp;gt; namespace is used to qualify a chunk&lt;br /&gt;
of XML that contains roster information embedded in an&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt; element. A payload exists as a subelement of the&lt;br /&gt;
main element (that is, a child tag of the parent&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt;, or&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag) and, in XML terms, belongs to a different&lt;br /&gt;
namespace than the main element.&lt;br /&gt;
&lt;br /&gt;
The namespace of the ''main'' elements in the XML document that is&lt;br /&gt;
streamed across the connection—&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt;, &lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt;, and  &amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt; and indeed their&lt;br /&gt;
&amp;quot;standard&amp;quot; subelements, such as &amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt;'s&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;subject/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag—is defined in the root tag of the XML&lt;br /&gt;
document and in this case is  &amp;lt;tt&amp;gt;jabber:client&amp;lt;/tt&amp;gt;. Namespaces like&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:client&amp;lt;/tt&amp;gt; that are  used to qualify such XML document body&lt;br /&gt;
fragments are described in Section 5.3.2 in Chapter 5. While the main&lt;br /&gt;
elements in our client connection are qualified by&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:client&amp;lt;/tt&amp;gt;, each distinct payload (&amp;quot;attachment&amp;quot; is also a&lt;br /&gt;
good way to think of these additional chunks of XML) is qualified by one&lt;br /&gt;
of the specific namespaces listed in this chapter.&lt;br /&gt;
&lt;br /&gt;
Standard Jabber namespaces begin &amp;lt;tt&amp;gt;jabber:&amp;lt;/tt&amp;gt;, with a few&lt;br /&gt;
exceptions. It could be argued that the exceptions aren't really Jabber&lt;br /&gt;
standard since these are the namespaces that describe things like vCards&lt;br /&gt;
and XHTML payloads. There's nothing to stop you from defining your own&lt;br /&gt;
namespaces to qualify any sort of XML you'd like to attach to a Jabber&lt;br /&gt;
element. The only rule is that, if you do, it ''shouldn't'' begin with&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Further to the rule that Jabber standard namespaces begin with&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:&amp;lt;/tt&amp;gt;, the categorization can be seen as falling into two&lt;br /&gt;
distinct spaces. The first, the ''iq space'', contains namespaces that&lt;br /&gt;
qualify content within &amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt;-based conversations. The&lt;br /&gt;
second, the ''x space'', contains namespaces that qualify extensions&lt;br /&gt;
within all the elements (&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The IQ Namespaces == &lt;br /&gt;
&amp;lt;br&amp;gt;The namespaces that qualify attachments to&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt; elements are many and varied. After all, you could&lt;br /&gt;
say that the raison d'etre of this request/response mechanism is to&lt;br /&gt;
exchange structured information—and what better way to define that&lt;br /&gt;
information than with namespaces?&lt;br /&gt;
&lt;br /&gt;
This section looks briefly at each of the IQ namespaces in turn. Some of&lt;br /&gt;
them will be covered in more detail in later chapters, as they will be&lt;br /&gt;
used in examples that appear later in the book.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
=== jabber:iq:agent === &lt;br /&gt;
&amp;lt;/code&amp;gt;The &amp;lt;tt&amp;gt;jabber:iq:agent&amp;lt;/tt&amp;gt; namespace is used&lt;br /&gt;
to request and return information on an ''agent''. An agent is a service&lt;br /&gt;
running on a Jabber server, and it has a JID. To find out what features&lt;br /&gt;
the particular agent offers, an IQ-get can be made using this namespace:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='yak/groups'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='&amp;lt;tt&amp;gt;jabber:iq:agent&amp;lt;/tt&amp;gt;'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, a request for features is being made of the agent with the JID&lt;br /&gt;
&amp;lt;tt&amp;gt;yak/groups&amp;lt;/tt&amp;gt;, which is the standard name for the Shared Groups&lt;br /&gt;
service. The JID here is composed of a hostname (&amp;lt;tt&amp;gt;yak&amp;lt;/tt&amp;gt;) and a&lt;br /&gt;
resource (&amp;lt;tt&amp;gt;groups&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The response looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' to='dj@yak/Work' from='yak/groups'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='&amp;lt;tt&amp;gt;jabber:iq:agent&amp;lt;/tt&amp;gt;'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;Jabber Server&lt;br /&gt;
at yak&amp;amp;lt;/name&amp;amp;gt; &amp;amp;lt;url&amp;amp;gt;http://yak&amp;amp;lt;/url&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;service&amp;amp;gt;jabber&amp;amp;lt;/service&amp;amp;gt; &amp;amp;lt;register/&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In reality, although the agent or service itself is specified as the&lt;br /&gt;
recipient of the query, it is often a centralized mechanism that&lt;br /&gt;
responds on behalf of the agent if the agent itself doesn't or can't&lt;br /&gt;
respond. (This is the ''mod_agents'' module within the JSM.) This means&lt;br /&gt;
that the results of the query might not be as helpful as you might&lt;br /&gt;
expect. The only detail in the response shown here that might be of some&lt;br /&gt;
use is the &amp;lt;tt&amp;gt;&amp;amp;lt;register/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag, but that's actually&lt;br /&gt;
misleading as it's picked up from the general registration capabilities&lt;br /&gt;
configuration and not anything particular to what was queried.&lt;br /&gt;
&lt;br /&gt;
The main reason for this is actually also the answer to a question you&lt;br /&gt;
might have right now: &amp;quot;How do I know which agent JIDs I can query on a&lt;br /&gt;
particular Jabber server?&amp;quot; Indeed. It's very hit and miss to pick agent&lt;br /&gt;
JIDs at random. The &amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt; (plural) namespace defines&lt;br /&gt;
a ''list'' of agents. Usually what happens is that a query is made using&lt;br /&gt;
the &amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt; namespace, and then further detail is&lt;br /&gt;
requested with the &amp;lt;tt&amp;gt;jabber:iq:agent&amp;lt;/tt&amp;gt; for a particular agent.&lt;br /&gt;
However:&lt;br /&gt;
&lt;br /&gt;
* The general information for both queries comes from the same place in&lt;br /&gt;
the Jabber server configuration. &lt;br /&gt;
* That place is the &amp;lt;tt&amp;gt;&amp;amp;lt;agents/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag inside the JSM custom configuration, and is&lt;br /&gt;
deprecated in favor of the &amp;lt;tt&amp;gt;&amp;amp;lt;browse/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag. The&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:agent&amp;lt;/tt&amp;gt;-based agent facility query is slowly but surely&lt;br /&gt;
being replaced by the more generic but more powerful&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; mechanism (which is directly related to the&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;browse/&amp;amp;gt;&amp;lt;/tt&amp;gt; configuration area of the JSM). That said, it&lt;br /&gt;
is still supported for compatibility reasons; many Jabber clients still&lt;br /&gt;
use the &amp;lt;tt&amp;gt;jabber:iq:agent&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespaces in calls to discover services on the server. See Section&lt;br /&gt;
6.2.5 for more details on the &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; mechanism.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:agents === &lt;br /&gt;
&amp;lt;br&amp;gt;Whereas the &amp;lt;tt&amp;gt;jabber:iq:agent&amp;lt;/tt&amp;gt; namespace&lt;br /&gt;
is used in a query of an individual Jabber agent, or service, the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt; namespace is used in a query to retrieve a&lt;br /&gt;
''list'' of these agents.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the description for the &amp;lt;tt&amp;gt;jabber:iq:agent&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespace, the Jabber server configuration (in the JSM custom&lt;br /&gt;
configuration section) in earlier releases contained an&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;agents/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag, which was used to list the agents that&lt;br /&gt;
were available on the Jabber server. The listing looked like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;agents&amp;amp;gt; &amp;amp;lt;!-- Note: this &amp;amp;lt;agents/&amp;amp;gt; listing is not&lt;br /&gt;
used in 1.4.1 --&amp;amp;gt; &amp;amp;lt;agent jid='users.jabber.org'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;name&amp;amp;gt;Jabber User Directory&amp;amp;lt;/name&amp;amp;gt; &amp;amp;lt;description&amp;amp;gt; You&lt;br /&gt;
may register and create a public searchable profile, and search for&lt;br /&gt;
other registered Jabber users. &amp;amp;lt;/description&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;service&amp;amp;gt;jud&amp;amp;lt;/service&amp;amp;gt; &amp;amp;lt;register/&amp;amp;gt; &amp;amp;lt;search/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/agent&amp;amp;gt; &amp;amp;lt;agent jid='...'&amp;amp;gt; ... &amp;amp;lt;/agent&amp;amp;gt; ...&lt;br /&gt;
&amp;amp;lt;/agents&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;&amp;amp;lt;agents/&amp;amp;gt;&amp;lt;/tt&amp;gt; listing has now been superseded by the&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;browse/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag. In fact, when responding to&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt;''and''&amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; queries, the&lt;br /&gt;
Jabber server itself will refer to the same &amp;lt;tt&amp;gt;&amp;amp;lt;browse/&amp;amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
listing in both cases. Here's an example of a response to a&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt; query:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' to='dj@yak/laptop' from='yak'&lt;br /&gt;
id='agents'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:agents'&amp;amp;gt; &amp;amp;lt;agent&lt;br /&gt;
jid='users.jabber.org'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;Jabber User&lt;br /&gt;
Directory&amp;amp;lt;/name&amp;amp;gt; &amp;amp;lt;service&amp;amp;gt;jud&amp;amp;lt;/service&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;register/&amp;amp;gt; &amp;amp;lt;search/&amp;amp;gt; &amp;amp;lt;/agent&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can see that this response pretty much reflects the information in&lt;br /&gt;
the &amp;lt;tt&amp;gt;&amp;amp;lt;agents/&amp;amp;gt;&amp;lt;/tt&amp;gt; configuration.&lt;br /&gt;
&lt;br /&gt;
For more details on how this differs in response to a&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; query, see Section 6.2.5.&lt;br /&gt;
&lt;br /&gt;
Further examples of &amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt; usage can be found in&lt;br /&gt;
Section 9.3 in Chapter 9.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:auth === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:iq:auth&amp;lt;/tt&amp;gt; namespace is used to&lt;br /&gt;
qualify a structured authentication procedure between client and server.&lt;br /&gt;
&lt;br /&gt;
Details of authentication are covered in Chapter 7; however, here we&lt;br /&gt;
will look at the simplest authentication conversation between client and&lt;br /&gt;
server. In this example, the client sends a username and password, and&lt;br /&gt;
the server responds by sending a &amp;quot;successful&amp;quot; response, acknowledging&lt;br /&gt;
the user's credentials, thus creating a session for that user:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='set' id='auth0'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='&amp;lt;tt&amp;gt;jabber:iq:auth&amp;lt;/tt&amp;gt;'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;username&amp;amp;gt;sabine&amp;amp;lt;/username&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;password&amp;amp;gt;geheimnis&amp;amp;lt;/password&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;resource&amp;amp;gt;WinJab&amp;amp;lt;/resource&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' id='auth0'/&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:autoupdate === &lt;br /&gt;
&amp;lt;br&amp;gt;The Update Info Request configuration&lt;br /&gt;
description in Section 4.4.3.6 in Chapter 4 describes a mechanism for&lt;br /&gt;
Jabber servers to query a software version information repository to&lt;br /&gt;
find out about new versions of the server.&amp;lt;ref&amp;gt;By &amp;quot;Jabber server,&amp;quot; we're&lt;br /&gt;
referring to the JSM. &amp;lt;/ref&amp;gt; This version information repository that&lt;br /&gt;
responds to queries is also known as the Auto-Update service.&lt;br /&gt;
&lt;br /&gt;
Not only can servers request software update information, clients can&lt;br /&gt;
too. The procedure is the same in both cases and involves the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:autoupdate&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;jabber:x:autoupdate&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespaces. If clients support this software update information request,&lt;br /&gt;
it will usually be in the form of a &amp;quot;silent&amp;quot; request that it sends out&lt;br /&gt;
at startup. The sending out of this request can often be switched on and&lt;br /&gt;
off in the client's configuration.&lt;br /&gt;
&lt;br /&gt;
The conversation starts with the requester sending a special&lt;br /&gt;
availability packet to the information repository. Currently, there are&lt;br /&gt;
two such public repositories: one running at ''jabber.org'' covering a&lt;br /&gt;
wide range of Jabber software and the other running at ''jabber.com''&lt;br /&gt;
covering certain clients including JabberIM. This special availability&lt;br /&gt;
packet looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;presence to='959967024@update.jabber.org/1.6.0.3'/&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a ''directed''&amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; packet because it has a&lt;br /&gt;
&amp;lt;tt&amp;gt;to&amp;lt;/tt&amp;gt; attribute. What's even more interesting is that if we break&lt;br /&gt;
down the JID, we're left with ''959967024'' as the username,&lt;br /&gt;
''update.jabber.org'' as the hostname, and ''1.6.0.3'' as the resource.&lt;br /&gt;
This doesn't mean that the availability is destined for a user called&lt;br /&gt;
''959967024'' registered on the  ''update.jabber.org'' Jabber server.&lt;br /&gt;
While most presence packets are destined for users (within the presence&lt;br /&gt;
subscription model), this one is destined for a service.&lt;br /&gt;
&lt;br /&gt;
The service is running with the identification ''update.jabber.org''—a&lt;br /&gt;
component connected to the jabberd server backbone running at&lt;br /&gt;
''jabber.org''. Therefore, the &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; packet will be&lt;br /&gt;
routed to that service. Unlike the JSM, the ''update.jabber.org''&lt;br /&gt;
service has no concept of users or sessions. Instead, it receives the&lt;br /&gt;
complete &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; packet, disassembles the JID in the&lt;br /&gt;
destination address, and interprets component parts as it sees fit.&lt;br /&gt;
&lt;br /&gt;
The service uses the username portion of the JID to identify the piece&lt;br /&gt;
of software for which new version information is being requested. In our&lt;br /&gt;
example, this is ''959967024''. This value actually represents the JIM&lt;br /&gt;
client and is the key to the client database kept on&lt;br /&gt;
http://www.jabbercentral.org. Using a unique client database key to&lt;br /&gt;
represent the piece of software allows the client's name to be changed&lt;br /&gt;
without causing problems in the retrieval of version information by the&lt;br /&gt;
Auto Update service.&lt;br /&gt;
&lt;br /&gt;
The version information stored in the repository is compared to the&lt;br /&gt;
current version of the requesting piece of software; in this case, our&lt;br /&gt;
JIM Version 1.6.0.3. If a new version isn't available, nothing will&lt;br /&gt;
happen. Because the initial part of the request was a&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; packet, no official response is expected&lt;br /&gt;
(unlike a situation in which the initial part of the request was an&lt;br /&gt;
IQ-get).&lt;br /&gt;
&lt;br /&gt;
If there ''is'', however, information stored in the repository about&lt;br /&gt;
newer versions of the software, the query is replied to using a&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt; element, with a &amp;lt;tt&amp;gt;jabber:x:autoupdate&amp;lt;/tt&amp;gt;&lt;br /&gt;
attachment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;message to='qmacro@jabber.org/Work'&lt;br /&gt;
from='959967024@update.jabber.org'&amp;amp;gt; &amp;amp;lt;subject&amp;amp;gt;Upgrade available&lt;br /&gt;
for Jabber Instant Messenger&amp;amp;lt;/subject&amp;amp;gt; &amp;amp;lt;body&amp;amp;gt; There is an&lt;br /&gt;
update available for Jabber Instant Messenger. If your client supports&lt;br /&gt;
the iq:autoupdate namespace, then you should see something in the client&lt;br /&gt;
that will list the available files. If not, then go to&lt;br /&gt;
http://www.jabbercentral.com and grab the new version. &amp;amp;lt;/body&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;x&lt;br /&gt;
xmlns='jabber:x:autoupdate'&amp;amp;gt;959967024@update.jabber.org&amp;amp;lt;/x&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reply contains some text (in the &amp;lt;tt&amp;gt;&amp;amp;lt;subject/&amp;amp;gt;&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;body/&amp;amp;gt;&amp;lt;/tt&amp;gt; tags) that could be displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Furthermore, the &amp;lt;tt&amp;gt;autoupdate&amp;lt;/tt&amp;gt; attachment—an &amp;lt;tt&amp;gt;&amp;amp;lt;x/&amp;amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
subelement qualified by the &amp;lt;tt&amp;gt;jabber:x:autoupdate&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespace—contains information on where further information can be&lt;br /&gt;
obtained in a programmatic way.&amp;lt;ref&amp;gt;Remember that the Jabber namespaces&lt;br /&gt;
used to qualify &amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt; queries begin &amp;lt;tt&amp;gt;jabber:iq&amp;lt;/tt&amp;gt;,&lt;br /&gt;
while Jabber namespaces used to qualify general payloads to&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt;, or&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; begin &amp;lt;tt&amp;gt;jabber:x&amp;lt;/tt&amp;gt;. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This &amp;quot;programmatic way&amp;quot; involves sending an empty IQ-get, with the query&lt;br /&gt;
part qualified by the &amp;lt;tt&amp;gt;jabber:iq:autoupdate&amp;lt;/tt&amp;gt; namespace, to the&lt;br /&gt;
address given in the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:x:autoupdate&amp;lt;/tt&amp;gt;&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt; attachment:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' id='id_3'&lt;br /&gt;
to='959967024@update.jabber.org'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:autoupdate'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We're back on familiar ground; the Auto Update service responds to the&lt;br /&gt;
request by sending version information for that piece of software:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' to='qmacro@jabber.org/Work'&lt;br /&gt;
from='959967024@update.jabber.org' id='id_3'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:autoupdate'&amp;amp;gt; &amp;amp;lt;release priority='optional'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;url&amp;amp;gt;http://www.jabber.com/download/jabbersetup.exe&amp;amp;lt;/url&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;version&amp;amp;gt;1.7.0.14&amp;amp;lt;/version&amp;amp;gt; &amp;amp;lt;desc/&amp;amp;gt; &amp;amp;lt;/release&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The response contains information about the latest software release that&lt;br /&gt;
prompted the version request. The release is either ''required'' or&lt;br /&gt;
''optional'' (as in this example). The tags within the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:autoupdate&amp;lt;/tt&amp;gt;-qualified query are fairly&lt;br /&gt;
self-explanatory; note that the version description is empty in this&lt;br /&gt;
example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:browse === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; namespace is&lt;br /&gt;
relatively new and could almost be seen as a departure from the&lt;br /&gt;
traditional namespaces found elsewhere in Jabber. While namespaces such&lt;br /&gt;
as &amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;jabber:iq:register&amp;lt;/tt&amp;gt; define very&lt;br /&gt;
strict content using specific tag names, &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt;&lt;br /&gt;
allows a more free-form containment of information. Both forms of&lt;br /&gt;
''tight'' and ''loose'' namespaces have a place in Jabber.&lt;br /&gt;
&lt;br /&gt;
The real world contains countless types and classifications of&lt;br /&gt;
information far more than you could ever reasonably cover with a finite&lt;br /&gt;
collection of namespaces. And even if you did, that coverage would be&lt;br /&gt;
out of date as soon as it was completed. The Jabber concept of&lt;br /&gt;
''browsing'', introduced in Chapter 2, is an approach to being able to&lt;br /&gt;
classify and exchange information of all kinds without the definitions&lt;br /&gt;
being previously cast in stone.&lt;br /&gt;
&lt;br /&gt;
More or less any hierarchical information can be represented in the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; namespace. It can be seen as an open-ended way&lt;br /&gt;
of describing structures in an almost ad hoc way. That said, the&lt;br /&gt;
namespace comes with some general rules and some predefined&lt;br /&gt;
classifications.&lt;br /&gt;
&lt;br /&gt;
Information represented and described in a &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt;&lt;br /&gt;
extension is subject to classification. This classification is in two&lt;br /&gt;
levels: ''categories'' and ''subtypes''. The ''category'' is used to&lt;br /&gt;
define the general area or type of information being represented. The&lt;br /&gt;
''subtype'' gives a more specific definition of that category. Table 6-1&lt;br /&gt;
shows a list of initial categories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
&lt;br /&gt;
|+ jabber:iq:browse categories -&lt;br /&gt;
! Category !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;application&amp;lt;/tt&amp;gt; || Applications addressable via a JID can be&lt;br /&gt;
| described in this category. Initial suggestions for such application&lt;br /&gt;
| subtypes include &amp;lt;tt&amp;gt;calendar&amp;lt;/tt&amp;gt; (calendar/schedule services),&lt;br /&gt;
| &amp;lt;tt&amp;gt;whiteboard&amp;lt;/tt&amp;gt; (collaborative whiteboard tools), and&lt;br /&gt;
| &amp;lt;tt&amp;gt;game&amp;lt;/tt&amp;gt; (multiplayer games). &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;conference&amp;lt;/tt&amp;gt; || Used to describe elements in the conferencing&lt;br /&gt;
| (talk between three or more entities) world, such as private and&lt;br /&gt;
| public rooms. Subtypes of this category include &amp;lt;tt&amp;gt;private&amp;lt;/tt&amp;gt;&lt;br /&gt;
| (private chat rooms), &amp;lt;tt&amp;gt;irc&amp;lt;/tt&amp;gt; (IRC rooms), and &amp;lt;tt&amp;gt;url&amp;lt;/tt&amp;gt; (for&lt;br /&gt;
| web-based conferences). &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;headline&amp;lt;/tt&amp;gt; || Stock-ticker-style notification systems can be&lt;br /&gt;
| described using this category. Subtypes already defined include&lt;br /&gt;
| &amp;lt;tt&amp;gt;rss&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;logger&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;notice&amp;lt;/tt&amp;gt;. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;item&amp;lt;/tt&amp;gt; || A category placeholder, to effect hierarchies and&lt;br /&gt;
| lists in a &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; structure. You can fall back to&lt;br /&gt;
| this category for representation of pretty much any type of&lt;br /&gt;
| information in a navigable drill-down fashion. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;keyword&amp;lt;/tt&amp;gt; || IRC-style utilities that are invoked from a&lt;br /&gt;
| chat-input command line; so-called &amp;lt;tt&amp;gt;keyword&amp;lt;/tt&amp;gt; services such as&lt;br /&gt;
| dictionary lookups (subtype &amp;lt;tt&amp;gt;dictionary&amp;lt;/tt&amp;gt;), DNS resolution&lt;br /&gt;
| (subtype &amp;lt;tt&amp;gt;dns&amp;lt;/tt&amp;gt;), and FAQ answers (subtype &amp;lt;tt&amp;gt;faq&amp;lt;/tt&amp;gt;) have&lt;br /&gt;
| their category in the &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; world. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;render&amp;lt;/tt&amp;gt; || Translation services such as English to French&lt;br /&gt;
| (subtype &amp;lt;tt&amp;gt;en2fr&amp;lt;/tt&amp;gt;) or spelling tools (subtype &amp;lt;tt&amp;gt;spell&amp;lt;/tt&amp;gt;)&lt;br /&gt;
| are defined in this category. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;service&amp;lt;/tt&amp;gt; || Maps to traditional Jabber services, such as IM&lt;br /&gt;
| transports and gateways to other systems, user directories, and so on.&lt;br /&gt;
| Typical subtypes within this category are &amp;lt;tt&amp;gt;irc&amp;lt;/tt&amp;gt; (IRC gateway),&lt;br /&gt;
| &amp;lt;tt&amp;gt;aim&amp;lt;/tt&amp;gt; (AIM transport), and &amp;lt;tt&amp;gt;jud&amp;lt;/tt&amp;gt; (Jabber User&lt;br /&gt;
| Directory). &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;user&amp;lt;/tt&amp;gt; || Various addressable elements of users, such as their&lt;br /&gt;
| clients (subtype &amp;lt;tt&amp;gt;client&amp;lt;/tt&amp;gt;), inbox mechanisms (subtype&lt;br /&gt;
| &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;), and so on, find themselves in this category. &lt;br /&gt;
|}&lt;br /&gt;
	The categories listed in Table 6-1 are not exhaustive; the&lt;br /&gt;
	&amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; namespace and the browsing idea were&lt;br /&gt;
	introduced with Version 1.4 of the Jabber server and are still&lt;br /&gt;
	evolving. The same goes for the category subtypes.&lt;br /&gt;
&lt;br /&gt;
Any particular browsable entity can be described using the combination&lt;br /&gt;
of the category and subtype, for example, &amp;lt;tt&amp;gt;user/client&amp;lt;/tt&amp;gt;, in much&lt;br /&gt;
the same way that Multipurpose Internet Mail Extensions (MIME) types&lt;br /&gt;
are, for example, &amp;lt;tt&amp;gt;image/png&amp;lt;/tt&amp;gt;. The category describes generally&lt;br /&gt;
what the entity is, and the subtype further classifies the description. &lt;br /&gt;
Following the MIME system further, we can define our own subtypes on the&lt;br /&gt;
fly and specify them with an &amp;lt;tt&amp;gt;x-&amp;lt;/tt&amp;gt; prefix, such as&lt;br /&gt;
&amp;lt;tt&amp;gt;user/x-schedule&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Indeed, the browsing description model of category/subtype follows the&lt;br /&gt;
MIME model; in places the category is often referred to in Jabber&lt;br /&gt;
documentation as the ''JID-type''. The JID is critical to browsing; it&lt;br /&gt;
is a required attribute of all entities described in a&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt;-based hierarchy. The JID is the key to&lt;br /&gt;
navigating the hierarchy structure.&lt;br /&gt;
&lt;br /&gt;
Earlier in this section we saw the results of making a query in the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt; namespace to retrieve information on the&lt;br /&gt;
services available on a Jabber server. Now let's have a look at  a&lt;br /&gt;
similar query using the &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; namespace:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='yak'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:browse'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='dj@yak/home' from='yak'&amp;amp;gt; &amp;amp;lt;service&lt;br /&gt;
name='Jabber Server' type='jabber' xmlns='jabber:iq:browse'&lt;br /&gt;
jid='yak'&amp;amp;gt; &amp;amp;lt;conference name='yak Conferencing' type='public'&lt;br /&gt;
jid='conference.yak'/&amp;amp;gt; &amp;amp;lt;service name='yak User Directory'&lt;br /&gt;
type='jud' jid='jud.yak'&amp;amp;gt; &amp;amp;lt;ns&amp;amp;gt;jabber:iq:search&amp;amp;lt;/ns&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;ns&amp;amp;gt;jabber:iq:register&amp;amp;lt;/ns&amp;amp;gt; &amp;amp;lt;/service&amp;amp;gt; &amp;amp;lt;service&lt;br /&gt;
name='User Directory (Browsable)' type='jud' jid='jud.merlix/users'/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/service&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice how the information returned forms a hierarchy. The outermost&lt;br /&gt;
item in the browse results represents the Jabber server as a whole (with&lt;br /&gt;
the JID &amp;lt;tt&amp;gt;yak&amp;lt;/tt&amp;gt;) and contains subitems that are services of that&lt;br /&gt;
Jabber server (the &amp;lt;tt&amp;gt;yak Conferencing&amp;lt;/tt&amp;gt; service, and the two forms&lt;br /&gt;
of the JUD). Notice also the JID-types. Looking at the tag names and the&lt;br /&gt;
&amp;lt;tt&amp;gt;type&amp;lt;/tt&amp;gt; attributes, we see that the result  represents a&lt;br /&gt;
&amp;lt;tt&amp;gt;service/jabber&amp;lt;/tt&amp;gt; entity, which itself contains a&lt;br /&gt;
&amp;lt;tt&amp;gt;conference/public&amp;lt;/tt&amp;gt; and two &amp;lt;tt&amp;gt;service/jud&amp;lt;/tt&amp;gt; entities.&lt;br /&gt;
&lt;br /&gt;
How many levels of hierarchy can we expect to receive (as a browsing&lt;br /&gt;
information consumer) or provide (as a browsing information provider) in&lt;br /&gt;
any given situation? It really depends on the application situation and&lt;br /&gt;
the balance you want to achieve between shallow hierarchy responses and&lt;br /&gt;
many IQ calls for navigational descent (light extensions but more&lt;br /&gt;
traffic) and deeper hierarchy responses and few IQ calls for&lt;br /&gt;
navigational descent (heavier extensions but less traffic).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Descending the browse hierarchy from an LDAP reflector ==== &lt;br /&gt;
&amp;lt;br&amp;gt;As an example, let's look at how we might perform a hierarchy descent in the&lt;br /&gt;
navigation of Lightweight Directory Access Protocol (LDAP) information&lt;br /&gt;
provided by a custom LDAP reflector in a &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt;&lt;br /&gt;
context.&amp;lt;ref&amp;gt;In fact, one of the recipes in Chapter 10 is an LDAP&lt;br /&gt;
reflector. Some background information on LDAP is given there. &amp;lt;/ref&amp;gt;&lt;br /&gt;
Each time, the link to the next level is via the item's JID, which is&lt;br /&gt;
the target of the browse query.&lt;br /&gt;
&lt;br /&gt;
First, we send an initial query:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type=&amp;quot;get&amp;quot; id=&amp;quot;browser_JCOM_15&amp;quot; to=&amp;quot;ldap.yak&amp;quot;&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns=&amp;quot;jabber:iq:browse&amp;quot;&amp;amp;gt;&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In answer to the initial query to what is effectively the LDAP root&lt;br /&gt;
represented by the JID of the LDAP component itself (&amp;lt;tt&amp;gt;ldap.yak&amp;lt;/tt&amp;gt;,&lt;br /&gt;
no username prefix), the initial hierarchy level containing&lt;br /&gt;
&amp;lt;tt&amp;gt;People&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Groups&amp;lt;/tt&amp;gt; is returned, wrapped in a&lt;br /&gt;
pseudoroot:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' to='dj@yak/winjab' from='ldap.yak'&lt;br /&gt;
id='browser_JCOM_15'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:browse'&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
name='root entry' xmlns='jabber:iq:browse' jid='ldap.yak'&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
name='ou=People' jid='ou=People@ldap.yak'/&amp;amp;gt; &amp;amp;lt;item name='ou=Groups'&lt;br /&gt;
jid='ou=Groups@ldap.yak'/&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We see the items presented to us and choose to descend the path marked&lt;br /&gt;
&amp;lt;tt&amp;gt;Groups&amp;lt;/tt&amp;gt;; our second browse request is made to the JID that&lt;br /&gt;
represents that item, &amp;lt;tt&amp;gt;ou=Groups@ldap.yak&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type=&amp;quot;get&amp;quot; id=&amp;quot;browser_JCOM_17&amp;quot;&lt;br /&gt;
to=&amp;quot;ou=People@ldap.yak&amp;quot;&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns=&amp;quot;jabber:iq:browse&amp;quot;&amp;amp;gt;&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The LDAP reflector component receives the IQ packet addressed to the JID&lt;br /&gt;
&amp;lt;tt&amp;gt;ou=People@ldap.yak&amp;lt;/tt&amp;gt; and interprets the username part of the JID&lt;br /&gt;
(&amp;lt;tt&amp;gt;ou=People&amp;lt;/tt&amp;gt;) as an LDAP RDN (''relative distinguished name'', a&lt;br /&gt;
form of key within an LDAP structure that's further qualified by a&lt;br /&gt;
common suffix), which returns the appropriate information from the next&lt;br /&gt;
level in the LDAP hierarchy, the countries:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' to='dj@yak/winjab'&lt;br /&gt;
from='ou=People@ldap.yak' id='browser_JCOM_17'&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
name='ou=People' xmlns='jabber:iq:browse' jid='ou=People@ldap.yak'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;item name='ou=UK' jid='ou=UK,ou=People@ldap.yak'/&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
name='ou=France' jid='ou=France,ou=People@ldap.yak'/&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
name='ou=Germany' jid='ou=Germany,ou=People@ldap.yak'/&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The descent continues, via the JID &amp;lt;tt&amp;gt;ou=UK,ou=People@ldap.yak&amp;lt;/tt&amp;gt;,&lt;br /&gt;
which was specified as the unique identifier for that item (the country&lt;br /&gt;
&amp;lt;tt&amp;gt;UK&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type=&amp;quot;get&amp;quot; id=&amp;quot;browser_JCOM_18&amp;quot;&lt;br /&gt;
to=&amp;quot;ou=UK,ou=People@ldap.yak&amp;quot;&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns=&amp;quot;jabber:iq:browse&amp;quot;&amp;amp;gt;&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
which continues:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' to='dj@yak/winjab'&lt;br /&gt;
from='ou=UK,ou=People@ldap.yak' id='browser_JCOM_18'&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
name='ou=UK,ou=People' xmlns='jabber:iq:browse'&lt;br /&gt;
jid='ou=UK,ou=People@ldap.yak'&amp;amp;gt; &amp;amp;lt;user name='cn=JanetAbrams'&lt;br /&gt;
jid='JanetAbrams@yak'/&amp;amp;gt; &amp;amp;lt;user name='cn=PaulAnthill'&lt;br /&gt;
jid='PaulAnthill@yak'/&amp;amp;gt; ... &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The section of the actual LDAP hierarchy browsed is shown in Figure 6-1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Figure|title=The example in the LDAP hierarchy&lt;br /&gt;
browsed|image=0596002025-jab_0601.png&amp;lt;/code&amp;gt; Browse data isn't just something&lt;br /&gt;
that can be retrieved; like presence, it can be pushed to an entity when&lt;br /&gt;
required. In the same way that an alert in the form of a&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt; element might arrive at a client unannounced,&lt;br /&gt;
so might browse information also appear. This is referred to as ''live&lt;br /&gt;
browsing'', as the information that is pushed is effectively ''live''.&lt;br /&gt;
&lt;br /&gt;
The Conferencing service uses this mechanism to push information on room&lt;br /&gt;
participants to a new joiner. As the browse information is enveloped in&lt;br /&gt;
an IQ element, it makes the most sense to use a &amp;lt;tt&amp;gt;type='set'&amp;lt;/tt&amp;gt; (it&lt;br /&gt;
might help to consider the parallel with the Hypertext Transfer Protocol&lt;br /&gt;
(HTTP) verb &amp;lt;tt&amp;gt;POST&amp;lt;/tt&amp;gt; as introduced in Chapter 2) to push this&lt;br /&gt;
information. And this is what happens, as seen in this excerpt from&lt;br /&gt;
information sent to a client as a conference room is joined:&amp;lt;ref&amp;gt;The&lt;br /&gt;
JIDs returned for the &amp;lt;tt&amp;gt;user&amp;lt;/tt&amp;gt; entities in the  room represent&lt;br /&gt;
nicknames for those users in that room. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='set' to='qmacro@jabber.org/winjab'&lt;br /&gt;
from='jdev@conference.jabber.org'&amp;amp;gt; &amp;amp;lt;conference&lt;br /&gt;
xmlns='jabber:iq:browse' name='Development Room' type='public'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;user name='piers'&lt;br /&gt;
jid='jdev@conference.jabber.org/445d4b864bd6...'/&amp;amp;gt; &amp;amp;lt;user&lt;br /&gt;
name='pgmillard' jid='jdev@conference.jabber.org/1cffcbf43c75...'/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;user name='reatmon'&lt;br /&gt;
jid='jdev@conference.jabber.org/b3f3c19859de...'/&amp;amp;gt; ...&lt;br /&gt;
&amp;amp;lt;/conference&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As well as the LDAP browser recipe in Section 10.3 in Chapter 10, an&lt;br /&gt;
example of a simple &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; implementation can be&lt;br /&gt;
found in Section 9.3 in Chapter 9.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:conference === &lt;br /&gt;
&amp;lt;br&amp;gt;The Conferencing service provides&lt;br /&gt;
facilities for entities to join rooms and chat with each other. The&lt;br /&gt;
entry negotiations that take place between a room (via the service) and&lt;br /&gt;
a potential participant are made using the &amp;lt;tt&amp;gt;jabber:iq:conference&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespace. With this namespace, information on rooms can be requested,&lt;br /&gt;
and attempts to enter rooms can be made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Warning|The &amp;lt;tt&amp;gt;jabber:iq:conference&amp;lt;/tt&amp;gt; namespace is currently in a&lt;br /&gt;
state of flux, as more conferencing features (such as being able to&lt;br /&gt;
eject users from rooms) are requested and added into the definition.&lt;br /&gt;
Because of this, the examples that follow are deliberately innocuous.&lt;br /&gt;
The ''keyassist'' recipe in  Section 9.1 in Chapter 9 describes and uses&lt;br /&gt;
the older, but stable, conferencing protocol called &amp;quot;Groupchat.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== The jabber:iq:conference namespace at work ==== &lt;br /&gt;
&amp;lt;br&amp;gt;Here we see a&lt;br /&gt;
typical sequence of IQ elements that ensue in the entry negotiations for&lt;br /&gt;
the ''jdev'' room hosted by the Conferencing service on ''jabber.org'''s&lt;br /&gt;
Jabber server. Information on the ''jdev'' room is requested:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type=&amp;quot;get&amp;quot; id=&amp;quot;c2&amp;quot;&lt;br /&gt;
to=&amp;quot;jdev@conference.jabber.org&amp;quot;&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns=&amp;quot;jabber:iq:conference&amp;quot;/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;The JID to which the IQ-get was&lt;br /&gt;
sent—''jdev@conference.jabber.org''—works in a similar way to the LDAP&lt;br /&gt;
reflector earlier in Section 6.2.5.1. There's no real distinction&lt;br /&gt;
between conferencing service ''usernames'' in the same way that there's&lt;br /&gt;
a distinction in the JSM service, but that part of the JID is used to&lt;br /&gt;
identify each room hosted by that service. In other words, &amp;lt;tt&amp;gt;jdev&amp;lt;/tt&amp;gt;&lt;br /&gt;
isn't a &amp;quot;real&amp;quot; user in the JSM sense.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The conferencing service replies with the relevant information:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' id='c2'&lt;br /&gt;
to='qmacro@jabber.org/hailsham' from='jdev@conference.jabber.org'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='jabber:iq:conference'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;Development&lt;br /&gt;
Room&amp;amp;lt;/name&amp;amp;gt; &amp;amp;lt;nick/&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We see that the &amp;quot;friendly&amp;quot; name of the ''jdev'' room is &amp;quot;Development&lt;br /&gt;
Room&amp;quot; and that we need to specify a nickname in order to gain entry.&lt;br /&gt;
There are no other requirements (such as a secret password) that would&lt;br /&gt;
have been identified inside an extra &amp;lt;tt&amp;gt;&amp;amp;lt;secret/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag in the&lt;br /&gt;
results.&lt;br /&gt;
&lt;br /&gt;
We choose a nickname, and send this back in an IQ-set. However, before&lt;br /&gt;
doing this, we must send our presence to the room to invoke the&lt;br /&gt;
Availability Tracker, which is described in Section 5.4.2.4 in Chapter&lt;br /&gt;
5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;presence to=&amp;quot;jdev@conference.jabber.org&amp;quot;/&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
SEND: &amp;amp;lt;iq to=&amp;quot;jdev@conference.jabber.org&amp;quot; type=&amp;quot;set&amp;quot; id=&amp;quot;c3&amp;quot;&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns=&amp;quot;jabber:iq:conference&amp;quot;&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;nick&amp;amp;gt;qmacro&amp;amp;lt;/nick&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Conferencing service acknowledges our entry to the room with our&lt;br /&gt;
chosen nickname, having assigned us an anonymous handle in the&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;id/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq to='qmacro@jabber.org/winjab' type='result' id='c3'&lt;br /&gt;
from='jdev@conference.jabber.org'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:conference'&amp;amp;gt; &amp;amp;lt;nick&amp;amp;gt;qmacro&amp;amp;lt;/nick&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;name&amp;amp;gt;Development Room&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;id&amp;amp;gt;jdev@conference.jabber.org/650e81de0fcc...&amp;amp;lt;/id&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Closely linked with the &amp;lt;tt&amp;gt;jabber:iq:conference&amp;lt;/tt&amp;gt; namespace is the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; namespace, which is also used as a conduit for&lt;br /&gt;
room-specific information and activity; see Section 6.2.5.&lt;br /&gt;
&lt;br /&gt;
More information on joining and interacting with conference rooms can be&lt;br /&gt;
found in Section 9.1 in Chapter 9.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:gateway === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:iq:gateway&amp;lt;/tt&amp;gt; namespace is&lt;br /&gt;
used to envelope a utility mechanism for converting external system&lt;br /&gt;
identifiers (usernames and so on) to JID equivalents. The requirement&lt;br /&gt;
for this grew out of the transport services to other IM systems (AIM,&lt;br /&gt;
Yahoo!, and so on), which have their own formats for user&lt;br /&gt;
identification.&lt;br /&gt;
&lt;br /&gt;
First, we know whether a service offers this utility from the namespace&lt;br /&gt;
list that is returned if we ''browse'' that service. The next section&lt;br /&gt;
shows how this might be done with the AIM Transport service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Discovering and using the AIM Transport's jabber:iq:gateway utility&lt;br /&gt;
==== &lt;br /&gt;
&amp;lt;br&amp;gt;By browsing a service, we can tell whether it supports the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:gateway&amp;lt;/tt&amp;gt; utility:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type=&amp;quot;get&amp;quot; id=&amp;quot;aim1&amp;quot; to='aim.jabber.org'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns=&amp;quot;jabber:iq:browse&amp;quot;/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' id='aim1' to='qmacro@jabber.org/winjab'&lt;br /&gt;
from='aim.jabber.org'&amp;amp;gt; &amp;amp;lt;service xmlns='jabber:iq:browse'&lt;br /&gt;
type='jabber' jid='aim.jabber.org' name='AIM Transport'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;ns&amp;amp;gt;jabber:iq:register&amp;amp;lt;/ns&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;ns&amp;amp;gt;jabber:iq:gateway&amp;amp;lt;/ns&amp;amp;gt; &amp;amp;lt;/service&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now avail ourselves of this utility, to convert an AIM screen&lt;br /&gt;
name &amp;lt;tt&amp;gt;test ScreenName&amp;lt;/tt&amp;gt; to the equivalent JID to be used (in&lt;br /&gt;
relation to the AIM Transport service) in a Jabber context:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='aim.jabber.org' id='conv5'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='jabber:iq:gateway'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='qmacro@jabber.org/hailsham' id='conv5'&lt;br /&gt;
from='aim.jabber.org'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:gateway'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;desc&amp;amp;gt;Enter the user's screen name&amp;amp;lt;/desc&amp;amp;gt; &amp;amp;lt;prompt/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can reply, with an IQ-set, with our screen name:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='set' to='aim.jabber.org' id='conf6'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='jabber:iq:gateway'&amp;amp;gt; &amp;amp;lt;prompt&amp;amp;gt;test&lt;br /&gt;
ScreenName&amp;amp;lt;/prompt&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and receive the result of the transport-specific JID conversion:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' to='qmacro@jabber.org/Work' id='conf6'&lt;br /&gt;
from='aim.jabber.org'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:gateway'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;prompt&amp;amp;gt;testScreenName@aim.jabber.org&amp;amp;lt;/prompt&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== jabber:iq:last === &lt;br /&gt;
&amp;lt;br&amp;gt;Like &amp;lt;tt&amp;gt;jabber:iq:time&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:version&amp;lt;/tt&amp;gt;, the &amp;lt;tt&amp;gt;jabber:iq:last&amp;lt;/tt&amp;gt; namespace allows&lt;br /&gt;
a simple query on uptime, idletime, or last disconnect information to be&lt;br /&gt;
made on clients and servers.&lt;br /&gt;
&lt;br /&gt;
Elapsed time information, in seconds, is returned in response to queries&lt;br /&gt;
in the &amp;lt;tt&amp;gt;jabber:iq:last&amp;lt;/tt&amp;gt; namespace. If the query is made of a&lt;br /&gt;
server element (the Jabber server itself or a component connected to&lt;br /&gt;
that server), then the information returned represents the time since&lt;br /&gt;
that element started, that is, the uptime:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='yak'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:last'&amp;amp;gt;&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='dj@yak/Work' from='yak'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:last' seconds='2339811'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Not all components support the &amp;lt;tt&amp;gt;jabber:iq:last&amp;lt;/tt&amp;gt; namespace; then&lt;br /&gt;
again, in many cases, the components—certainly those that are connected&lt;br /&gt;
with the ''library load'' mechanism (see Chapter 4)—will have the same&lt;br /&gt;
uptime as the Jabber server they're connected to. In other cases, for&lt;br /&gt;
TCP sockets connected components that can be attached while the Jabber&lt;br /&gt;
server is running, the uptime may be less.&amp;lt;ref&amp;gt;There is a feature in the&lt;br /&gt;
Jabber server Version 1.4.1 that allows dynamic starting and stopping of&lt;br /&gt;
''library load'' components, but it is not completely developed at the&lt;br /&gt;
moment. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a ''client'' disconnects, the last (un)availability information in&lt;br /&gt;
the closing &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; element is stored for that user,&lt;br /&gt;
along with the current time:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;presence type='unavailable'&amp;amp;gt; &amp;amp;lt;status&amp;amp;gt;Gone home&lt;br /&gt;
for the evening!&amp;amp;lt;/status&amp;amp;gt; &amp;amp;lt;/presence&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Making a &amp;lt;tt&amp;gt;jabber:iq:last&amp;lt;/tt&amp;gt;-based query on a user's JID will return&lt;br /&gt;
the information that was stored from the &amp;lt;tt&amp;gt;&amp;amp;lt;status/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag as&lt;br /&gt;
well as the number of seconds representing the elapsed time since that&lt;br /&gt;
disconnection (as a difference between the time the query was made and&lt;br /&gt;
the time stored for that user):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='dj@yak' id='lastq'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:last'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='sabine@yak/Work' id='lastq'&lt;br /&gt;
from='dj@yak'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:last' seconds='4521'&amp;amp;gt;&lt;br /&gt;
Gone home for the evening! &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice that the JID of the user being queried is &amp;lt;tt&amp;gt;dj@yak&amp;lt;/tt&amp;gt; and not&lt;br /&gt;
&amp;lt;tt&amp;gt;dj@yak/Work&amp;lt;/tt&amp;gt;. This, of course, is because the user was still&lt;br /&gt;
disconnected. The query was addressed to the user with no resource&lt;br /&gt;
specified and was answered on behalf of the user by the server (by the&lt;br /&gt;
''mod_last'' module—the same module that looks after storing this&lt;br /&gt;
information). In a disconnected context, a resource is not appropriate&lt;br /&gt;
for a user's JID (in the JSM); it is found only in a connected context.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;jabber:iq:last&amp;lt;/tt&amp;gt; is also designed to support a similar&lt;br /&gt;
client-targeted query (to be responded to by a client), this time&lt;br /&gt;
requesting information on how long it has been since the user of that&lt;br /&gt;
client was active (sent a message, changed her presence, and so on). In&lt;br /&gt;
contrast to the previous &amp;lt;tt&amp;gt;jabber:iq:last&amp;lt;/tt&amp;gt; query type, this query&lt;br /&gt;
is designed to be made to a connected user:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type=&amp;quot;get&amp;quot; to=&amp;quot;dj@yak/Work&amp;quot;&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:last'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' from='dj@yak/Work'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:last' seconds=&amp;quot;19'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here we see that the user is using a client that supports this type of&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:last&amp;lt;/tt&amp;gt; query and was last active &amp;lt;tt&amp;gt;19&amp;lt;/tt&amp;gt; seconds&lt;br /&gt;
ago.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:oob === &lt;br /&gt;
&amp;lt;br&amp;gt;We've already seen a form of the&lt;br /&gt;
&amp;lt;tt&amp;gt;oob&amp;lt;/tt&amp;gt;—&amp;quot;Out-Of-Band&amp;quot;—namespace in action, in the imaginary&lt;br /&gt;
conversation in Chapter 1, where &amp;lt;tt&amp;gt;jabber:x:oob&amp;lt;/tt&amp;gt; was used to pass&lt;br /&gt;
information about a third-party file location, in the form of a Uniform&lt;br /&gt;
Resource Locator (URL). The word &amp;quot;band&amp;quot; here refers to the&lt;br /&gt;
''bandwidth'', or connection, between the client and the server. The&lt;br /&gt;
point of an  ''out-of-band'' connection is that it's  independent of&lt;br /&gt;
that client-to-server connection (it typically is a connection from one&lt;br /&gt;
client directly to another), and so doesn't impact the traffic or&lt;br /&gt;
bandwidth on that connection. This makes sense when you consider that&lt;br /&gt;
out-of-band connections are typically used for  exchanging large volumes&lt;br /&gt;
of data, such as binary files.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;jabber:iq:oob&amp;lt;/tt&amp;gt; namespace is used for pretty much the same&lt;br /&gt;
thing, except that its usage describes a very simple handshake between&lt;br /&gt;
two Jabber clients to exchange a file between themselves. (Yes, ''real''&lt;br /&gt;
peer-to-peer for the purists.) The exchange is made using HTTP.&lt;br /&gt;
Typically, the client sending the file will start listening for HTTP&lt;br /&gt;
requests only at the beginning of the transfer process and stop&lt;br /&gt;
listening at the end of the transfer process. The handshake is used to&lt;br /&gt;
coordinate the process.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;It's worth pointing out here that HTTP-based peer-to-peer&lt;br /&gt;
transfers are at the mercy of firewalls, Network Address Translation&lt;br /&gt;
(NAT) mechanisms, and so on. There is some work underway to build a&lt;br /&gt;
proxy mechanism—the  Proxy Accept Socket Service (PASS). Details can be&lt;br /&gt;
found at  http://foundation.jabber.org/jeps/jep-0003.html.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The sender initiates the process by making the file available via HTTP&lt;br /&gt;
on a specific (nonstandard) port and notifying the recipient of the URL:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='set' to='sabine@yak/winjab' id='file_2'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='jabber:iq:oob'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;url&amp;amp;gt;http://192.168.0.7:5600/meetingnotes.txt&amp;amp;lt;/url&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;desc&amp;amp;gt;Meeting Notes&amp;amp;lt;/desc&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The recipient retrieves the file and notifies the sender when the&lt;br /&gt;
transfer is complete:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' to='dj@yak/Work' id='file_2'&lt;br /&gt;
from='sabine@yak/winjab'/&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:private === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:iq:private&amp;lt;/tt&amp;gt; namespace is&lt;br /&gt;
traditionally a way of storing user-defined data that should be kept&lt;br /&gt;
private. Persistency across sessions is achieved by storing the data in&lt;br /&gt;
the user's records on the server. The data is, of course, formatted in&lt;br /&gt;
XML.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Warning|Private data stored by a user is accessible only to that user.&lt;br /&gt;
Remember, however, that the private data is stored on the server.&lt;br /&gt;
Unencrypted. If you're paranoid, encrypt it before storing it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
A typical use of the &amp;lt;tt&amp;gt;jabber:iq:private&amp;lt;/tt&amp;gt; namespace is shown in&lt;br /&gt;
Example 6-1. The JIM client stores countless user preferences on a&lt;br /&gt;
per-user basis using this namespace. Once a user has connected and&lt;br /&gt;
authenticated with a Jabber server, those user preferences are retrieved&lt;br /&gt;
and used by the client to customize the settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JIM retrieves user preferences stored in a jabber:iq:private&lt;br /&gt;
namespace''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq id=&amp;quot;jabberim:prefs3860&amp;quot; type=&amp;quot;get&amp;quot;&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns=&amp;quot;jabber:iq:private&amp;quot;&amp;amp;gt; &amp;amp;lt;jabberIM xmlns=&amp;quot;jabberim:prefs&amp;quot;/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq id='jabberim:prefs3860' type='result'&lt;br /&gt;
from='dj@yak/Work'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:private'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;jabberim xmlns='jabberim:prefs' UseAutoAway='true' AwayTime='5'&lt;br /&gt;
XATime='30' AwayStatus='Away (auto)' XAStatus='Ext. Away (auto)'&lt;br /&gt;
WizardShown='false' ... &amp;amp;gt; &amp;amp;lt;/jabberim&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, you can see that a &amp;lt;tt&amp;gt;private&amp;lt;/tt&amp;gt; namespace is used&lt;br /&gt;
to qualify the particular chunk of stored data, &amp;lt;tt&amp;gt;jabberim:prefs&amp;lt;/tt&amp;gt;.&lt;br /&gt;
Also of interest is the difference between the&lt;br /&gt;
tags—&amp;lt;tt&amp;gt;&amp;amp;lt;jabberIM/&amp;amp;gt;&amp;lt;/tt&amp;gt; in the retrieval request and&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;jabberim/&amp;amp;gt;&amp;lt;/tt&amp;gt; in the response. Again we see evidence of an&lt;br /&gt;
XML usage convention previously seen (for example, in the Jabber server&lt;br /&gt;
component configuration stanzas; see Chapter 4 for more details). The&lt;br /&gt;
namespace itself, not the enclosing tag name, is critical. If the&lt;br /&gt;
preferences were originally stored using a tag name of&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;jabberim/&amp;amp;gt;&amp;lt;/tt&amp;gt;, then that's how they will be stored and&lt;br /&gt;
returned.&lt;br /&gt;
&lt;br /&gt;
To add (or change) private data, use the namespace in an IQ-set context:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq id=&amp;quot;private-s3&amp;quot; type=&amp;quot;set&amp;quot;&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns=&amp;quot;jabber:iq:private&amp;quot;&amp;amp;gt; &amp;amp;lt;reminders xmlns=&amp;quot;cal:events&amp;quot;&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;event date='20010617'&amp;amp;gt;Father's Day&amp;amp;lt;/event&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/reminders&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Due to the way the &amp;lt;tt&amp;gt;jabber:iq:private&amp;lt;/tt&amp;gt; storage mechanism is&lt;br /&gt;
currently implemented, you can interact with only ''one'' private&lt;br /&gt;
namespace-qualified chunk. In other words, a private store request like&lt;br /&gt;
this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq id=&amp;quot;private-s4&amp;quot; type=&amp;quot;set&amp;quot;&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns=&amp;quot;jabber:iq:private&amp;quot;&amp;amp;gt; &amp;amp;lt;reminders xmlns=&amp;quot;cal:events&amp;quot;&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;event date='20010617'&amp;amp;gt;Father's Day&amp;amp;lt;/event&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/reminders&amp;amp;gt; &amp;amp;lt;favorites xmlns='url:favorites'&amp;amp;gt; &amp;amp;lt;fav&lt;br /&gt;
url='http://dev.jabber.org'&amp;amp;gt;Jabber DevZone&amp;amp;lt;/fav&amp;amp;gt; &amp;amp;lt;fav&lt;br /&gt;
url='http://www.scripting.com'&amp;amp;gt;Scripting News&amp;amp;lt;/fav&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/favorites&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
would result in the storage of only the &amp;lt;tt&amp;gt;cal:events&amp;lt;/tt&amp;gt; chunk. The&lt;br /&gt;
&amp;lt;tt&amp;gt;url:favorites&amp;lt;/tt&amp;gt; chunk would be ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Storing public data ==== &lt;br /&gt;
&amp;lt;br&amp;gt;In the 1.4.1 release of the Jabber server,&lt;br /&gt;
the JSM module ''mod_xml'' that services the &amp;lt;tt&amp;gt;jabber:iq:private&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespace has been extended to allow this server-side storage to&lt;br /&gt;
encompass nonprivate (i.e., publicly accessible) user data. The&lt;br /&gt;
namespace in this case is, fittingly, ''not''&amp;lt;tt&amp;gt;jabber:iq:private&amp;lt;/tt&amp;gt;.&lt;br /&gt;
It can be anything you wish, provided that it doesn't encroach on the&lt;br /&gt;
standard Jabber namespace names—&amp;lt;tt&amp;gt;jabber:*&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;vcard-temp&amp;lt;/tt&amp;gt; are not allowed. However, anything else goes. The&lt;br /&gt;
reason for the &amp;lt;tt&amp;gt;vcard-temp&amp;lt;/tt&amp;gt; namespace name is that there is an&lt;br /&gt;
emerging but nevertheless not-yet-established standard for vCard data.&lt;br /&gt;
Until that standard is established, the Jabber server developers have&lt;br /&gt;
decided to handle this format in a temporary way.&lt;br /&gt;
&lt;br /&gt;
The idea of publicly accessible data is just that; you can make&lt;br /&gt;
information available to your fellow Jabber users (share URLs, contact&lt;br /&gt;
lists, and so on). Of course, this sharing is only one way; you write&lt;br /&gt;
and others can only read. But how do they find out ''what'' you've made&lt;br /&gt;
available for them to read? The namespaces of any data stored publicly&lt;br /&gt;
(i.e., any namespace except for &amp;lt;tt&amp;gt;jabber:iq:private&amp;lt;/tt&amp;gt;) are returned&lt;br /&gt;
by the Jabber server acting on behalf of the user in response to a&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt; request to that user's JID. That is, the JID&lt;br /&gt;
without a specified resource; otherwise, it would be passed on by the&lt;br /&gt;
server to be handled by the client connection with that resource.&lt;br /&gt;
&lt;br /&gt;
Let's have a look at this in action. We'll also have a peek at how the&lt;br /&gt;
storage of the public and private information is structured in the&lt;br /&gt;
user's spool file on the server to understand how this works. The&lt;br /&gt;
location of the spool files is defined in the &amp;lt;tt&amp;gt;xdb&amp;lt;/tt&amp;gt; component&lt;br /&gt;
instances configuration—see  Section 4.5 in Chapter 4. In addition to&lt;br /&gt;
the Father's Day event that was stored privately in the previous&lt;br /&gt;
example, we can also set some favorite URLs in a publicly accessible&lt;br /&gt;
namespace and receive an acknowledgment of successful storage from the&lt;br /&gt;
server:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='set' id='setfavs'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='dj:public:favorites'&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
url='http://dev.jabber.org'&amp;amp;gt;Jabber DevZone&amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
url='http://www.scripting.com'&amp;amp;gt;Scripting News&amp;amp;lt;/item&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' from='dj@yak/Work' to='a1@yak/Work'&lt;br /&gt;
id='setfavs'/&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, the relevant section of &amp;lt;tt&amp;gt;dj@yak&amp;lt;/tt&amp;gt;'s spool file on the server&lt;br /&gt;
looks something like that shown in Example 6-2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Section of user's spool storage showing public and private data''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ...&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;foo xmlns='jabber:xdb:nslist' xdbns='jabber:xdb:nslist'&amp;amp;gt; &amp;amp;lt;ns&lt;br /&gt;
type='private'&amp;amp;gt;cal:events&amp;amp;lt;/ns&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;ns&amp;amp;gt;dj:public:favorites&amp;amp;lt;/ns&amp;amp;gt; &amp;amp;lt;/foo&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;reminders xmlns='cal:events' j_private_flag='1'&lt;br /&gt;
xdbns='cal:events'&amp;amp;gt; &amp;amp;lt;event date='20010617'&amp;amp;gt;Father's&lt;br /&gt;
Day&amp;amp;lt;/event&amp;amp;gt; &amp;amp;lt;/reminders&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;query xmlns='dj:public:favorites' xdbns='dj:public:favorites'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;item url='http://dev.jabber.org'&amp;amp;gt;Jabber DevZone&amp;amp;lt;/item&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;item url='http://www.scripting.com'&amp;amp;gt;Scripting News&amp;amp;lt;/item&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are a few things to note in this example:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;tt&amp;gt;jabber:xdb:nslist&amp;lt;/tt&amp;gt; namespace maintains a list of&lt;br /&gt;
namespaces containing information stored for private and public&lt;br /&gt;
reference. &lt;br /&gt;
* The &amp;lt;tt&amp;gt;private&amp;lt;/tt&amp;gt; namespaces are marked in this list&lt;br /&gt;
with a &amp;lt;tt&amp;gt;type='private'&amp;lt;/tt&amp;gt; attribute. &lt;br /&gt;
* There is an additional flag&lt;br /&gt;
(&amp;lt;tt&amp;gt;j_private_flag=&amp;quot;1'&amp;lt;/tt&amp;gt;) that is held as an attribute of each of&lt;br /&gt;
the privately stored fragments. &lt;br /&gt;
* Otherwise the information is stored&lt;br /&gt;
exactly as it was set (additional &amp;lt;tt&amp;gt;xdbns&amp;lt;/tt&amp;gt; attributes related to&lt;br /&gt;
the xdb storage mechanisms notwithstanding). The namespaces&lt;br /&gt;
(&amp;lt;tt&amp;gt;&amp;amp;lt;ns/&amp;amp;gt;&amp;lt;/tt&amp;gt; tags) in the &amp;lt;tt&amp;gt;jabber:xdb:nslist&amp;lt;/tt&amp;gt;-qualified&lt;br /&gt;
list are returned in any browse request to that user:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='dj@yak'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:browse'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='sabine@yak/Work' from='dj@yak'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;user name='DJ Adams' xmlns='jabber:iq:browse' jid='dj@yak'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;ns&amp;amp;gt;&amp;lt;tt&amp;gt;dj:public:favorites&amp;lt;/tt&amp;gt;&amp;amp;lt;/ns&amp;amp;gt; &amp;amp;lt;/user&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and can be subsequently retrieved by anyone:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='dj@yak'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='dj:public:favorites'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='sabine@yak/Work' from='dj@yak'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='&amp;lt;tt&amp;gt;dj:public:favorites&amp;lt;/tt&amp;gt;'&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
url='http://dev.jabber.org'&amp;amp;gt;Jabber DevZone&amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
url='http://www.scripting.com'&amp;amp;gt;Scripting News&amp;amp;lt;/item&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Publicly stored data can contain multiple fragments qualified by&lt;br /&gt;
different namespaces, such as:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='set'&amp;amp;gt; &amp;amp;lt;query xmlns='my:resume'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;education xmlns='resume:education'&amp;amp;gt; &amp;amp;lt;degree&lt;br /&gt;
type='BA'&amp;amp;gt;Classics&amp;amp;lt;/degree&amp;amp;gt; &amp;amp;lt;/education&amp;amp;gt; &amp;amp;lt;employment&lt;br /&gt;
xmlns='work:clients'&amp;amp;gt; &amp;amp;lt;client from='2001'&amp;amp;gt;Author, O'Reilly&lt;br /&gt;
&amp;amp;amp; Associates, Inc.&amp;amp;lt;/client&amp;amp;gt; &amp;amp;lt;client from='1999'&amp;amp;gt;Deluxe&lt;br /&gt;
Video Services&amp;amp;lt;/client&amp;amp;gt; &amp;amp;lt;client from='1996'&amp;amp;gt;Andersen&lt;br /&gt;
Consulting&amp;amp;lt;/client&amp;amp;gt; ... &amp;amp;lt;/employment&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, the retrieval ''resolution'' is still limited to all of the&lt;br /&gt;
fragments defined by the top-level namespace (&amp;lt;tt&amp;gt;my:resume&amp;lt;/tt&amp;gt; in this&lt;br /&gt;
case).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== jabber:iq:register === &lt;br /&gt;
&amp;lt;br&amp;gt;As the name suggests, the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:register&amp;lt;/tt&amp;gt; namespace is used to conduct registration&lt;br /&gt;
exchanges between the client and server. The most obvious example of&lt;br /&gt;
this is to create (''register'') a new user on the Jabber server. We&lt;br /&gt;
cover user registration, including changes to user details such as&lt;br /&gt;
passwords, in Chapter 7,  so here we'll look at how to use the namespace&lt;br /&gt;
to add or change an entry in the JUD.&lt;br /&gt;
&lt;br /&gt;
First we request the fields for registration with an IQ-get:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='jud.yak' id='jud-2'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:register'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='dj@yak/Work' from='jud.yak'&lt;br /&gt;
id='jud-2'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:register'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;instructions&amp;amp;gt; Complete the form to submit your searchable&lt;br /&gt;
attributes in the Jabber User Directory &amp;amp;lt;/instructions&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;name/&amp;amp;gt; &amp;amp;lt;first/&amp;amp;gt; &amp;amp;lt;last/&amp;amp;gt; &amp;amp;lt;nick/&amp;amp;gt; &amp;amp;lt;email/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and then send an IQ-set to set our information:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='set' to='jud.yak' id='jud-3'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:register'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;DJ Adams&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;first&amp;amp;gt;DJ&amp;amp;lt;/first&amp;amp;gt; &amp;amp;lt;last&amp;amp;gt;Adams&amp;amp;lt;/last&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;nick&amp;amp;gt;qmacro&amp;amp;lt;/nick&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;email&amp;amp;gt;dj.adams@pobox.com&amp;amp;lt;/email&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='dj@yak/Work' from='jud.yak'/&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;This idiom—making a request to a service to return the fields&lt;br /&gt;
appropriate for completion—is common in Jabber and is worth bearing in&lt;br /&gt;
mind if you're intending to build a Jabber client. The nature of the&lt;br /&gt;
form field requests means that the client application has to be flexible&lt;br /&gt;
and accommodating, to bend itself around the dynamic server.&lt;br /&gt;
&lt;br /&gt;
The recipe in Section 10.1 in Chapter 10 is an example of creating forms&lt;br /&gt;
dynamically.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Services offering a registration mechanism are identifiable in the list&lt;br /&gt;
returned from a &amp;lt;tt&amp;gt;jabber:iq:agents&amp;lt;/tt&amp;gt; or a &amp;lt;tt&amp;gt;jabber:iq:browse&amp;lt;/tt&amp;gt;&lt;br /&gt;
query, as shown in Example 6-3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''An agents or browse query reveals registration mechanisms''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq to='dj@yak/Work' type='result' from='yak'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='jabber:iq:agents'&amp;amp;gt; &amp;amp;lt;agent jid='jud.yak'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;name&amp;amp;gt;yak JUD (0.4)&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;service&amp;amp;gt;jud&amp;amp;lt;/service&amp;amp;gt; &amp;amp;lt;search/&amp;amp;gt; &amp;amp;lt;register/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/agent&amp;amp;gt; ... &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
      ...&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='dj@yak/Work' from='yak'&amp;amp;gt; &amp;amp;lt;service&lt;br /&gt;
xmlns='jabber:iq:browse' type='jabber' jid='yak' name='Jabber&lt;br /&gt;
Server'&amp;amp;gt; &amp;amp;lt;service type='jud' jid='jud.yak' name='yak JUD&lt;br /&gt;
(0.4)'&amp;amp;gt; &amp;amp;lt;ns&amp;amp;gt;jabber:iq:search&amp;amp;lt;/ns&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;ns&amp;amp;gt;jabber:iq:register&amp;amp;lt;/ns&amp;amp;gt; &amp;amp;lt;/service&amp;amp;gt; ...&lt;br /&gt;
&amp;amp;lt;/service&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are a couple of extra elements that are fairly common across&lt;br /&gt;
different implementations of the &amp;lt;tt&amp;gt;jabber:iq:register&amp;lt;/tt&amp;gt; namespace:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;tt&amp;gt;&amp;amp;lt;remove/&amp;amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: When sent with an IQ-set request, the &amp;lt;tt&amp;gt;&amp;amp;lt;remove/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag&lt;br /&gt;
: requests that the registration be canceled, revoked, or reversed. &lt;br /&gt;
; &amp;lt;tt&amp;gt;&amp;amp;lt;registered/&amp;amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: When received in an IQ-result, the &amp;lt;tt&amp;gt;&amp;amp;lt;registered/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag&lt;br /&gt;
: signifies that registration has already been made with the service,&lt;br /&gt;
: and any further registration IQ-sets will serve to modify the current&lt;br /&gt;
: registration details. The &amp;lt;tt&amp;gt;jabber:iq:register&amp;lt;/tt&amp;gt; namespace also&lt;br /&gt;
: defines a special &amp;lt;tt&amp;gt;&amp;amp;lt;key/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag. This is a simple  &lt;br /&gt;
: antispoofing mechanism that a piece of software responding to an IQ in&lt;br /&gt;
: this namespace can use to verify the sender of that IQ. This&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;amp;lt;key/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag can also be used in  the&lt;br /&gt;
: &amp;lt;tt&amp;gt;jabber:iq:search&amp;lt;/tt&amp;gt; namespace. See the following section for&lt;br /&gt;
: details on how this mechanism is used. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== The &amp;amp;lt;key/&amp;amp;gt; tag ==== &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;&amp;amp;lt;key/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag is used in&lt;br /&gt;
registration and search sequences to add a simple form of security&lt;br /&gt;
between the service and the entity requesting the service. It enables&lt;br /&gt;
the service, the responder, to verify that the requester from whom it&lt;br /&gt;
has just received an IQ-set is the same requester that had sent an&lt;br /&gt;
IQ-get earlier.&lt;br /&gt;
&lt;br /&gt;
This security mechanism predates the server-to-server dialback&lt;br /&gt;
mechanism, described in Chapter 4.  Since the advent of dialback, the&lt;br /&gt;
relevance of the &amp;lt;tt&amp;gt;&amp;amp;lt;key/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag usage has been reduced.&lt;br /&gt;
&lt;br /&gt;
If a component wants to determine who ought to be allowed to partake of&lt;br /&gt;
its registration or search services, it would make sense to make the&lt;br /&gt;
determination when responding to an initial IQ-get, the &amp;quot;can I do this,&lt;br /&gt;
and what do I have to do?&amp;quot; request.  If the request is to be ''denied'',&lt;br /&gt;
the component can send back an IQ-error, say, with an error 405 &amp;quot;Not&lt;br /&gt;
Allowed&amp;quot; (see Table 5-3).&lt;br /&gt;
&lt;br /&gt;
If, however, the component determines that the requester should be&lt;br /&gt;
allowed to use the service (with an IQ-set), it can send back an&lt;br /&gt;
IQ-result containing a &amp;lt;tt&amp;gt;&amp;amp;lt;key/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag along with the rest of&lt;br /&gt;
the instructions and fields. The &amp;lt;tt&amp;gt;&amp;amp;lt;key/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag contains a&lt;br /&gt;
random string, such as a message digest of the requester's JID combined&lt;br /&gt;
with a secret phrase. When the requester is  ready to make the IQ-set,&lt;br /&gt;
the &amp;quot;OK, I'd like to use this service, and here's the data&amp;quot; request, the&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;key/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag must be included, with the contents intact. On&lt;br /&gt;
receipt of the IQ-set, the component doesn't have to determine whether&lt;br /&gt;
the requester is allowed to use the service, it just has to  regenerate&lt;br /&gt;
the string using the same algorithm as before and compare it with what&lt;br /&gt;
the requester sent.&lt;br /&gt;
&lt;br /&gt;
Example 6-4 shows the  &amp;lt;tt&amp;gt;&amp;amp;lt;key/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag in action, based upon&lt;br /&gt;
the same registration sequence shown earlier in this section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''The &amp;amp;lt;key/&amp;amp;gt; tag in action''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='jud.yak' id='jud-2'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:register'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='dj@yak/Work' from='jud.yak'&lt;br /&gt;
id='jud-2'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:register'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;instructions&amp;amp;gt; Complete the form to submit your searchable&lt;br /&gt;
attributes in the Jabber User Directory &amp;amp;lt;/instructions&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;key&amp;amp;gt;cff28e89afa94e734aabfb11ec1099780450d80e&amp;amp;lt;/key&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;name/&amp;amp;gt; &amp;amp;lt;first/&amp;amp;gt; &amp;amp;lt;last/&amp;amp;gt; &amp;amp;lt;nick/&amp;amp;gt; &amp;amp;lt;email/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
SEND: &amp;amp;lt;iq type='set' to='jud.yak' id='jud-3'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:register'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;key&amp;amp;gt;cff28e89afa94e734aabfb11ec1099780450d80e&amp;amp;lt;/key&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;name&amp;amp;gt;DJ Adams&amp;amp;lt;/name&amp;amp;gt; &amp;amp;lt;first&amp;amp;gt;DJ&amp;amp;lt;/first&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;last&amp;amp;gt;Adams&amp;amp;lt;/last&amp;amp;gt; &amp;amp;lt;nick&amp;amp;gt;qmacro&amp;amp;lt;/nick&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;email&amp;amp;gt;dj.adams@pobox.com&amp;amp;lt;/email&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' to='dj@yak/Work' from='jud.yak'/&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another example of registration using the &amp;lt;tt&amp;gt;jabber:iq:register&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespace is shown in Section 9.3 in Chapter 9.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:roster === &lt;br /&gt;
&amp;lt;br&amp;gt;In Section 5.4.2.3 in Chapter 5, we looked at&lt;br /&gt;
the presence subscription mechanism used to coordinate and record&lt;br /&gt;
information about the relationships between users and how they exchange&lt;br /&gt;
availability information. This mechanism revolves around certain types&lt;br /&gt;
of &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; elements and storage of information in the&lt;br /&gt;
users' ''rosters''.&lt;br /&gt;
&lt;br /&gt;
The roster structure is managed within the &amp;lt;tt&amp;gt;jabber:iq:roster&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespace. Clients make roster requests when they connect to the Jabber&lt;br /&gt;
server, to pull down the roster that is stored server-side. They also&lt;br /&gt;
update the roster to add, change, or remove entries. However, roster&lt;br /&gt;
updates aren't limited to just the client; there are certain attributes&lt;br /&gt;
within each roster item that are maintained by the server, in response&lt;br /&gt;
to presence subscription activity.&lt;br /&gt;
&lt;br /&gt;
The roster in Example 6-5 contains five items. Three are friends,&lt;br /&gt;
grouped together using &amp;lt;tt&amp;gt;&amp;amp;lt;group&amp;amp;gt;Friends&amp;amp;lt;/group&amp;amp;gt;&amp;lt;/tt&amp;gt;,&lt;br /&gt;
which is used by clients to build the roster item display in a&lt;br /&gt;
structured (hierarchical) way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''A typical roster''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;query xmlns='jabber:iq:roster'&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
jid='shiels@jabber.org' subscription='both' name='Robert'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;group&amp;amp;gt;Friends&amp;amp;lt;/group&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
jid='piers@jabber.org' subscription='both' name='piers'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;group&amp;amp;gt;Friends&amp;amp;lt;/group&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
jid='sabine@pipetree.com' subscription='to' name='Sabine'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;group&amp;amp;gt;Friends&amp;amp;lt;/group&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
jid='jim@company-a.com' subscription='from' name='Jim'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;group&amp;amp;gt;Work&amp;amp;lt;/group&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
jid='jim@company-b.com' subscription='none' ask='subscribe'&lt;br /&gt;
name='John'&amp;amp;gt; &amp;amp;lt;group&amp;amp;gt;Work&amp;amp;lt;/group&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;subscription&amp;lt;/tt&amp;gt; attribute is used to store the presence&lt;br /&gt;
subscription state between the roster owner and the particular item that&lt;br /&gt;
holds that attribute. With two of the friends, Robert and Piers, the&lt;br /&gt;
roster owner is subscribed to each of their presences, and each of them&lt;br /&gt;
is subscribed to the presence of the roster owner. This is denoted by&lt;br /&gt;
the &amp;lt;tt&amp;gt;both&amp;lt;/tt&amp;gt; value in the &amp;lt;tt&amp;gt;subscription&amp;lt;/tt&amp;gt; attribute, which&lt;br /&gt;
means that the presence subscription flows both ways. Where the&lt;br /&gt;
&amp;lt;tt&amp;gt;subscription&amp;lt;/tt&amp;gt; attribute has the value &amp;lt;tt&amp;gt;to&amp;lt;/tt&amp;gt; (as in&lt;br /&gt;
Sabine's case) or &amp;lt;tt&amp;gt;from&amp;lt;/tt&amp;gt; (Jim's case), the subscription flows in&lt;br /&gt;
only one direction. Here, the roster owner is subscribed ''to'' Sabine's&lt;br /&gt;
presence (but Sabine is not subscribed to the roster owner's presence),&lt;br /&gt;
and Jim is subscribed to the roster owner's presence (i.e., the roster&lt;br /&gt;
owner has a presence subscription ''from'' Jim).&amp;lt;ref&amp;gt;In colloquial&lt;br /&gt;
Jabber terms, Jim is known as a ''lurker'', as he knows about the roster&lt;br /&gt;
owner's availability, without the roster owner knowing about his. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the value of the &amp;lt;tt&amp;gt;subscription&amp;lt;/tt&amp;gt; attribute is &amp;lt;tt&amp;gt;none&amp;lt;/tt&amp;gt;&lt;br /&gt;
(as in John's case), neither party has a subscription to the other. In&lt;br /&gt;
this case, a further attribute, &amp;lt;tt&amp;gt;ask&amp;lt;/tt&amp;gt;, may be used to reflect&lt;br /&gt;
that a presence subscription request is in progress.&amp;lt;ref&amp;gt;&amp;quot;Pending,&amp;quot; in&lt;br /&gt;
Jabber client parlance. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;ask&amp;lt;/tt&amp;gt; attribute can have one of two values:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;tt&amp;gt;subscribe&amp;lt;/tt&amp;gt;&lt;br /&gt;
: Denotes that a request to subscribe to a user's presence has been made &lt;br /&gt;
; &amp;lt;tt&amp;gt;unsubscribe&amp;lt;/tt&amp;gt;&lt;br /&gt;
: Denotes that a request to unsubscribe from a user's presence has been&lt;br /&gt;
: made In both cases, these requests are sent using a&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; element with an appropriate value for the&lt;br /&gt;
: &amp;lt;tt&amp;gt;type&amp;lt;/tt&amp;gt; attribute. &lt;br /&gt;
&lt;br /&gt;
The server is responsible for maintaining the &amp;lt;tt&amp;gt;subscription&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;ask&amp;lt;/tt&amp;gt; attributes; the client may maintain all the other elements.&lt;br /&gt;
If an item is updated by the server—for example, as a result of a&lt;br /&gt;
correspondent accepting a previous subscription request—the server will&lt;br /&gt;
push the updated item to the client (all clients, if the user is&lt;br /&gt;
connected multiple times with different resources) with an IQ-set:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='set'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:roster'&amp;amp;gt; &amp;amp;lt;item jid='john@company-b.com'&lt;br /&gt;
subscription='to' name='John'/&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, John has accepted the roster owner's subscription request by&lt;br /&gt;
sending the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;presence to='dj@yak/Work' type='subscribed'/&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The server will update the roster item accordingly by removing the&lt;br /&gt;
&amp;lt;tt&amp;gt;ask='subscribe'&amp;lt;/tt&amp;gt; and setting the value of the&lt;br /&gt;
&amp;lt;tt&amp;gt;subscription&amp;lt;/tt&amp;gt; attribute to &amp;lt;tt&amp;gt;to&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:search === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:iq:search&amp;lt;/tt&amp;gt; is closely&lt;br /&gt;
related to the &amp;lt;tt&amp;gt;jabber:iq:register&amp;lt;/tt&amp;gt; namespace, in that the dance&lt;br /&gt;
steps are pretty much the same. As with &amp;lt;tt&amp;gt;jabber:iq:register&amp;lt;/tt&amp;gt;, you&lt;br /&gt;
can discover which entities (usually server components) support search&lt;br /&gt;
features from the results of an agents or browse query, as shown in&lt;br /&gt;
Example 6-3.&lt;br /&gt;
&lt;br /&gt;
Also, as with the &amp;lt;tt&amp;gt;jabber:iq:register&amp;lt;/tt&amp;gt; namespace, the fields to&lt;br /&gt;
be used in the interaction are first retrieved with an IQ-get qualified&lt;br /&gt;
by the &amp;lt;tt&amp;gt;jabber:iq:search&amp;lt;/tt&amp;gt; namespace. Here we see an example of&lt;br /&gt;
that with the JUD running on the jabber.org server:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='users.jabber.org' id='800'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='jabber:iq:search'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' from='users.jabber.org'&lt;br /&gt;
to='qmacro@jabber.org/laptop' id='800'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:search'&amp;amp;gt; &amp;amp;lt;instructions&amp;amp;gt; Fill in a field to&lt;br /&gt;
search for any matching Jabber User &amp;amp;lt;/instructions&amp;amp;gt; &amp;amp;lt;first/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;last/&amp;amp;gt; &amp;amp;lt;nick/&amp;amp;gt; &amp;amp;lt;email/&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To continue the similarity theme, an IQ-set is used to submit the&lt;br /&gt;
search, sending back a value (or values) in the fields like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;tt&amp;gt;&amp;amp;lt;email&amp;amp;gt;pipetree.com&amp;amp;lt;/email&amp;amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;The only exciting feature of the &amp;lt;tt&amp;gt;jabber:iq:search&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespace is perhaps the way it can return results in response to an&lt;br /&gt;
IQ-set. This depends on the component and how the feature is&lt;br /&gt;
implemented.&lt;br /&gt;
&lt;br /&gt;
While the JUD component will return all results in one IQ element:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' from='users.jabber.org'&lt;br /&gt;
to='qmacro@jabber.org/laptop'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:search'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;item jid='qmacro@jabber.org'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;DJ Adams&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;first&amp;amp;gt;DJ&amp;amp;lt;/first&amp;amp;gt; &amp;amp;lt;last&amp;amp;gt;Adams&amp;amp;lt;/last&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;nick&amp;amp;gt;qmacro&amp;amp;lt;/nick&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;email&amp;amp;gt;dj@pipetree.com&amp;amp;lt;/email&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
jid='piers@jabber.org'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;Piers Harding&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;first&amp;amp;gt;Piers&amp;amp;lt;/first&amp;amp;gt; &amp;amp;lt;last&amp;amp;gt;Harding&amp;amp;lt;/last&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;nick&amp;amp;gt;pxh&amp;amp;lt;/nick&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;email&amp;amp;gt;piers@pipetree.com&amp;amp;lt;/email&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; ...&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the component providing transport services to the ICQ IM system returns&lt;br /&gt;
the results item by item:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='set' from='icq.jabber.org' id='icqs8'&lt;br /&gt;
to='qmacro@jabber.org/laptop'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:search'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;item jid='4711471@icq.jabber.org'&amp;amp;gt; &amp;amp;lt;given&amp;amp;gt;DJ&amp;amp;lt;/given&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;family&amp;amp;gt;Adams&amp;amp;lt;/family&amp;amp;gt; &amp;amp;lt;nick&amp;amp;gt;qmacro&amp;amp;lt;/nick&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;email&amp;amp;gt;dj@pipetree.com&amp;amp;lt;/email&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='set' from='icq.jabber.org' id='icqs8'&lt;br /&gt;
to='qmacro@jabber.org/laptop'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:search'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;item jid='1234567@icq.jabber.org'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;given&amp;amp;gt;Piers&amp;amp;lt;/given&amp;amp;gt; &amp;amp;lt;family&amp;amp;gt;Harding&amp;amp;lt;/family&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;nick&amp;amp;gt;pxh&amp;amp;lt;/nick&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;email&amp;amp;gt;piers@pipetree.com&amp;amp;lt;/email&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The component signals the end of the search results with an empty&lt;br /&gt;
IQ-result element:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' from='icq.jabber.org' id='icqs8'&lt;br /&gt;
to='qmacro@jabber.org/laptop'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:search'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ''anti-spoofing mechanism'' in the form of the &amp;lt;tt&amp;gt;&amp;amp;lt;key/&amp;amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
tag, described in the earlier section titled &amp;quot;The &amp;amp;lt;key/&amp;amp;gt; tag,&amp;quot; can&lt;br /&gt;
also be used in conversations qualified by  the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:search&amp;lt;/tt&amp;gt; namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:time === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:iq:time&amp;lt;/tt&amp;gt; namespace qualifies&lt;br /&gt;
an IQ-based conversation to make or respond to a query on time&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
To query the time at a particular entity, an IQ-get request like this is&lt;br /&gt;
sent:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' id='time_19' to='conference.yak'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='&amp;lt;tt&amp;gt;jabber:iq:time&amp;lt;/tt&amp;gt;'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Three pieces of information—the time in UTC (coordinated universal time)&lt;br /&gt;
format, the local time zone, and a nice display version of the local&lt;br /&gt;
time—are returned in response to such a query:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' id='time_19' to='sabine@yak/Work'&lt;br /&gt;
from='conference.yak'&amp;amp;gt; &amp;amp;lt;query xmlns='&amp;lt;tt&amp;gt;jabber:iq:time&amp;lt;/tt&amp;gt;'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;utc&amp;amp;gt;20010520T08:55:38&amp;amp;lt;/utc&amp;amp;gt; &amp;amp;lt;tz&amp;amp;gt;GMT&amp;amp;lt;/tz&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;display&amp;amp;gt;Sun May 20 09:55:38 2001&amp;amp;lt;/display&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The format of the &amp;lt;tt&amp;gt;&amp;amp;lt;tz/&amp;amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;&amp;amp;lt;display&amp;amp;gt;&amp;lt;/tt&amp;gt; tags&lt;br /&gt;
is not fixed. While this is what the Conferencing service returns, a&lt;br /&gt;
response from the JIM client would give &amp;quot;GMT Standard Time&amp;quot; and&lt;br /&gt;
&amp;quot;20/05/01 09:55:38,&amp;quot; respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;If you consider that certain components can be connected to the&lt;br /&gt;
Jabber backbone but be running on different hosts in different time&lt;br /&gt;
zones, communicating over TCP socket connections (as described in&lt;br /&gt;
Section 4.16 in Chapter 4), this may be more useful than you initially&lt;br /&gt;
think.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Specifying clients as query targets ==== &lt;br /&gt;
&amp;lt;br&amp;gt;Many of these namespaces&lt;br /&gt;
qualify queries that make just as much sense sent to a Jabber client as&lt;br /&gt;
sent to a Jabber server or service. However, if you don't compose the&lt;br /&gt;
recipient JID correctly, you could end up with an unexpected response.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to query the local time on Piers' client, which is&lt;br /&gt;
connected to the Jabber server at ''jabber.org'':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' id='time_21' to='piers@jabber.org'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;query xmlns='jabber:iq:time'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You could get a response similar to this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='error' id='time_21' from='piers@jabber.org'&lt;br /&gt;
to='qmacro@jabber.org/home'&amp;amp;gt; &amp;amp;lt;query xmlns='jabber:iq:time'/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;error code='503'&amp;amp;gt;Service Unavailable&amp;amp;lt;/error&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Why? This query isn't addressed to a particular client or session. While&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt; elements can be addressed to a user JID in the&lt;br /&gt;
form &amp;lt;tt&amp;gt;username@hostname&amp;lt;/tt&amp;gt; and will be sent to the &amp;quot;primary&amp;quot;&lt;br /&gt;
session according to presence priority, the recipients of&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt; elements must be specified exactly. As we want to&lt;br /&gt;
find out the time at Piers' client, which has the associated resource&lt;br /&gt;
&amp;lt;tt&amp;gt;desktop&amp;lt;/tt&amp;gt;, we must specify that resource in the JID:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' id='time_21'&lt;br /&gt;
to='&amp;lt;tt&amp;gt;piers@jabber.org/desktop&amp;lt;/tt&amp;gt;'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='&amp;lt;tt&amp;gt;jabber:iq:time&amp;lt;/tt&amp;gt;'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will give us the response we're looking for:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result' id='time_21' to='qmacro@jabber/home'&lt;br /&gt;
from='piers@jabber.org/desktop'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='&amp;lt;tt&amp;gt;jabber:iq:time&amp;lt;/tt&amp;gt;'/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;utc&amp;amp;gt;20010520T11:25:58&amp;amp;lt;/utc&amp;amp;gt; &amp;amp;lt;tz&amp;amp;gt;CET&amp;amp;lt;/tz&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;display&amp;amp;gt;Sun May 20 13:25:58 2001&amp;amp;lt;/display&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:iq:version === &lt;br /&gt;
&amp;lt;br&amp;gt;Similar to the &amp;lt;tt&amp;gt;jabber:iq:time&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespace, the &amp;lt;tt&amp;gt;jabber:iq:version&amp;lt;/tt&amp;gt; namespace is used to make and&lt;br /&gt;
respond to queries regarding the version of the particular piece of&lt;br /&gt;
software being addressed. The query is formulated like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' id='ver-a' to='''JID'''&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='&amp;lt;tt&amp;gt;jabber:iq:version&amp;lt;/tt&amp;gt;'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Responses depend on the entity being queried. Here are responses from&lt;br /&gt;
three different entities:&lt;br /&gt;
&lt;br /&gt;
* A client (sjabber): &lt;br /&gt;
* &amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result'&lt;br /&gt;
to='dj@yak/Work' from='sabine@yak/sjabber'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='&amp;lt;tt&amp;gt;jabber:iq:version&amp;lt;/tt&amp;gt;'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;sjabber&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;version&amp;amp;gt;0.4&amp;amp;lt;/version&amp;amp;gt; &amp;amp;lt;os&amp;amp;gt;linux&amp;amp;lt;/os&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The Jabber server itself (well, the JSM):&lt;br /&gt;
* &amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq&lt;br /&gt;
type='result' to='dj@yak/Work' from='sabine@yak/sjabber'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='&amp;lt;tt&amp;gt;jabber:iq:version&amp;lt;/tt&amp;gt;'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;jsm&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;version&amp;amp;gt;1.4.1&amp;amp;lt;/version&amp;amp;gt; &amp;amp;lt;os&amp;amp;gt;linux&lt;br /&gt;
2.2.12-45SAP&amp;amp;lt;/os&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* And the JUD component: &lt;br /&gt;
* &amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq type='result'&lt;br /&gt;
to='dj@yak/Work' from='sabine@yak/sjabber'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='&amp;lt;tt&amp;gt;jabber:iq:version&amp;lt;/tt&amp;gt;'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;jud&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;version&amp;amp;gt;0.4&amp;amp;lt;/version&amp;amp;gt; &amp;amp;lt;os&amp;amp;gt;linux&lt;br /&gt;
2.2.12-45SAP&amp;amp;lt;/os&amp;amp;gt; &amp;amp;lt;/query&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;jabber:iq:version&amp;lt;/tt&amp;gt; namespace is used in the recipe in&lt;br /&gt;
Section 9.3 in Chapter 9.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== The X Namespaces == &lt;br /&gt;
&amp;lt;br&amp;gt;While the IQ namespaces are used in exchanging&lt;br /&gt;
structured information in semiformalized conversations, the X namespaces&lt;br /&gt;
are more ad hoc extensions that add value, context, and information to&lt;br /&gt;
any type of packet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:autoupdate === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:x:autoupdate&amp;lt;/tt&amp;gt; namespace&lt;br /&gt;
is used to carry information on where new version information can be&lt;br /&gt;
found. Details and an example of this namespace's usage can be found in&lt;br /&gt;
the description for the IQ version, &amp;lt;tt&amp;gt;jabber:iq:autoupdate&amp;lt;/tt&amp;gt;, in&lt;br /&gt;
Section 6.2.4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:conference === &lt;br /&gt;
&amp;lt;br&amp;gt;Just as &amp;lt;tt&amp;gt;jabber:x:autoupdate&amp;lt;/tt&amp;gt; is&lt;br /&gt;
related to its big brother, &amp;lt;tt&amp;gt;jabber:iq:autoupdate&amp;lt;/tt&amp;gt;, so too is the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:x:conference&amp;lt;/tt&amp;gt; namespace related to&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:conference&amp;lt;/tt&amp;gt;. The &amp;lt;tt&amp;gt;&amp;amp;lt;x/&amp;amp;gt;&amp;lt;/tt&amp;gt; version of the&lt;br /&gt;
IQ-conference namespace is used to convey information about a&lt;br /&gt;
conferencing room, usually attached to a message:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;message id='2113' to='robert@company-a.com'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;subject&amp;amp;gt;Design Meeting&amp;amp;lt;/subject&amp;amp;gt; &amp;amp;lt;body&amp;amp;gt;Robert -&lt;br /&gt;
you're supposed to be at the meeting now!&amp;amp;lt;/body&amp;amp;gt; &amp;amp;lt;x&lt;br /&gt;
xmlns='jabber:x:conference' jid='meeting1@meetings.company-a.com'/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If supported by the receiving client, this will be interpreted as an&lt;br /&gt;
invitation to the room and the procedure for joining the room (in this&lt;br /&gt;
case, identified with the JID &amp;lt;tt&amp;gt;meeting1@conf.company-a.com&amp;lt;/tt&amp;gt;) can&lt;br /&gt;
be automatically initiated:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' id='c4'&lt;br /&gt;
to='meeting1@meetings.company-a.com'&amp;amp;gt; &amp;amp;lt;query&lt;br /&gt;
xmlns='jabber:iq:conference'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:delay === &lt;br /&gt;
&amp;lt;br&amp;gt;Messages are sometimes sent to entities that&lt;br /&gt;
aren't available at that particular moment. If they are stored offline,&lt;br /&gt;
they are timestamped, in the &amp;lt;tt&amp;gt;jabber:x:delay&amp;lt;/tt&amp;gt; namespace, so that&lt;br /&gt;
when they are finally received, the recipient can use this information&lt;br /&gt;
to determine when they were originally sent:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;message to='sabine@yak/Work' from='yak'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;subject&amp;amp;gt;Weekend at last!&amp;amp;lt;/subject&amp;amp;gt; &amp;amp;lt;body&amp;amp;gt;Don't forget&lt;br /&gt;
Father's Day on Sunday!&amp;amp;lt;/body&amp;amp;gt; &amp;amp;lt;x xmlns='jabber:x:delay'&lt;br /&gt;
from='yak/announce/motd'&lt;br /&gt;
stamp='20010615T09:00:01'&amp;amp;gt;Announced&amp;amp;lt;/x&amp;amp;gt; &amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this Message-Of-The-Day (MOTD) announcement, we see that, as well as&lt;br /&gt;
the &amp;lt;tt&amp;gt;stamp&amp;lt;/tt&amp;gt; attribute showing that the announcement was sent out&lt;br /&gt;
on the Friday morning before Father's Day, a short text description,&lt;br /&gt;
&amp;quot;Announced&amp;quot;, is included.&lt;br /&gt;
&lt;br /&gt;
The namespace is also used by the &amp;lt;tt&amp;gt;xdb&amp;lt;/tt&amp;gt; component to timestamp&lt;br /&gt;
various fragments of data stored in the user's records on the server.&lt;br /&gt;
Here, we see that Sabine updated her user registration details (using a&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:register&amp;lt;/tt&amp;gt; query during her session) at the beginning&lt;br /&gt;
of March:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;query xmlns='jabber:iq:register'&lt;br /&gt;
xdbns='jabber:iq:register'&amp;amp;gt; &amp;amp;lt;name&amp;amp;gt;S. Reitz-Adams&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;email&amp;amp;gt;sabine@reitz-adams.org&amp;amp;lt;/email&amp;amp;gt; &amp;amp;lt;x&lt;br /&gt;
xmlns='jabber:x:delay' stamp='20010302T12:15:42'&amp;amp;gt;updated&amp;amp;lt;/x&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/query&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:encrypted === &lt;br /&gt;
&amp;lt;br&amp;gt;You can use the relatively new&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:x:encrypted&amp;lt;/tt&amp;gt; namespace to implement message-level&lt;br /&gt;
security. It allows the attachment of encrypted data Public Key&lt;br /&gt;
Infrastructure (PKI) techniques, meaning that the data is encrypted&lt;br /&gt;
using the message sender's private key and decrypted by the recipient&lt;br /&gt;
using the sender's public key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;message to='john@company-a.com' id='m221'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;body&amp;amp;gt;Top Secret!&amp;amp;lt;/body&amp;amp;gt; &amp;amp;lt;x&lt;br /&gt;
xmlns='jabber:x:encrypted'&amp;amp;gt;&lt;br /&gt;
lxG/K9tFGgtk9yUNRTWUMwtI2ty27s6M0VzwWQBCr6Irwu1CiHTG9o&lt;br /&gt;
pSfX4ff3Yusa4Ah7ippuD9qcl/KgX4HEBJtt4Dt9SPb86jmaGN1gdd&lt;br /&gt;
dxqxeTFvFat3mwO/DvU8CKULwMi7ejgn/ib0WhSM2cfsJEIUP=TsL6&lt;br /&gt;
9HUY7eVvzKKe5CvMNnE/4UAQ4lDfbqqXVSdCO8swLaG1los1zGP8io&lt;br /&gt;
lZXjlaz75YwVVYucrFw7EXKa/wTGVjAPnkWBwv/AYx5poIyjqWQt6q&lt;br /&gt;
kLZmk5YA44PxAGveOHhVDxUuRW8MTtMUqEENYZDwfugOEGCBWol8=X&lt;br /&gt;
BaPqH5t4fS24OiqO2sJVJjIbORrBD0kYU2xhwcM3KSS/ffBAHEjoQ+&lt;br /&gt;
WvxdFEtjYuzBtyI2a672oZvyA6IqIjpovvYtKFnP7ghKgpY3J9xhYg&lt;br /&gt;
KKrWRIciH5rj3Imy2d87cCd8os5nWYkt8p1ZkebRoGPkIlvy0iL7m8 &amp;amp;lt;/x&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Jabber server itself does not currently provide any mechanisms for&lt;br /&gt;
key management or exchange; the namespace is for the time being purely a&lt;br /&gt;
marked container to hold encrypted data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:envelope === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:x:envelope&amp;lt;/tt&amp;gt; namespace&lt;br /&gt;
describes more complex message-addressing details than the simple&lt;br /&gt;
&amp;lt;tt&amp;gt;from&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;to&amp;lt;/tt&amp;gt; attributes in the&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt; elements.&lt;br /&gt;
&lt;br /&gt;
The first area in which this namespace is used is in server-side&lt;br /&gt;
filtering, a service provided by the JSM's &amp;lt;tt&amp;gt;mod_filter&amp;lt;/tt&amp;gt; module.&lt;br /&gt;
For example, when a user sets a filter rule to forward all messages to&lt;br /&gt;
someone else while he's not around:&amp;lt;ref&amp;gt;The filter service is described&lt;br /&gt;
in Section 4.4.3.1 in Chapter 4. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;rule name='absent'&amp;amp;gt; &amp;amp;lt;show&amp;amp;gt;xa&amp;amp;lt;/show&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;forward&amp;amp;gt;john@company-b.com&amp;amp;lt;/forward&amp;amp;gt; &amp;amp;lt;/rule&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
a message such as this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;message id='284' to='janet@company-b.com'&amp;amp;gt; &amp;amp;lt;body&amp;amp;gt;Can&lt;br /&gt;
you give me the sales figures for last quarter?&amp;amp;lt;/body&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
will be passed on to ''john@company-b.com'' in this form:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;message id='284' to='janet@company-b.com'&amp;amp;gt; &amp;amp;lt;body&amp;amp;gt;Can&lt;br /&gt;
you give me the sales figures for last quarter?&amp;amp;lt;/body&amp;amp;gt; &amp;lt;tt&amp;gt;&amp;amp;lt;x&lt;br /&gt;
xmlns='jabber:x:envelope'&amp;amp;gt; &amp;amp;lt;forwardedby&lt;br /&gt;
jid='janet@company-b.com'&amp;amp;gt; &amp;amp;lt;from jid='mark@company-b.com'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;cc jid='john@company-b.com'&amp;amp;gt; &amp;amp;lt;/x&amp;amp;gt;&amp;lt;/tt&amp;gt; &amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
to add context information on where the message has come from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:event === &lt;br /&gt;
&amp;lt;br&amp;gt;Message ''events'' allow clients and servers&lt;br /&gt;
alike to add information about the receipt and handling of messages at&lt;br /&gt;
various stages of delivery. There are currently four types of events&lt;br /&gt;
supported in this namespace:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Composing&lt;br /&gt;
: The composing event, represented by the &amp;lt;tt&amp;gt;&amp;amp;lt;composing/&amp;amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: tag within the &amp;lt;tt&amp;gt;&amp;amp;lt;x/&amp;amp;gt;&amp;lt;/tt&amp;gt; extension qualified by the&lt;br /&gt;
: &amp;lt;tt&amp;gt;jabber:x:event&amp;lt;/tt&amp;gt; namespace, can be set by clients and signifies&lt;br /&gt;
: that the user is composing a reply to the message just sent. &lt;br /&gt;
; Delivered&lt;br /&gt;
: When a message is received by a client, it can set the&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;amp;lt;delivered/&amp;amp;gt;&amp;lt;/tt&amp;gt; flag to signify that the message has been&lt;br /&gt;
: received. &lt;br /&gt;
; Displayed&lt;br /&gt;
: The displayed event is used to indicate that the message sent has been&lt;br /&gt;
: displayed to the user. This event is set, using the&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;amp;lt;displayed/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag, by clients. &lt;br /&gt;
; Offline&lt;br /&gt;
: When a message recipient is not connected, the JSM module&lt;br /&gt;
: ''mod_offline'' will store the message and send it to the recipient&lt;br /&gt;
: when she is next available. This offline storage event can be set by&lt;br /&gt;
: the server, using the &amp;lt;tt&amp;gt;&amp;amp;lt;offline/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag, to notify the&lt;br /&gt;
: sender that the message has been stored offline. The&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;amp;lt;composing/&amp;amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;amp;lt;delivered/&amp;amp;gt;&amp;lt;/tt&amp;gt;, and&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;amp;lt;displayed/&amp;amp;gt;&amp;lt;/tt&amp;gt; events are client events and are&lt;br /&gt;
: appropriate to be set only by the client. The&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;amp;lt;offline/&amp;amp;gt;&amp;lt;/tt&amp;gt; event is a server event and appropriate to&lt;br /&gt;
: be set only by the server. In all cases, the events are set only if&lt;br /&gt;
: the message originator requests that they are. Adding a&lt;br /&gt;
: &amp;lt;tt&amp;gt;jabber:x:event&amp;lt;/tt&amp;gt; extension to a message like this: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;message to='sabine@yak' id='M31'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;subject&amp;amp;gt;Where are you?&amp;amp;lt;/subject&amp;amp;gt; &amp;amp;lt;body&amp;amp;gt;Let me know&lt;br /&gt;
when you get back.&amp;amp;lt;/body&amp;amp;gt; &amp;amp;lt;x xmlns='jabber:x:event'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;displayed/&amp;amp;gt; &amp;amp;lt;offline/&amp;amp;gt; &amp;amp;lt;/x&amp;amp;gt; &amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
is the way to request that we get notified:&lt;br /&gt;
&lt;br /&gt;
* If and when the message is stored offline by the server in the&lt;br /&gt;
eventuality that Sabine is not connected &lt;br /&gt;
* When the message is eventually displayed to Sabine The former event will be set by the&lt;br /&gt;
server; the latter by Sabine's client.&lt;br /&gt;
&lt;br /&gt;
''Setting'' an event is similar to ''requesting'' one and uses the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:x:event&amp;lt;/tt&amp;gt; namespace. Here is what we would receive if the&lt;br /&gt;
server did store our message to Sabine offline:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;message to='dj@yak/Work' id='M31' from='sabine@yak'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;x xmlns='jabber:x:event'&amp;amp;gt; &amp;amp;lt;offline/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;id&amp;amp;gt;M31&amp;amp;lt;/id&amp;amp;gt; &amp;amp;lt;/x&amp;amp;gt; &amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That is, the &amp;lt;tt&amp;gt;&amp;amp;lt;offline/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag is sent back to the&lt;br /&gt;
originator, along with an &amp;lt;tt&amp;gt;&amp;amp;lt;id/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag that contains the&lt;br /&gt;
&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; of the message that was stored offline. Example 6-6 shows&lt;br /&gt;
the receipt of a chat message and the &amp;lt;tt&amp;gt;&amp;amp;lt;composing/&amp;amp;gt;&amp;lt;/tt&amp;gt; event&lt;br /&gt;
being raised as Sabine starts to type her reply.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Raising and canceling the &amp;amp;lt;composing/&amp;amp;gt; event'' DJ sends a quick&lt;br /&gt;
chat message to Sabine and requests that his client be notified when she&lt;br /&gt;
starts typing her response:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;message to='sabine@yak/Work' from='dj@yak/home'&lt;br /&gt;
id='122' type='chat'&amp;amp;gt; &amp;amp;lt;body&amp;amp;gt;hey, want a coffee?&amp;amp;lt;/body&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;thread&amp;amp;gt;ABAF6FC6521546A2B65B19EA391CB72A&amp;amp;lt;/thread&amp;amp;gt; &amp;amp;lt;x&lt;br /&gt;
xmlns='jabber:x:event'&amp;amp;gt; &amp;amp;lt;composing/&amp;amp;gt; &amp;amp;lt;/x&amp;amp;gt; &amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sabine starts to type, which fires the &amp;lt;tt&amp;gt;&amp;amp;lt;composing/&amp;amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
event:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;message from='sabine@yak/Work' to='dj@yak/home'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;x xmlns='jabber:x:event'&amp;amp;gt; &amp;amp;lt;composing/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;id&amp;amp;gt;122&amp;amp;lt;/id&amp;amp;gt; &amp;amp;lt;/x&amp;amp;gt; &amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sabine is distracted, and her client decides she's abandoned the reply&lt;br /&gt;
and sends a cancellation of the &amp;lt;tt&amp;gt;&amp;amp;lt;composing/&amp;amp;gt;&amp;lt;/tt&amp;gt; event,&lt;br /&gt;
containing only the message &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; included when the event was&lt;br /&gt;
originally raised:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;message from='sabine@yak/Work' to='dj@yak/home'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;x xmlns='jabber:x:event'&amp;amp;gt; &amp;amp;lt;id&amp;amp;gt;122&amp;amp;lt;/id&amp;amp;gt; &amp;amp;lt;/x&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:expire === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:x:expire&amp;lt;/tt&amp;gt; is a simple&lt;br /&gt;
namespace to add a &amp;quot;use by&amp;quot; or &amp;quot;read by&amp;quot; stamp to a message. If you wish&lt;br /&gt;
to send a message and impose a finite lifetime upon it, attach an expiry&lt;br /&gt;
extension thus:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;message to='piers@pipetree.com' id='M24'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;subject&amp;amp;gt;Twinkies!&amp;amp;lt;/subject&amp;amp;gt; &amp;amp;lt;body&amp;amp;gt; I've got some&lt;br /&gt;
fresh Twinkies here, stop by for one before they all disappear!&lt;br /&gt;
&amp;amp;lt;/body&amp;amp;gt; &amp;amp;lt;x xmlns='jabber:x:expire' seconds='1800'/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If Piers was not connected when the message was sent, the&lt;br /&gt;
''mod_offline'' module would hold the message ready for when he&lt;br /&gt;
reconnects. But before storing it, an extra attribute (&amp;lt;tt&amp;gt;stored&amp;lt;/tt&amp;gt;)&lt;br /&gt;
is added with the current time.&lt;br /&gt;
&lt;br /&gt;
Example 6-7 shows what the relevant section of Piers' spool file would&lt;br /&gt;
look like.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Storage of an offline message with the jabber:x:expire extension''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;foo xmlns='jabber:x:offline' xdbns='jabber:x:offline'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;message to='piers@pipetree.com' id='M24'&lt;br /&gt;
from='dj@pipetree.com/kitchen'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;subject&amp;amp;gt;Twinkies!&amp;amp;lt;/subject&amp;amp;gt; &amp;amp;lt;body&amp;amp;gt; I've got some&lt;br /&gt;
fresh Twinkies here, stop by for one before they all disappear!&lt;br /&gt;
&amp;amp;lt;/body&amp;amp;gt; &amp;lt;tt&amp;gt;&amp;amp;lt;x xmlns='jabber:x:expire' seconds='600'&lt;br /&gt;
stored='993038415'/&amp;amp;gt;&amp;lt;/tt&amp;gt; &amp;amp;lt;x xmlns='jabber:x:delay'&lt;br /&gt;
from='dj@pipetree.com' stamp='20010620T12:00:15'&amp;amp;gt; Offline Storage&lt;br /&gt;
&amp;amp;lt;/x&amp;amp;gt; &amp;amp;lt;/message&amp;amp;gt; &amp;amp;lt;/foo&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When Piers reconnects, ''mod_offline'' retrieves the message and&lt;br /&gt;
compares the current time with the value in the &amp;lt;tt&amp;gt;stored&amp;lt;/tt&amp;gt;&lt;br /&gt;
attribute. If the difference exceeds the desired lifetime of the&lt;br /&gt;
message, as specified in the &amp;lt;tt&amp;gt;seconds&amp;lt;/tt&amp;gt; attribute, the message is&lt;br /&gt;
discarded. Otherwise, the &amp;lt;tt&amp;gt;seconds&amp;lt;/tt&amp;gt; attribute value is reduced to&lt;br /&gt;
reflect the amount of time the message sat in storage, the&lt;br /&gt;
&amp;lt;tt&amp;gt;stored&amp;lt;/tt&amp;gt; attribute is removed, and the message is sent to Piers.&lt;br /&gt;
&lt;br /&gt;
Furthermore, if Piers' client supports it, a further check of the&lt;br /&gt;
message's lifetime can be made before display, in case the message was&lt;br /&gt;
stored in an inbox-style mechanism. (With Piers' luck, he probably&lt;br /&gt;
missed out on the Twinkies.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:oob === &lt;br /&gt;
&amp;lt;br&amp;gt;We've already seen the &amp;lt;tt&amp;gt;jabber:x:oob&amp;lt;/tt&amp;gt; in&lt;br /&gt;
action earlier in the book. It is used in a similar way to its big&lt;br /&gt;
brother, the &amp;lt;tt&amp;gt;jabber:iq:oob&amp;lt;/tt&amp;gt; namespace. Attaching URLs to&lt;br /&gt;
messages, typically done by mechanisms that deliver news- and&lt;br /&gt;
alert-style headines, is done like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;message type='headline' to='qmacro@jabber.org/laptop'&lt;br /&gt;
id='h12'&amp;amp;gt; &amp;amp;lt;subject&amp;amp;gt;Jabber Foundation Public&lt;br /&gt;
Conference&amp;amp;lt;/subject&amp;amp;gt; &amp;amp;lt;x xmlns='jabber:x:oob'&amp;amp;gt; &amp;amp;lt;url&amp;amp;gt;&lt;br /&gt;
http://www.jabbercentral.com/news/view.php?news_id=989358658&lt;br /&gt;
&amp;amp;lt;/url&amp;amp;gt; &amp;amp;lt;desc&amp;amp;gt; Tomorrow, May 9th, a meeting regarding the&lt;br /&gt;
Jabber Foundation will be held. &amp;amp;lt;/desc&amp;amp;gt; &amp;amp;lt;/x&amp;amp;gt; &amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multiple attachments can be made to a message, using multiple &lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;x/&amp;amp;gt;&amp;lt;/tt&amp;gt; tags qualified by this namespace.&lt;br /&gt;
&lt;br /&gt;
The RSS Delivery Mechanism, described in Section 9.3 in Chapter 9, and&lt;br /&gt;
the Headline Viewer, described in Section 9.4, also in Chapter 9, both&lt;br /&gt;
use the &amp;lt;tt&amp;gt;jabber:x:oob&amp;lt;/tt&amp;gt; namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:roster === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:x:roster&amp;lt;/tt&amp;gt; namespace is&lt;br /&gt;
related to its big brother, &amp;lt;tt&amp;gt;jabber:iq:roster&amp;lt;/tt&amp;gt;; it is used to&lt;br /&gt;
carry roster information as message attachments. This makes it&lt;br /&gt;
straightforward for users to exchange contact information between&lt;br /&gt;
themselves:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;message id='M91' to='shiels@jabber.org'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;body&amp;amp;gt;Hi Robert - this is that fool I was telling you&lt;br /&gt;
about...&amp;amp;lt;/body&amp;amp;gt; &amp;amp;lt;x xmlns='jabber:x:roster'&amp;amp;gt; &amp;amp;lt;item&lt;br /&gt;
jid='qmacro@jabber.org' name='DJ Adams'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;group&amp;amp;gt;Fools&amp;amp;lt;/group&amp;amp;gt; &amp;amp;lt;/item&amp;amp;gt; &amp;amp;lt;/x&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/message&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that it is inappropriate to send the subscription-related&lt;br /&gt;
attributes (&amp;lt;tt&amp;gt;subscription&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ask&amp;lt;/tt&amp;gt;, described in Section&lt;br /&gt;
6.2.12). Instead, it is up to the recipient to negotiate his own&lt;br /&gt;
presence subscription arrangements with the contact or contacts (more&lt;br /&gt;
than one item can be sent in such an attachment) listed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jabber:x:signed === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;jabber:x:signed&amp;lt;/tt&amp;gt; namespace is&lt;br /&gt;
related to the &amp;lt;tt&amp;gt;jabber:x:encrypted&amp;lt;/tt&amp;gt; namespace and is used to&lt;br /&gt;
stamp &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt; elements&lt;br /&gt;
with a PKI-based signature, thus providing reliable identification of&lt;br /&gt;
the packet originator.&lt;br /&gt;
&lt;br /&gt;
In generating the signature block, some relevant data must be used to&lt;br /&gt;
pass into the signing algorithm so that an electronic signature is&lt;br /&gt;
produced. In the case of &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; elements, the&lt;br /&gt;
contents of the &amp;lt;tt&amp;gt;&amp;amp;lt;status/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag are used, and in the case&lt;br /&gt;
of &amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt; elements, the contents of the&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;body/&amp;amp;gt;&amp;lt;/tt&amp;gt; tag are used.&lt;br /&gt;
&lt;br /&gt;
The presence of a &amp;lt;tt&amp;gt;jabber:x:signed&amp;lt;/tt&amp;gt; signature in a&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; packet is intended to signify that the client&lt;br /&gt;
sending the packet supports such PKI infrastucture and, for example, is&lt;br /&gt;
able to decrypt messages encrypted in the &amp;lt;tt&amp;gt;jabber:x:encrypted&amp;lt;/tt&amp;gt;&lt;br /&gt;
namespace.&lt;br /&gt;
&lt;br /&gt;
Here's a &amp;lt;tt&amp;gt;&amp;amp;lt;presence/&amp;amp;gt;&amp;lt;/tt&amp;gt; packet containing a signature; the&lt;br /&gt;
data &amp;quot;All present and correct&amp;quot; is what is fed into the algorithm:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;presence from='piers@jabber.org'&lt;br /&gt;
to='qmacro@pipetree.com'&amp;amp;gt; &amp;amp;lt;status&amp;amp;gt;All present and&lt;br /&gt;
correct&amp;amp;lt;/status&amp;amp;gt; &amp;amp;lt;x xmlns='jabber:x:signed'&amp;amp;gt;&lt;br /&gt;
p/B8CuePDUvAAHPuacDb2OYjAHTGn4BbqChrhxwH8ZTKJxL&lt;br /&gt;
9nUNH58OF=tl0VMDcSYizG5HFh &amp;amp;lt;/x&amp;amp;gt; &amp;amp;lt;/presence&amp;amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The X::IQ Relationship == &lt;br /&gt;
&amp;lt;br&amp;gt;As has been noted, some of the X&lt;br /&gt;
namespaces—&amp;lt;tt&amp;gt;autoupdate&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;conference&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;roster&amp;lt;/tt&amp;gt;, &lt;br /&gt;
and &amp;lt;tt&amp;gt;oob&amp;lt;/tt&amp;gt;—have cousins in the IQ space. If you're still confused&lt;br /&gt;
about  which to use where, there's a rule of thumb about context: the IQ&lt;br /&gt;
namespaces generally are used to qualify a ''conversation'' that&lt;br /&gt;
revolves around whatever the namespace represents, while the X&lt;br /&gt;
namespaces apply more  to one-off, ad hoc, information-laden messages.&lt;br /&gt;
&lt;br /&gt;
For example, the  &amp;lt;tt&amp;gt;jabber:iq:conference&amp;lt;/tt&amp;gt; namespace qualifies much&lt;br /&gt;
of the content of a conversation between a user and the  conferencing&lt;br /&gt;
service regarding entry to a specific room. The&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:x:conference&amp;lt;/tt&amp;gt; namespace is used to provide context and&lt;br /&gt;
meaning to a pointer to a room.&lt;br /&gt;
&lt;br /&gt;
Likewise, the &amp;lt;tt&amp;gt;jabber:x:oob&amp;lt;/tt&amp;gt; namespace qualifies a pointer to&lt;br /&gt;
some piece of information that is out of band, whereas the&lt;br /&gt;
&amp;lt;tt&amp;gt;jabber:iq:oob&amp;lt;/tt&amp;gt; namespace provides  context to a negotiation that&lt;br /&gt;
leads to the usage of that external bandwidth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous Namespaces == &lt;br /&gt;
&amp;lt;br&amp;gt;In addition to the standard Jabber&lt;br /&gt;
namespaces that begin  &amp;lt;tt&amp;gt;jabber:iq:&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;jabber:x:&amp;lt;/tt&amp;gt;, a&lt;br /&gt;
couple of others are used often and are worthy of our attention.&lt;br /&gt;
&lt;br /&gt;
They're both outside the &amp;lt;tt&amp;gt;jabber:&amp;lt;/tt&amp;gt; namespace because they don't&lt;br /&gt;
originate within Jabber. The vCard format, represented by the&lt;br /&gt;
&amp;lt;tt&amp;gt;vcard-temp&amp;lt;/tt&amp;gt; namespace, is an emerging Internet standard used in&lt;br /&gt;
many different  environments, not just within Jabber. XHTML is a World&lt;br /&gt;
Wide Web Consortium (W3C) standard that Jabber has adopted to  carry&lt;br /&gt;
rich text in messages and is represented in Jabber with the&lt;br /&gt;
http://www.w3.org/1999/xhtml namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The vcard-temp Namespace === &lt;br /&gt;
&amp;lt;br&amp;gt;The &amp;lt;tt&amp;gt;vcard-temp&amp;lt;/tt&amp;gt; namespace&lt;br /&gt;
represents the vCard format. It's a format used to provide information&lt;br /&gt;
about an entity—a person, company, or even, in Jabber's case, a piece of&lt;br /&gt;
software—in the form of a virtual business card.&lt;br /&gt;
&lt;br /&gt;
The idea behind the vCard format, which is an emerging but as yet&lt;br /&gt;
incomplete standard, is that it can be used to hold information about&lt;br /&gt;
something in a formalized and parcel-like way. vCards can be attached to&lt;br /&gt;
email messages and extracted from user directories and address books.&lt;br /&gt;
The fact that the format is not yet a standard is reflected in the&lt;br /&gt;
&amp;quot;temporary&amp;quot; namespace (&amp;lt;tt&amp;gt;vcard-temp&amp;lt;/tt&amp;gt;) used to qualify vCard&lt;br /&gt;
exchanges.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;Jabber uses the vCard format to hold details about various parts&lt;br /&gt;
of the Jabber server; each component can have a vCard, as seen in&lt;br /&gt;
Section 4.3 in Chapter 4. Each Jabber user can have a vCard, too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Retrievals of vCards, and updates, are made using IQs containing&lt;br /&gt;
extensions qualified by the &amp;lt;tt&amp;gt;vcard-temp&amp;lt;/tt&amp;gt; namespace. To&lt;br /&gt;
''request'' a vCard, send an IQ-get to the holder of the vCard you want,&lt;br /&gt;
like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' to='qmacro@jabber.org' id='73'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;vcard xmlns='vcard-temp'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Rather than the usual tag name of &amp;lt;tt&amp;gt;query&amp;lt;/tt&amp;gt;, vCard&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;iq/&amp;amp;gt;&amp;lt;/tt&amp;gt; extensions have the name &amp;lt;tt&amp;gt;vcard&amp;lt;/tt&amp;gt; (this is&lt;br /&gt;
sometimes seen in all caps or as &amp;lt;tt&amp;gt;vCard&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
In response to this request, the vCard belonging to ''qmacro'' will be&lt;br /&gt;
returned as shown in Example 6-8.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''A response returning qmacro's vCard''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RECV: &amp;amp;lt;iq id='73' to='dj@gnu.mine.nu/home' type='result'&lt;br /&gt;
from='qmacro@jabber.org'&amp;amp;gt; &amp;amp;lt;vCard xmlns='vcard-temp'&lt;br /&gt;
version='3.0'&amp;amp;gt; &amp;amp;lt;BDAY/&amp;amp;gt; &amp;amp;lt;ORG&amp;amp;gt; &amp;amp;lt;ORGNAME/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;ORGUNIT/&amp;amp;gt; &amp;amp;lt;/ORG&amp;amp;gt; &amp;amp;lt;TITLE/&amp;amp;gt; &amp;amp;lt;ROLE/&amp;amp;gt; &amp;amp;lt;TEL&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;VOICE/&amp;amp;gt; &amp;amp;lt;HOME/&amp;amp;gt; &amp;amp;lt;/TEL&amp;amp;gt; &amp;amp;lt;TEL&amp;amp;gt; &amp;amp;lt;fax/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;HOME/&amp;amp;gt; &amp;amp;lt;/TEL&amp;amp;gt; &amp;amp;lt;TEL&amp;amp;gt; &amp;amp;lt;MSG/&amp;amp;gt; &amp;amp;lt;HOME/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/TEL&amp;amp;gt; &amp;amp;lt;ADR&amp;amp;gt; &amp;amp;lt;HOME/&amp;amp;gt; &amp;amp;lt;EXTADD/&amp;amp;gt; &amp;amp;lt;STREET/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;LOCALITY/&amp;amp;gt; &amp;amp;lt;REGION/&amp;amp;gt; &amp;amp;lt;PCODE/&amp;amp;gt; &amp;amp;lt;COUNTRY/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/ADR&amp;amp;gt; &amp;amp;lt;FN&amp;amp;gt;DJ Adams&amp;amp;lt;/FN&amp;amp;gt; &amp;amp;lt;TEL&amp;amp;gt; &amp;amp;lt;VOICE/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;WORK/&amp;amp;gt; &amp;amp;lt;/TEL&amp;amp;gt; &amp;amp;lt;TEL&amp;amp;gt; &amp;amp;lt;fax/&amp;amp;gt; &amp;amp;lt;WORK/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/TEL&amp;amp;gt; &amp;amp;lt;TEL&amp;amp;gt; &amp;amp;lt;MSG/&amp;amp;gt; &amp;amp;lt;WORK/&amp;amp;gt; &amp;amp;lt;/TEL&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;N&amp;amp;gt; &amp;amp;lt;GIVEN&amp;amp;gt;DJ&amp;amp;lt;/GIVEN&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;FAMILY&amp;amp;gt;Adams&amp;amp;lt;/FAMILY&amp;amp;gt; &amp;amp;lt;MIDDLE/&amp;amp;gt; &amp;amp;lt;/N&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;ADR&amp;amp;gt; &amp;amp;lt;WORK/&amp;amp;gt; &amp;amp;lt;EXTADD/&amp;amp;gt; &amp;amp;lt;STREET/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;LOCALITY/&amp;amp;gt; &amp;amp;lt;REGION/&amp;amp;gt; &amp;amp;lt;PCODE/&amp;amp;gt; &amp;amp;lt;COUNTRY/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/ADR&amp;amp;gt; &amp;amp;lt;EMAIL&amp;amp;gt;dj.adams@gmx.net &amp;amp;lt;INTERNET/&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;PREF/&amp;amp;gt; &amp;amp;lt;/EMAIL&amp;amp;gt; &amp;amp;lt;NICKNAME&amp;amp;gt;qmacro&amp;amp;lt;/NICKNAME&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;URL&amp;amp;gt;http://www.pipetree.com/~dj/&amp;amp;lt;/URL&amp;amp;gt; &amp;amp;lt;/vCard&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obviously, ''qmacro'' has not added values for all of the fields that&lt;br /&gt;
the vCard format defines. Nevertheless, the response gives us a good&lt;br /&gt;
idea of what sort of information can be stored.&lt;br /&gt;
&lt;br /&gt;
There are different versions of the vCard format, as it matures. The&lt;br /&gt;
&amp;lt;tt&amp;gt;version&amp;lt;/tt&amp;gt; attribute shown in the response in Example 6-8&lt;br /&gt;
signifies which version the vCarddata returned conforms to. It's an&lt;br /&gt;
optional attribute, and  not all vCard requests will return responses&lt;br /&gt;
that include such an attribute.&lt;br /&gt;
&lt;br /&gt;
In fact, it's not the only thing that's optional. Requesting the vCard&lt;br /&gt;
belonging to a Conferencing component called &amp;lt;tt&amp;gt;conf.gnu.mine.nu&amp;lt;/tt&amp;gt;,&lt;br /&gt;
for example, will elicit the result shown in Example 6-9. Here, the&lt;br /&gt;
vCard information consists of just three fields: the full name of the&lt;br /&gt;
component  (&amp;lt;tt&amp;gt;&amp;amp;lt;FN/&amp;amp;gt;&amp;lt;/tt&amp;gt;), the component's description&lt;br /&gt;
(&amp;lt;tt&amp;gt;&amp;amp;lt;DESC/&amp;amp;gt;&amp;lt;/tt&amp;gt;), and a URL (&amp;lt;tt&amp;gt;&amp;amp;lt;URL/&amp;amp;gt;&amp;lt;/tt&amp;gt;). Not all&lt;br /&gt;
entities will have vCards containing all the vCard elements, as this&lt;br /&gt;
example shows. (If the vCard data for the Conferencing component looks&lt;br /&gt;
familiar, that's because it is—we've seen how  vCards for components are&lt;br /&gt;
maintained, in the jabber.xml configuration. See  Section 4.10.3 in&lt;br /&gt;
Chapter 4 for details.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Requesting a Conferencing component's vCard''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SEND: &amp;amp;lt;iq type='get' id='vc11' to='conf.gnu.mine.nu'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;vcard xmlns='vcard-temp'/&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
RECV: &amp;amp;lt;iq type='result' id='vc11' from='conf.gnu.mine.nu'&lt;br /&gt;
to='qmacro@jabber.org/home'&amp;amp;gt; &amp;amp;lt;vCard xmlns='vcard-temp'&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;FN&amp;amp;gt;gnu Chat&amp;amp;lt;/FN&amp;amp;gt; &amp;amp;lt;DESC&amp;amp;gt;Conferencing&lt;br /&gt;
Component&amp;amp;lt;/DESC&amp;amp;gt; &amp;amp;lt;URL&amp;amp;gt;http://www.gnu.mine.nu/&amp;amp;lt;/URL&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;/vCard&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice also that the response shown in Example 6-8 seems to have come&lt;br /&gt;
from ''qmacro'' himself—the value in the &amp;lt;tt&amp;gt;&amp;amp;lt;iq&amp;amp;gt;&amp;lt;/tt&amp;gt; element's&lt;br /&gt;
&amp;lt;tt&amp;gt;from&amp;lt;/tt&amp;gt; attribute seems to suggest that. In fact, ''qmacro'' was&lt;br /&gt;
never aware of the request. What actually happens, when a request is&lt;br /&gt;
made to retrieve a vCard belonging to a Jabber ''user'', is that the JSM&lt;br /&gt;
responds to the request; it jumps in on behalf of the user registered&lt;br /&gt;
with it to answer the request. This means that Jabber user vCards can be&lt;br /&gt;
retrieved whether or not the user is connected and available at the time&lt;br /&gt;
of the request.&lt;br /&gt;
&lt;br /&gt;
This is in contrast to component vCards; it is the components themselves&lt;br /&gt;
who must respond to requests for vCards (in fact, to requests for&lt;br /&gt;
''anything'' addressed to them). If a component is not connected, the&lt;br /&gt;
request will fail, in that an IQ-error (502, &amp;quot;Server Connect Failed&amp;quot;)&lt;br /&gt;
will be returned as the jabberd hub was  unable to pass the request on.&lt;br /&gt;
&lt;br /&gt;
That a user vCard can be retrieved independently of the user's&lt;br /&gt;
availability highlights the fact that user vCards are stored on the&lt;br /&gt;
Jabber server. The information is stored along with the rest of the&lt;br /&gt;
user-specific information (such as private data and pending messages&lt;br /&gt;
stored offline) in the user's spool file, in a similar way to how public&lt;br /&gt;
and private data is stored, as shown in Example 6-2.&lt;br /&gt;
&lt;br /&gt;
To ''maintain'' vCard information, an IQ-set is required:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;iq id='76' type='set'&amp;amp;gt; &amp;amp;lt;vCard xmlns='vcard-temp'&lt;br /&gt;
version='3.0'&amp;amp;gt; &amp;amp;lt;BDAY&amp;amp;gt;1966-09-03&amp;amp;lt;/BDAY&amp;amp;gt; &amp;amp;lt;ORG&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;ORGNAME&amp;amp;gt;Merlix&amp;amp;lt;/ORGNAME&amp;amp;gt; &amp;amp;lt;ORGUNIT/&amp;amp;gt; &amp;amp;lt;/ORG&amp;amp;gt;&lt;br /&gt;
&amp;amp;lt;TITLE&amp;amp;gt;Tea boy&amp;amp;lt;/TITLE&amp;amp;gt; &amp;amp;lt;ROLE&amp;amp;gt;Making the&lt;br /&gt;
tea&amp;amp;lt;/ROLE&amp;amp;gt; ... &amp;amp;lt;/vCard&amp;amp;gt; &amp;amp;lt;/iq&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Not all of the vCard elements are shown to keep the example short, but&lt;br /&gt;
don't assume that individual elements of a vCard can be maintained by&lt;br /&gt;
sending only those elements back. The ''whole'' vCard must be sent in an&lt;br /&gt;
IQ-set request for the vCard to be maintained. Whatever is received by&lt;br /&gt;
the JSM is taken to be absolute, not relative, and replaces anything&lt;br /&gt;
that was already stored in the spool.&lt;br /&gt;
&lt;br /&gt;
Note that it's the maintainer's responsibility to specify a&lt;br /&gt;
&amp;lt;tt&amp;gt;version&amp;lt;/tt&amp;gt; attribute if one is required or desired.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The XHTML Namespace === &lt;br /&gt;
&amp;lt;br&amp;gt;As already shown in Section 5.4.1.2 in&lt;br /&gt;
Chapter 5, the XHTML namespace, http://www.w3.org/1999/xhtml, is used to&lt;br /&gt;
qualify an optional message tag &amp;lt;tt&amp;gt;&amp;amp;lt;html/&amp;amp;gt;&amp;lt;/tt&amp;gt;, which can be&lt;br /&gt;
used to carry a rich-text version of the message's&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;amp;lt;body/&amp;amp;gt;&amp;lt;/tt&amp;gt; contents.&lt;br /&gt;
&lt;br /&gt;
Definitive information on the XHTML standard can be found at &lt;br /&gt;
http://www.w3.org/1999/xhtml. As mentioned in Section 5.4.1.2 in Chapter&lt;br /&gt;
5, this namespace qualifies tags within &amp;lt;tt&amp;gt;&amp;amp;lt;message/&amp;amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
elements that are optional. Jabber clients do not have to support&lt;br /&gt;
rich-text formatting. If they do, a number of XHTML elements are&lt;br /&gt;
''required'', and a number are  ''optional''. The protocol documentation&lt;br /&gt;
section on Jabber's central documentation site at &lt;br /&gt;
http://docs.jabber.org has full details.&lt;/div&gt;</description>
			<pubDate>Sat, 16 Sep 2006 02:19:10 GMT</pubDate>			<dc:creator>Mikeh</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:JabChapter_6</comments>		</item>
	</channel>
</rss>