对xep-0030 服务发现的一点理解,目录查询
2013-11-19 16:28
253 查看
服务发现,主要是查询服务器支持哪些功能,以及以目录的形式浏览上面提供的服务,比如聊天室(会议室),
一般查询流程如下
1.查询服务器上所有的条目,服务器为根(shakespeare.lit) (相当我的电脑 中,查询有哪些盘,C盘,d盘,e盘等)
返回,子节点列表,在jid来区分不同条目
2.在条目中查询节点(查询catalog.shakespeare.lit下的节点)(相当于在C盘中查询有哪些目录,比如 C:\,这里记路径为\*)
发送
返回
这里的node为条目节点
分别为books,clothing,music三个节点
3.查询(music)子节点(查询:\music\*)
发送
返回
就如上面这样,目录式地查询相应原地址,至于 怎么区分到底是目录 ,还是文件,还是其它的,下篇文章讲解
总结一下查询过程:
1.查询条目(我的电脑 中查询盘符)
2.查询节点(在C盘中查询有哪些文件夹)
3.继续查询节点(相当 于在文件夹下查询子文件夹)
一般查询流程如下
1.查询服务器上所有的条目,服务器为根(shakespeare.lit) (相当我的电脑 中,查询有哪些盘,C盘,d盘,e盘等)
<iq type='get' from='romeo@montague.net/orchard' to='shakespeare.lit' id='items1'> <query xmlns='http://jabber.org/protocol/disco#items'/> </iq>
返回,子节点列表,在jid来区分不同条目
<iq type='result' from='shakespeare.lit' to='romeo@montague.net/orchard' id='items1'> <query xmlns='http://jabber.org/protocol/disco#items'> <item jid='people.shakespeare.lit' name='Directory of Characters'/> <item jid='plays.shakespeare.lit' name='Play-Specific Chatrooms'/> <item jid='mim.shakespeare.lit' name='Gateway to Marlowe IM'/> <item jid='words.shakespeare.lit' name='Shakespearean Lexicon'/> <item jid='globe.shakespeare.lit' name='Calendar of Performances'/> <item jid='headines.shakespeare.lit' name='Latest Shakespearean News'/> <item jid='catalog.shakespeare.lit' name='Buy Shakespeare Stuff!'/> <item jid='en2fr.shakespeare.lit' name='French Translation Service'/> </query> </iq>
2.在条目中查询节点(查询catalog.shakespeare.lit下的节点)(相当于在C盘中查询有哪些目录,比如 C:\,这里记路径为\*)
发送
<iq type='get' from='romeo@montague.net/orchard' to='catalog.shakespeare.lit' id='items2'> <query xmlns='http://jabber.org/protocol/disco#items'/> </iq>
返回
<iq type='result' from='catalog.shakespeare.lit' to='romeo@montague.net/orchard' id='items2'> <query xmlns='http://jabber.org/protocol/disco#items'> <item jid='catalog.shakespeare.lit' node='books' name='Books by and about Shakespeare'/> <item jid='catalog.shakespeare.lit' node='clothing' name='Wear your literary taste with pride'/> <item jid='catalog.shakespeare.lit' node='music' name='Music from the time of Shakespeare'/> </query> </iq>
这里的node为条目节点
分别为books,clothing,music三个节点
3.查询(music)子节点(查询:\music\*)
发送
<iq type='get' from='romeo@montague.net/orchard' to='catalog.shakespeare.lit' id='items3'> <query xmlns='http://jabber.org/protocol/disco#items' node='music'/> </iq>
返回
<iq type='result' from='catalog.shakespeare.lit' to='romeo@montague.net/orchard' id='items3'> <query xmlns='http://jabber.org/protocol/disco#items' node='music'> <item jid='catalog.shakespeare.lit' node='music/A'/> <item jid='catalog.shakespeare.lit' node='music/B'/> <item jid='catalog.shakespeare.lit' node='music/C'/> <item jid='catalog.shakespeare.lit' node='music/D'/> . . . </query> </iq>
就如上面这样,目录式地查询相应原地址,至于 怎么区分到底是目录 ,还是文件,还是其它的,下篇文章讲解
总结一下查询过程:
1.查询条目(我的电脑 中查询盘符)
2.查询节点(在C盘中查询有哪些文件夹)
3.继续查询节点(相当 于在文件夹下查询子文件夹)
相关文章推荐
- 对xep-0030 服务发现的一点理解,属性查询
- 自己发现的nodejs服务的问题--1查询语句的嵌套问题+接受的数据该怎么用
- 对/etc/rc.d/init.d/目录的一点理解
- 对/etc/rc.d/init.d/目录的一点理解
- 对/etc/rc.d/init.d目录的一点理解
- Windows终端服务的一点发现
- 对于NOVELL LDAP 轻量级目录服务的学习理解
- AE初学的一点理解及有关QI(接口查询)
- 对/etc/rc.d/init.d目录的一点理解
- c#Winform程序调用app.config文件配置数据库连接字符串 SQL Server文章目录 浅谈SQL Server中统计对于查询的影响 有关索引的DMV SQL Server中的执行引擎入门 【译】表变量和临时表的比较 对于表列数据类型选择的一点思考 SQL Server复制入门(一)----复制简介 操作系统中的进程与线程
- 【基础服务】简单理解DNS的递归、迭代查询 - DNS(一)
- 服务目录初步理解摘抄
- 对/etc/rc.d/init.d目录的一点理解
- linux查询tftp服务目录和nfs服务目录命令
- 对/etc/rc.d/init.d/目录的一点理解
- 查询Linux系统服务程序的安装目录
- 对/etc/rc.d/init.d/目录的一点理解
- [学习指导] linux 启动过程以及 /etc/rc.d/init.d/目录的一点理解
- 蓝牙技术-设备查询及服务发现
- 关于安全共性服务构件的一点理解