From: Kwan h. L. <sor...@mi...> - 2009-04-10 06:37:42
|
Hello. It's the 3rd question I ask to this mailing list today:) Anyway, Libsycnml client always fails when it try to replace items on Sync4j server. Sync4j server always returns error code 511 and stop sync process. Because Sync4j expect <Source> element for replace item. But Libsyncml makes replace item with <Target> element(in sml_command.c). So I saw "OMA-TS-DS_DataSyncRep-V1_2_1-20070810.doc" document to find what is right. But I can't find. Actually, chapter 6.5.12 explains about Replace in the document does not contain what element is right. There are examples use both <Source> and <Target> element. Here is a last example of chapter 6.5.12 about Replace. Example: The following example specifies a source item that was replaced in the source database. The Source contains the relative URI of the item that was replaced. The absolute URI of the Source is specified in the parent Sync element type (not shown in the example). <Replace> <CmdID>1234</CmdID> <Cred> <Meta> <Type xmlns='syncml:metinf'>syncml:auth-md5</Type> <Format xmlns='syncml:metinf'>b64</Format> </Meta> <Data>Zz6EivR3yeaaENcRN6lpAQ==</Data> </Cred> <Meta><Type xmlns='syncml:metinf'>text/calendar</Type></Meta> <Item> <Source><LocURI>./20</LocURI></Source> <Data>BEGIN:VCALENDAR VERSION:2.0 METHOD:REQUEST BEGIN:VEVENT UID:12345-19991015T133000Z SEQUENCE:1 DTSTART:19991026T110000Z DTEND:19991026T190000Z SUMMARY:Technical Committee Meeting CATEGORIES:Appointment ORGANIZER:he...@ho... ATTENDEES:tec...@ho... END:VEVENT END:VCALENDAR </Data> </Item> </Replace> If I want to replace item on server, which one is right? <Source>? or <Target>? Is this code in LibsyncML(sml_command.c) right? SmlLocation *loc = smlLocationNew(uid, NULL, error); if (!loc) goto error_free_cmd; if (type != SML_CHANGE_ADD) item->target = loc; else item->source = loc; If is there anyone knows, please let me know. |