1.介绍
这篇文档将讲述设备管理应用的SyncML表现协议.
2.OMA设备管理应用
2.1MIME使用
OMA DM消息使用两种MIME内容类型。
application/vnd.syncml.dm+xml:DM消息的明文XML表示。
application/vnd.syncml.dm+wbxml:DM消息的WBXML二进制表示。
2.2WBXML
All clients and servers MUST expect any 1.x version of WBXML, and all clients and servers MUST use any of the
following versions of WBXML [WBXML1.1], [WBXML1.2], [WBXML1.3].
3Mark-up语言描述
3.1Common Use Elements
命令
服务器支持 客户端支持 |
发送 接收 发送 接收
Chal MUST MUST MUST MUST
Cmd MUST MUST MUST MUST
CmdID MUST MUST MUST MUST
CmdRef MUST MUST MUST MUST
Cred MUST MUST MUST MUST
Final MUST MUST MUST MUST
LocName MUST MUST MUST MUST
LocURI MUST MUST MUST MUST
MoreData MUST MUST SHOULD SHOULD
MsgID MUST MUST MUST MUST
MsgRef MUST MUST MUST MUST
RespURI MAY MUST MAY MUST
SessionID MUST MUST MUST MUST
Source MUST MUST MUST MUST
SourceRef MUST MUST MUST MUST
Target MUST MUST MUST MUST
TargetRef MUST MUST MUST MUST
VerDTD MUST MUST MUST MUST
VerProto MUST MUST MUST MUST
3.1.1Archive
限制: 在OMA DM管理协议中这个元素不被使用。
3.2.2Chal
限制:当使用syncml:auth-md5或syncml:auth-MAC验证的时候,NextNonce元素的Meta Format必须被指定并且必须是b64.
实例:下面是一个"MD-5" 验证challenge例子.被请求的password和userid是Base64字符编码。
<Status>
<MsgRef>0</MsgRef>
<Cmd>SyncHdr</Cmd>
<TargetRef>http://www.datamgr.org/servlet/manageit</TargetRef>
<SourceRef>IMEI:001004FF1234567</SourceRef>
<Chal>
<Meta>
<Type xmlns=’syncml:metinf’>syncml:auth-md5</Type>
<Format xmlns=’syncml:metinf’>b64</Format>
<NextNonce xmlns=’syncml:metinf’>ZG9iZWhhdmUNCg==</NextNonce>
</Meta>
</Chal>
<Data>401</Data>
</Status>
3.2.3Cmd
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<Status>
<MsgRef>1</MsgRef>
<CmdRef>2</CmdRef>
<CmdID>1234</CmdID>
<Cmd>Replace</Cmd>
<TargetRef>./antivirus_data</TargetRef>
<!-- OK, antivirus update loaded-->
<Data>200</Data>
</Status>
3.2.4CmdID
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<Status>
<MsgRef>1</MsgRef>
<CmdRef>2</CmdRef>
<CmdID>1234</CmdID>
<Cmd>Replace</Cmd>
<TargetRef>./antivirus_data</TargetRef>
<!-- OK, antivirus update loaded-->
<Data>200</Data>
</Status>
3.2.5CmdRef
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<Status>
<MsgRef>1</MsgRef>
<CmdRef>2</CmdRef>
<CmdID>1234</CmdID>
<Cmd>Replace</Cmd>
<TargetRef>./antivirus_data</TargetRef>
<!-- OK, antivirus update loaded-->
<Data>200</Data>
</Status>
3.2.6Cred
限制:同[REPPRO]定义相同的限制。另外OMA DM限制Cred元素的使用在sync头元素:SyncHdr中.发起人一定不能应用Cred在单独的命令中。当使用syncml:auth-md5时,Cred元素的Meta Format必须被指定为b64。
实例:
<Cred>
<Meta>
<Type xmlns=’syncml:metinf’>syncml:auth-md5</Type>
<Format xmlns=’syncml:metinf’>b64</Format>
</Meta>
<Data>Zz6EivR3yeaaENcRN6lpAQ==</Data>
</Cred>
3.2.7Final
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<SyncML xmlns=’SYNCML:SYNCML1.2’>
<SyncHdr>...blah, blah...</SyncHdr>
<SyncBody>
...blah, blah...
<Final/>
</SyncBody>
</SyncML>
3.2.8Lang
限制:在OMA DM协议中不使用这个元素。
3.2.9LocName
限制:用来在MD5验证中发送userid。
3.2.10LocURI
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
</SyncHdr>
3.2.11MoreData
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<Add>
<CmdID>15</CmdID>
<Meta>
<Type xmlns=’syncml:metinf’>bin</Type>
<Format xmlns=’syncml:metinf’>b64</Format>
<Size xmlns=’syncml:metinf’>3000</Size>
</Meta>
<Item>
<Target>
<LocURI>./</LocURI>
</Target>
<Data>
<!-- First chunk of data file -->
</Data>
<MoreData/>
</Item>
</Add>
3.2.12MsgID
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
</SyncHdr>
3.2.13MsgRef
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<Status>
<MsgRef>1</MsgRef>
<CmdRef>2</CmdRef>
<CmdID>1234</CmdID>
<Cmd>Replace</Cmd>
<TargetRef>./antivirus_data</TargetRef>
<!-- OK, antivirus update loaded-->
<Data>200</Data>
</Status>
3.2.14NoResp
限制:在OMA DM协议中不使用这个元素。
3.2.15NoResults
限制:在OMA DM协议中不使用这个元素。
3.2.16NumberOfChanges
限制:在OMA DM协议中不使用这个元素。
3.2.17RespURI
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
<RespURI>http://www.deviceman.org/servlet/manageit/bruce1?user=jsmith&af
ter=20000512T133000Z</RespURI>
</SyncHdr>
3.2.18SessionID
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<SyncML xmlns=’SYNCML:SYNCML1.2’ >
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
</SyncHdr>
<SyncBody>
...blah, blah...
</SyncBody>
</SyncML>
3.2.19SftDel
限制:在OMA DM协议中不使用这个元素。
3.2.20Source
限制:没有额外的限制超出[REPPRO]定义的。
实例:下面是一个SyncHdr元素类型的应用例子。
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
</SyncHdr>
3.2.21SourceRef
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<Status>
<CmdID>4321</CmdID>
<MsgRef>1</MsgRef>
<CmdRef>1234</CmdRef>
<Cmd>Copy</Cmd>
<TargetRef>./DM/WAPSetting/1</TargetRef>
<SourceRef>./Common/WAP/1</SourceRef>
<Data>200</Data>
</Status>
3.2.22Target
限制:没有额外的限制超出[REPPRO]定义的。
实例:下面是一个SyncHdr元素类型的应用例子。
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
</SyncHdr>
3.2.23TargetRef
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<Status>
<CmdID>4321</CmdID>
<MsgRef>1</MsgRef>
<CmdRef>1234</CmdRef>
<Cmd>Copy</Cmd>
<TargetRef>./DM/WAPSetting/1</TargetRef>
<SourceRef>./Common/WAP/1</SourceRef>
<Data>200</Data>
</Status>
3.2.24VerDTD
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
</SyncHdr>
3.2.25VerProto
限制:规范的主要修订出现了矛盾的变化以至于可能需要一个新的管理客户端。较小修订改变没有影响管理客户端的基本兼容性。
当DM消息符合OMA DM协议规范的修订时,这个值必须是"DM/1.2".
实例:
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
</SyncHdr>
3.3Message Container Elements
命令 服务器支持 客户端支持
发送 接收 发送 接收
SyncML MUST MUST MUST MUST
SyncHdr MUST MUST MUST MUST
SyncBody MUST MUST MUST MUST
3.3.1SyncML
限制:由于传输支持MIME内容类型,所以对象必须识别为
application/vnd.syncml.dm+xml (for clear-text, XML representation)或者
application/vnd.syncml.dm+wbxml (for binary, WBXML representation).
实例:
<SyncML xmlns=’SYNCML:SYNCML1.2’>
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
</SyncHdr>
<SyncBody>
...blah, blah...
</SyncBody>
</SyncML>
3.3.2SyncHdr
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<SyncML xmlns=’SYNCML:SYNCML1.2’>
<SyncHdr>
<VerDTD>1.2</VerDTD>
<VerProto>DM/1.2</VerProto>
<SessionID>1</SessionID>
<MsgID>1</MsgID>
<Target>
<LocURI>http://www.syncml.org/mgmt-server</LocURI>
</Target>
<Source>
<LocURI>IMEI:493005100592800</LocURI>
</Source>
</SyncHdr>
<SyncBody>
...blah, blah...
</SyncBody>
</SyncML>
3.3.3SyncBody
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<SyncML xmlns=’SYNCML:SYNCML1.2’>
<SyncHdr>
...blah, blah...
</SyncHdr>
<SyncBody>
<Status>
<MsgRef>2</MsgRef>
<CmdID>1</CmdID>
<CmdRef>0</CmdRef>
<Cmd>SyncHdr</Cmd>
<Data>200</Data>
</Status>
<Alert>
<CmdID>2</CmdID>
<Data>1100</Data> <!—- User displayable notification -->
<Item></Item>
<Item>
<Data>Your antivirus software is being updated.</Data>
</Item>
</Alert>
<Get>
<CmdID>3</CmdID>
<Item>
<Target>
<LocURI>./antivirus_data/version</LocURI>
</Target>
</Item>
</Get>
<Final/>
</SyncBody>
</SyncML>
3.4Data Description Elements
命令 服务器支持 客户端支持
发送 接收 发送 接收
Data MUST MUST MUST MUST
Item MUST MUST MUST MUST
Meta MUST MUST MUST MUST
Correlator MAY MUST MAY MAY
3.4.1Data
限制:It is REQUIRED that either the mark-up characters of the Data element
content are properly escaped according to [XML] specification rules or that the
CDATA sections are used.
实例:
<Item>
<Data>MINDT=10</Data>
</Item>
3.4.2Item
限制:When an Item contains information for a managed node, and the meta format is not null, the Data element MUST be specified.
实例:
<Item>
<Data>MINDT=10</Data>
</Item>
3.4.3Meta
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<Cred>
<Meta>
<Type xmlns=’syncml:metinf’>syncml:auth-md5</Type>
<Format xmlns=’syncml:metinf’>b64</Format>
</Meta>
<Data>Zz6EivR3yeaaENcRN6lpAQ==</Data>
</Cred>
3.4.4Correlator
限制:没有额外的限制超出[REPPRO]定义的。
实例:
<Correlator>
abc1234
</Correlator>
3.5Meta Information Elements
命令 服务器支持 客户端支持
发送 接收 发送 接收
EMI MAY MAY MAY MAY
Format MUST MUST MUST MUST
MaxMsgSize MAY MUST MAY MUST
MaxObjSize MUST MUST SHOULD SHOULD
MetInf MUST MUST MUST MUST
NextNonce MUST MUST MUST MUST
Size MUST MUST MUST MUST
Type MUST MUST MUST MUST
3.6Protocol Management Elements
命令 服务器支持 客户端支持
发送 接收 发送 接收
Status MUST MUST MUST MUST
3.6.1Status
限制:
实例:
<Status>
<MsgRef>2</MsgRef>
<CmdID>1</CmdID>
<CmdRef>0</CmdRef>
<Cmd>SyncHdr</Cmd>
<Data>200</Data>
</Status>
3.7Protocol Command Elements