[sync] Re: SyncML update [PATCH]
Anthony Mills
amills at gascard.net
Mon Feb 2 10:41:07 PST 2004
Johny wrote:
> Chuck,
>
> The SOAP handling is indeed correct (other than that it doesn't work ;)
> when I use the browser :) Apologies, I do realise now what the 302 error
> was, ta for that :)
>
> I've got some debugging into rpc.php (and have attached the diff as I
> find this extremely useful, let me know if it's useful and I'll keep
> sending them as I add them)
>
Debugging is good.
> When invoking rpc.php from my P800 I get further than with Firebird, but
> it stops with no error messages whatsoever? I've got PHP errors logged
> to file (tested with SOAP error previously), but nothing there.
>
> The line it stops on in rpc.php is;
>
> $out = $server->getResponse($input, $params);
Are you sure it is stopping here? And you get no errors in your php log
file? You should get some errors. Check /tmp/sync. You should have
some files in here. Are you timing out from the login?
You may have to debug into syncml.php. Look for getResponse in that
file. I'm not sure I can help you without more input. BTW, if you
could/and don't mind. Can you send me the output from :
> $input = $server->getInput();
> + Horde::logMessage(sprintf('Server input: %s', $input) , __FILE__,
I want to see if the output is what we expect.
Anthony
>
> I get a nice log entry with data from the P800 from the previous line
> (see my diff attached), so the connection is working good and it sends
> XML to the server.
>
> I'm not asking anyone to find out why it stops, however, I'd like to
> know how I can find this out without adding debug statements through the
> code invoked by getResponse, i.e. how do I debug this beast ;) If
> logging is the way I'll start tracking through it and adding logging, no
> worries.
>
> There is nothing in the horde log, nothing in the PHP log (set to 'E_ALL
> & ~E_NOTICE') and nothing in the Apache log (where some fatal errors end
> up)
>
> The diff, I've used diff -u, if other formats preferred, lemme know.
>
> :)J
>
> ------
> [root at hugin horde]# cvs diff -u rpc.php
> Index: rpc.php
> ===================================================================
> RCS file: /repository/horde/rpc.php,v
> retrieving revision 1.26
> diff -u -r1.26 rpc.php
> --- rpc.php 31 Jan 2004 17:01:32 -0000 1.26
> +++ rpc.php 31 Jan 2004 23:07:33 -0000
> @@ -18,6 +18,8 @@
> $input = null;
> $params = null;
>
> +Horde::logMessage('Starting rpc.php', __FILE__, __LINE__, PEAR_LOG_DEBUG);
> +
> if (!empty($_SERVER['CONTENT_TYPE'])) {
> if (strstr($_SERVER['CONTENT_TYPE'], 'application/vnd.syncml+xml')) {
> $serverType = 'syncml';
> @@ -39,6 +41,8 @@
> $serverType = 'soap';
> }
>
> +Horde::logMessage(sprintf('Server type: %s', $serverType) , __FILE__,
> __LINE__, PEAR_LOG_DEBUG);
> +
> if ($serverType == 'soap' &&
> (!isset($_SERVER['REQUEST_METHOD']) ||
> $_SERVER['REQUEST_METHOD'] != 'POST')) {
> @@ -56,13 +60,17 @@
> * basic authentication against Horde, but backends can override this
> * as needed. */
> $server->authorize();
> +Horde::logMessage('Authorisation done' , __FILE__, __LINE__,
> PEAR_LOG_DEBUG);
> +
>
> /* Get the server's response. We call $server->getInput() to allow
> * backends to handle input processing differently. */
> if ($input === null) {
> $input = $server->getInput();
> + Horde::logMessage(sprintf('Server input: %s', $input) , __FILE__,
> __LINE__, PEAR_LOG_DEBUG);
> }
> $out = $server->getResponse($input, $params);
> +Horde::logMessage(sprintf('Server response: %s', $out) , __FILE__,
> __LINE__, PEAR_LOG_DEBUG);
>
> /* Return the response to the client. */
> header('Content-Type: ' . $server->getResponseContentType());
> ----
>
> Chuck Hagenbuch wrote:
>
>> Quoting Johny <horde at agotnes.com>:
>>
>>> Got the hooks.php.dist update, and copied it across to the hooks.php
>>> dir. Also, did a complete cvs update on both framework and horde, now I
>>> get this issue when testing the link from Firebird;
>>>
>>> Fatal error: Failed opening required 'SOAP/Server.php'
>>> (include_path='.:/usr/share/pear') in /usr/share/pear/Horde/RPC/soap.php
>>> on line 43
>>>
>>> It goes and invokes the Soap handling by default, not SyncML as the P800
>>> does.
>>
>>
>>
>> Right... you're not sending it a SyncML request. Send it something
>> with the
>> Content-Type of either application/vnd.sycml+xml or
>> application/vnc.syncml+wbxml, and it'll invoke the SyncML handler
>> (with WBXML
>> encoding/decoding around it as necessary).
>>
>>> The 302 is weird, now it reports 200 as I'd expect, but doesn't seem to
>>> get anywhere from the call to rpc.php, so I'm adding a touch of
>>> debugging there to see what is happening now, hoping you guys will sort
>>> out the SOAP handling :)
>>
>>
>>
>> It's not weird it all, I explained the fix in my reply. And the SOAP
>> handling is
>> correct behavior.
>>
>> -chuck
>>
>> --
>> Charles Hagenbuch, <chuck at horde.org>
>> "Here, I brought some cole slaw. It's made from peeeooople! Just
>> kidding."
>
>
More information about the sync
mailing list