我的自定义服务器在向客户端发送替换命令时出现 SyncML 错误

发布于 2024-12-03 12:48:59 字数 5191 浏览 2 评论 0原文

我开发了一个syncml服务器,并且我不从服务器同步到客户端(诺基亚e71)以修改联系人。除了当我向客户端替换现有 localuid 的命令时,其余所有工作都有效。然后,客户向我返回该命令的状态 415(数据的类型或格式不对应),而客户接受相同的数据进行添加(通过命令添加或替换)。

有人已经遇到过这个问题吗?

以下是客户端和服务器之间发送的消息:

带有替换命令的服务器消息:

<?xml version="1.0" ?>
<!DOCTYPE SyncML 
   PUBLIC "-//SYNCML//DTD SyncML 1.2//EN"    
   "http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd">
<SyncML xmlns="SYNCML:SYNCML1.2">
<SyncHdr>

    <VerDTD>1.2</VerDTD><VerProto>SyncML/1.2</VerProto><SessionID>235</SessionID><MsgID>3</MsgID> <Target><LocURI>IMEI:358240030276208</LocURI></Target> <Source><LocURI>http://192.168.8.20:50000</LocURI></Source> <Meta>

        <MaxMsgSize xmlns="syncml:metinf">1000000</MaxMsgSize><MaxObjSize xmlns="syncml:metinf">4000000</MaxObjSize>

    </Meta>

</SyncHdr>
<SyncBody>

    <Status>

        <CmdID>1</CmdID><MsgRef>3</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd> <TargetRef>http://192.168.8.20:50000</TargetRef> <SourceRef>IMEI:358240030276208</SourceRef> <Data>200</Data>

    </Status> <Status>

        <CmdID>2</CmdID><MsgRef>3</MsgRef><CmdRef>3</CmdRef><Cmd>Sync</Cmd> <SourceRef>./C:Contacts.cdb</SourceRef> <TargetRef>./card</TargetRef> <Data>200</Data>

    </Status> <Sync>

        <CmdID>3</CmdID> <Source><LocURI>./card</LocURI></Source> <Target><LocURI>./C:Contacts.cdb</LocURI></Target><NumberOfChanges>1</NumberOfChanges> <Replace>

            <CmdID>4</CmdID> <Meta><Type xmlns="syncml:metinf">text/x-vcard</Type> </Meta> <Item> <Target><LocURI>69</LocURI></Target> <Data>

                <![CDATA[BEGIN:VCARD VERSION:2.1 N:Smith;Change;;; FN:Change Smith END:VCARD]]>

            </Data> </Item>

        </Replace>

    </Sync> <Final/>

</SyncBody>
</SyncML>

带有替换命令状态的客户端消息:

<?xml version="1.0" ?>
<!DOCTYPE SyncML
  PUBLIC '-//SYNCML//DTD SyncML 1.2//EN'
  'http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd'>
<SyncML xmlns="SYNCML:SYNCML1.2">
    <SyncHdr>
        <VerDTD>
            1.2
        </VerDTD>
        <VerProto>
            SyncML/1.2
        </VerProto>
        <SessionID>
            235
        </SessionID>
        <MsgID>
            4
        </MsgID>
        <Target>
            <LocURI>
                http://192.168.8.20:50000
            </LocURI>
        </Target>
        <Source>
            <LocURI>
                IMEI:358240030276208
            </LocURI>
            <LocName>
                test1
            </LocName>
        </Source>
        <Meta>
            <MaxMsgSize xmlns="syncml:metinf">
                65535
            </MaxMsgSize>
        </Meta>
    </SyncHdr>
    <SyncBody>
        <Status>
            <CmdID>
                1
            </CmdID>
            <MsgRef>
                3
            </MsgRef>
            <CmdRef>
                0
            </CmdRef>
            <Cmd>
                SyncHdr
            </Cmd>
            <TargetRef>
                IMEI:358240030276208
            </TargetRef>
            <SourceRef>
                http://192.168.8.20:50000
            </SourceRef>
            <Data>
                200
            </Data>
        </Status>
        <Status>
            <CmdID>
                2
            </CmdID>
            <MsgRef>
                3
            </MsgRef>
            <CmdRef>
                3
            </CmdRef>
            <Cmd>
                Sync
            </Cmd>
            <TargetRef>
                ./C:Contacts.cdb
            </TargetRef>
            <SourceRef>
                ./card
            </SourceRef>
            <Data>
                200
            </Data>
        </Status>
        <Status>
            <CmdID>
                3
            </CmdID>
            <MsgRef>
                3
            </MsgRef>
            <CmdRef>
                4
            </CmdRef>
            <Cmd>
                Replace
            </Cmd>
            <TargetRef>
                69
            </TargetRef>
            <Data>
                415
            </Data>
        </Status>
        <Final/>
    </SyncBody>
</SyncML>

I develop a syncml server and I do not synchronize from the server to the client (nokia e71) for modified contacts. All the rest works except when I make a command replace towards the client for an existing localuid. The client returns me then the status 415 for this command (type or format of the datum is not corresponding) while the customer accepts the same datum for an addition (by a command add or replaces).

Has anybody already met this problem ?

Here are messages sent between the client and the server:

Server message with Replace command:

<?xml version="1.0" ?>
<!DOCTYPE SyncML 
   PUBLIC "-//SYNCML//DTD SyncML 1.2//EN"    
   "http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd">
<SyncML xmlns="SYNCML:SYNCML1.2">
<SyncHdr>

    <VerDTD>1.2</VerDTD><VerProto>SyncML/1.2</VerProto><SessionID>235</SessionID><MsgID>3</MsgID> <Target><LocURI>IMEI:358240030276208</LocURI></Target> <Source><LocURI>http://192.168.8.20:50000</LocURI></Source> <Meta>

        <MaxMsgSize xmlns="syncml:metinf">1000000</MaxMsgSize><MaxObjSize xmlns="syncml:metinf">4000000</MaxObjSize>

    </Meta>

</SyncHdr>
<SyncBody>

    <Status>

        <CmdID>1</CmdID><MsgRef>3</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd> <TargetRef>http://192.168.8.20:50000</TargetRef> <SourceRef>IMEI:358240030276208</SourceRef> <Data>200</Data>

    </Status> <Status>

        <CmdID>2</CmdID><MsgRef>3</MsgRef><CmdRef>3</CmdRef><Cmd>Sync</Cmd> <SourceRef>./C:Contacts.cdb</SourceRef> <TargetRef>./card</TargetRef> <Data>200</Data>

    </Status> <Sync>

        <CmdID>3</CmdID> <Source><LocURI>./card</LocURI></Source> <Target><LocURI>./C:Contacts.cdb</LocURI></Target><NumberOfChanges>1</NumberOfChanges> <Replace>

            <CmdID>4</CmdID> <Meta><Type xmlns="syncml:metinf">text/x-vcard</Type> </Meta> <Item> <Target><LocURI>69</LocURI></Target> <Data>

                <![CDATA[BEGIN:VCARD VERSION:2.1 N:Smith;Change;;; FN:Change Smith END:VCARD]]>

            </Data> </Item>

        </Replace>

    </Sync> <Final/>

</SyncBody>
</SyncML>

Client Message with a replace command status:

<?xml version="1.0" ?>
<!DOCTYPE SyncML
  PUBLIC '-//SYNCML//DTD SyncML 1.2//EN'
  'http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd'>
<SyncML xmlns="SYNCML:SYNCML1.2">
    <SyncHdr>
        <VerDTD>
            1.2
        </VerDTD>
        <VerProto>
            SyncML/1.2
        </VerProto>
        <SessionID>
            235
        </SessionID>
        <MsgID>
            4
        </MsgID>
        <Target>
            <LocURI>
                http://192.168.8.20:50000
            </LocURI>
        </Target>
        <Source>
            <LocURI>
                IMEI:358240030276208
            </LocURI>
            <LocName>
                test1
            </LocName>
        </Source>
        <Meta>
            <MaxMsgSize xmlns="syncml:metinf">
                65535
            </MaxMsgSize>
        </Meta>
    </SyncHdr>
    <SyncBody>
        <Status>
            <CmdID>
                1
            </CmdID>
            <MsgRef>
                3
            </MsgRef>
            <CmdRef>
                0
            </CmdRef>
            <Cmd>
                SyncHdr
            </Cmd>
            <TargetRef>
                IMEI:358240030276208
            </TargetRef>
            <SourceRef>
                http://192.168.8.20:50000
            </SourceRef>
            <Data>
                200
            </Data>
        </Status>
        <Status>
            <CmdID>
                2
            </CmdID>
            <MsgRef>
                3
            </MsgRef>
            <CmdRef>
                3
            </CmdRef>
            <Cmd>
                Sync
            </Cmd>
            <TargetRef>
                ./C:Contacts.cdb
            </TargetRef>
            <SourceRef>
                ./card
            </SourceRef>
            <Data>
                200
            </Data>
        </Status>
        <Status>
            <CmdID>
                3
            </CmdID>
            <MsgRef>
                3
            </MsgRef>
            <CmdRef>
                4
            </CmdRef>
            <Cmd>
                Replace
            </Cmd>
            <TargetRef>
                69
            </TargetRef>
            <Data>
                415
            </Data>
        </Status>
        <Final/>
    </SyncBody>
</SyncML>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文