On 05/30/2012 03:35 PM, Andris Pavenis wrote:
I have already earlier tried to use Android Funambol client with libsynthesis based server.

The first problem was that a datastore 'configuration' was required at the initial login before actual creating of the account on device. Workarounded this problem by adding it to config.xml (simple copy/paste with small edits from datastore 'notes' as nothing better came into the mind).

Earlier I got stuck after this step as SyncML still failed and error messages did not explain very much. Current version with console output enabled outputs large number of error messages from SyncML TK about parse errors. Begin of them looks like fragment below.

Client sends only XML document (I'm not sure that that XML message in attachment is exactly the same but as I tested messages with the same length differs only in values of 2 elements SessionID and Next which are irrelevant for this problem.

I only applied additional simple 1 line patch to get console messages in readable format as absence of LF is nuisance when reading messages:
diff --git a/src/sysync/sysync_debug.h b/src/sysync/sysync_debug.h
index 61d4cdd..68dce5e 100755
--- a/src/sysync/sysync_debug.h
+++ b/src/sysync/sysync_debug.h
@@ -110,7 +110,7 @@ TDebugLogger *getDbgLogger(void);
   // Because a lot of libs log to stderr, include a unique prefix.
   // Assumes that all printf format strings are plain strings.
   #define CONSOLEPUTS(m) CONSOLE_PRINTF_VARARGS("%s", (m))
-#define CONSOLE_PRINTF_VARARGS(_m, _args...) fprintf(stderr, "SYSYNC " _m, ##_args) +#define CONSOLE_PRINTF_VARARGS(_m, _args...) fprintf(stderr, "SYSYNC " _m "\n", ##_args)
   #define CONSOLEPRINTF(m) CONSOLE_PRINTF_VARARGS m
 # else // CONSOLEINFO_LIBC
   #define CONSOLEPUTS(m) ConsolePuts(m)

Andris

HTTP request: session_id=N/A request_length=1815 content_type='application/vnd.syncml+xml'
Generated ID: 'uKFfNjRJyWUDofmko5QyaadzslI'
session_step: 12:11:15.451 : t=0.000006 err=0 : STEPCMD_GOTDATA ==> STEPCMD_OK SYSYNC xmlAttribute: smlErr 0x2001 (required field content missing) while parsing
SYSYNC - parsing UNKNOWN token, ext=undef/SyncML
SYSYNC - Tag start at 0x7FE02801B0F0, scanner pos at 0x7FE02801B0F7, data: SYSYNC 3E 0A 3C 53 79 6E 63 48 64 72 3E 0A 3C 56 65 72 44 54 44 3E 31 2E 32 3C 2F 56 65 72 44 54 44 3E
SYSYNC >_<SyncHdr>_<VerDTD>1.2</VerDTD>

Did some debugging. It seems that SyncML TK fails to accept sloppy XML message with missing namespace where it is expected. For testing only added optional code (can be enabled by specifying corresponding configure option) which ensures that WBXML is always passed to libsynthesis (converted using libwbxml if needed). After that parse errors disappeared (libwbxml accepted sloppy XML). However after that Funambol Android client crashed and I was back on initial login screen. libsynthesis says that it wants slow-sync for datastore configuration and Funambol client on that gives up with "Generic error"

Andris


_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to