嵌入式系统数据同步协议 SyncML 同步协议 -2
- UID
- 1066743
|
嵌入式系统数据同步协议 SyncML 同步协议 -2
存储能力
<DSMem>
<MaxMem>132650</MaxMem>
<MaxID>1250</MaxID>
<FreeMem>122430</FreeMem>
<FreeID>1122</FreeID>
</DSMem>
</DataStore>
<CTCap>
<CTType>text/x-vcard</CTType>
<PropName>BEGIN</PropName>
<ValEnum>VCARD</ValEnum>
<PropName>END</PropName>
<ValEnum>VCARD</ValEnum>
<PropName>VERSION</PropName>
<ValEnum>2.1</ValEnum>
<PropName>N</PropName>
<PropName>TEL</PropName>
<ParamName>VOICE</ParamName>
<ParamName>CELL</ParamName>
<CTType>text/vcard</CTType>
<PropName>BEGIN</PropName>
<ValEnum>VCARD</ValEnum>
<PropName>END</PropName>
<ValEnum>VCARD</ValEnum>
<PropName>VERSION</PropName>
<ValEnum>3.0</ValEnum>
<PropName>N</PropName>
<PropName>TEL</PropName>
<ParamName>VOICE</ParamName>
<ParamName>FAX</ParamName>
<ParamName>CELL</ParamName>
<CTType>text/vcard</CTType>
<PropName>BEGIN</PropName>
<ValEnum>VCARD</ValEnum>
<PropName>END</PropName>
<ValEnum>VCARD</ValEnum>
<PropName>VERSION</PropName>
<ValEnum>3.0</ValEnum>
<PropName>N</PropName>
<PropName>TEL</PropName>
<ParamName>VOICE</ParamName>
<ParamName>FAX</ParamName>
<ParamName>CELL</ParamName>
</CTCap>
<SyncCap>
<SyncType>01</SyncType>
<SyncType>02</SyncType>
<SyncType>07</SyncType>
</SyncCap>
</DevInf>
</Data>
</Item>
</Results>
进行双向传输,唤醒对方
<Alert>
<CmdID>1</CmdID>
<Data>201</Data> <!-- 201 = TWO_WAY_ALERT -->
<Item>
<Target><LocURI>./dev-contacts</LocURI></Target>
<Source><LocURI>./contacts/james_bond</LocURI></Source>
<Meta>
发送认证
<Anchor xmlns='syncml:metinf'>
<Last>200005021T081812Z </Last>
<Next>200005022T093223Z </Next>
</Anchor>
</Meta>
</Item>
</Alert>
<Final/>
</SyncBody>
</SyncML>
3.3.5.3客户端提交数据
<SyncML>
<SyncHdr>
<VerDTD>1.0</VerDTD>
<VerProto>SyncML/1.0</VerProto>
<SessionID>1</SessionID>
<MsgID>2</MsgID>
<Target><LocURI>http://www.syncml.org/sync-server</LocURI></Target>
<Source><LocURI>IMEI:493005/10/059280/0</LocURI></Source>
</SyncHdr>
<SyncBody>
回复服务器的请求
<Status>
<MsgRef>1</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd>
<TargetRef>IMEI:493005/10/059280/0</TargetRef>
<SourceRef> http://www.syncml.org/sync-server </SourceRef>
<Data>212</Data> <!--Statuscode for OK, authenticated for session-->
</Status>
回复服务器的请求
<Status>
<MsgRef>1</MsgRef><CmdRef>1</CmdRef><Cmd>Alert</Cmd>
<TargetRef>./dev-contacts</TargetRef>
<SourceRef>./contacts/james_bond</SourceRef>
<Data>200</Data> <!--Statuscode for Success-->
<Item>
<Data>
Anchor回复对方请求的<next>值
<Anchor xmlns='syncml:metinf'><Next>200005022T093223Z </Next></Anchor>
</Data>
</Item>
</Status>
<Sync>
<CmdID>1</CmdID>
<Target><LocURI>./contacts/james_bond</LocURI></Target>
<Source><LocURI>./dev-contacts</LocURI></Source>
<Meta>
存储能力
<DSMem xmlns='syncml:devinf'>
<FreeMem>8100</FreeMem>
<!--Free memory (bytes) in Calendar database on a device -->
<FreeId>81</FreeId>
<!--Number of free records in Calendar database-->
</DSMem>
</Meta>
<Replace>
<CmdID>2</CmdID>
<Meta><Type xmlns='syncml:metinf'>text/x-vcard</Type></Meta>
<Item>
<Source><LocURI>1012</LocURI></Source>
数据项地址
<Data><!--The vCard data would be placed here.--></Data>
</Item>
</Replace>
</Sync>
<Final/>
</SyncBody>
</SyncML>
3.3.5.4服务器端提交数据
<SyncML>
<SyncHdr>
<VerDTD>1.0</VerDTD>
<VerProto>SyncML/1.0</VerProto>
<SessionID>1</SessionID>
<MsgID>2</MsgID>
<Target><LocURI>IMEI:493005/10/059280/0</LocURI></Target>
<Source><LocURI>http://www.syncml.org/sync-server</LocURI></Source>
</SyncHdr>
<SyncBody>
回复客户请求
<Status>
<MsgRef>2</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd>
<TargetRef>http://www.syncml.org/sync-server</TargetRef>
<SourceRef>IMEI:493005/10/059280/0</SourceRef>
<Data>200</Data>
</Status>
回复Sync请求
<Status><!--This is a status for the client modifications to the server.-->
<MsgRef>2</MsgRef><CmdRef>1</CmdRef><Cmd>Sync</Cmd>
<TargetRef>./contacts/james_bond</TargetRef>
<SourceRef>./dev-contacts</SourceRef>
<Data>200</Data> <!--Statuscode for Success-->
</Status>
回复Replace
<Status>
<MsgRef>2</MsgRef><CmdRef>2</CmdRef><Cmd>Replace</Cmd>
<SourceRef>1012</SourceRef>
<Data>200</Data> <!--Statuscode for Success-->
</Status>
发出同步请求
<Sync>
<CmdID>1</CmdID>
<Target><LocURI>./dev-contacts</LocURI></Target>
<Source><LocURI>./contacts/james_bond</LocURI></Source>
<Replace>
<CmdID>2</CmdID>
<Meta><Type xmlns='syncml:metinf'>text/x-vcard</type></Meta>
<Item>
<Target><LocURI>1023</LocURI></Target>
<Data><!--The vCard data would be placed here.--></Data>
</Item>
</Replace>
<Add>
<CmdID>3</CmdID>
<Meta><Type xmlns='syncml:metinf'>text/x-vcard</type></Meta>
<Item>
<Source><LocURI>10536681</LocURI></Source>
<Data><!--The vCard data would be placed here.--></Data>
</Item>
</Add>
</Sync>
<Final/>
</SyncBody>
</SyncML>
3.3.5.5客户端显示数据更改情况
<SyncML>
<SyncHdr>
<VerDTD>1.0</VerDTD>
<VerProto>SyncML/1.0</VerProto>
<SessionID>1</SessionID>
<MsgID>3</MsgID>
<Target><LocURI>http://www.syncml.org/sync-server</LocURI></Target>
<Source><LocURI>IMEI:493005/10/059280/0</LocURI></Source>
</SyncHdr>
<SyncBody>
回复同步请求
<Status>
<MsgRef>2</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd>
<TargetRef>IMEI:493005/10/059280/0</TargetRef>
<SourceRef> http://www.syncml.org/sync-server </SourceRef>
<Data>200</Data>
</Status>
<Status>
<MsgRef>2</MsgRef><CmdRef>1</CmdRef><Cmd>Sync</Cmd>
<TargetRef>./dev-contacts</TargetRef>
<SourceRef>./contacts/james_bond</SourceRef>
<Data>200</Data>
</Status>
<Status>
<MsgRef>2</MsgRef><CmdRef>2</CmdRef><Cmd>Replace</Cmd>
<TargetRef>1023</TargetRef>
<Data>200</Data>
</Status>
<Status>
<MsgRef>2</MsgRef><CmdRef>3</CmdRef><Cmd>Add</Cmd>
<SourceRef>10536681</SourceRef>
<Data>200</Data>
</Status>
<Map>服务器和客户端的数据保持同步
<CmdID>1</CmdID>
<Target><LocURI>./contacts/james_bond</LocURI></Target>
<Source><LocURI>./dev-contacts</LocURI></Source>
<MapItem>
10536681和1024指的是同一个数据
<Target><LocURI>10536681</LocURI></Target>
<Source><LocURI>1024</LocURI></Source>
</MapItem>
</Map>
<Final/>
</SyncBody>
</SyncML>
3.3.5.6服务器端确认更改
<SyncML>
<SyncHdr>
<VerDTD>1.0</VerDTD>
<VerProto>SyncML/1.0</VerProto>
<SessionID>1</SessionID>
<MsgID>3</MsgID>
<Target><LocURI>IMEI:493005/10/059280/0</LocURI></Target>
<Source><LocURI>http://www.syncml.org/sync-server</LocURI></Source>
</SyncHdr>
<SyncBody>
<Status>
<MsgRef>3</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd>
<TargetRef>http://www.syncml.org/sync-server</TargetRef>
<SourceRef>IMEI:493005/10/059280/0</SourceRef>
<Data>200</Data>
</Status>
证实数据已经做了更改
<Status>
<MsgRef>3</MsgRef><CmdRef>1</CmdRef><Cmd>Map</Cmd>
<TargetRef>./contacts/james_bond </TargetRef>
<SourceRef>./dev-contacts</SourceRef>
<Data>200</Data>
</Status>
<Final/>
</SyncBody>
</SyncML> |
|
|
|
|
|