art1c0 / mooha

Automatically exported from code.google.com/p/mooha
0 stars 0 forks source link

Request XML couldn't be parsed due to some libxml errors #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Sync with Nokia E51

What is the expected output? What do you see instead?
Phone: Invalid Serveraddress
Server Error-Log:
[01-Jul-2010 09:00:24] PHP Fatal error:  SyncmlException: Request is unreadable 
in /usr/share/webapps/mooha/inc/MoohaServer.php on line 271
...SyncmlException: Request XML couldn't be parsed due to some libxml errors: 
...LIBXML Fatal error 4: Start tag expected, '<' not found on line 1(1)
...input:
�j in /usr/share/webapps/mooha/inc/MoohaServer.php on line 266
 in /usr/share/webapps/mooha/config.php on line 58 

What version of the product are you using? On what operating system?
mooha 0.3b

Please provide any additional information below.
I changed the forceFormat to XML but the error is the same.

Original issue reported on code.google.com by aschr...@gmail.com on 1 Jul 2010 at 7:04

GoogleCodeExporter commented 9 years ago
Did you used external WBXML decoder? If no please try it.
Also please download this file: 
http://mooha.googlecode.com/svn/trunk/mooha_server/log.php
Use it instead of your index.php in the root of mooha_server.
Create directory "data" in that root and make it writable, then after sync you 
will have all the converation there.
Please send it zipped to my email: artico.bandurini@gmail.com

Original comment by artico.b...@gmail.com on 2 Jul 2010 at 8:41

GoogleCodeExporter commented 9 years ago
with the external library I could get it to work.
But unfortunately you have to add some unwanted directories to the open_basedir 
variable.
perhaps if you would make a place where the binaries could be copied into the 
directories this would help.
example: /usr/share/webapps/bin/

Original comment by aschr...@gmail.com on 3 Jul 2010 at 9:35

GoogleCodeExporter commented 9 years ago
Can you please elaborate a bit which directories you assume?

Original comment by artico.b...@gmail.com on 6 Jul 2010 at 5:36

GoogleCodeExporter commented 9 years ago

Original comment by artico.b...@gmail.com on 6 Jul 2010 at 5:37

GoogleCodeExporter commented 9 years ago
Some place to copy the xml2wbxml and wbxml2xml files to.
I use archlinux where I have made a directory /usr/share/webapps/bin so that 
PHP can use these tools.
Basically I don't like to expose all my /usr/local/bin via open_base 
PHP-variable so I copy the essential files to an other place that I place 
within my open_base variable.
Perhaps this should be specific for each distribution but a general good 
starting point would be to point it somewhere via a configurable variable.

for ./inc/WbxmlHelper.php
29c29,30
<       '/usr/share/webapps/bin/',
---
>       '/usr/bin/',
>       '/usr/local/bin/'
207c208

or better via a variable in the config file.

Original comment by aschr...@gmail.com on 6 Jul 2010 at 9:34

GoogleCodeExporter commented 9 years ago
Issue 17 has been merged into this issue.

Original comment by artico.b...@gmail.com on 21 Jul 2010 at 7:26

GoogleCodeExporter commented 9 years ago

Original comment by artico.b...@gmail.com on 21 Jul 2010 at 7:28

GoogleCodeExporter commented 9 years ago
Dear Sir,

i have same problem reported by you please guide me how to fix it.

where i can get xml2wbxml/wbxml2xml library ?
where i should put these files ?

my server config as given below
Php Version : 5.2.8
OS : Linux kernel ver-2.6.18-128.1.10.el5PAE
Apache version : 2.2.11
MYSQL : 5.0.89-community-log

Original comment by anand.j....@gmail.com on 21 Jul 2010 at 12:59

GoogleCodeExporter commented 9 years ago
You need to find out how to install these libraries on your Linux:
libwbxml2
libwbxml2-utils 

Original comment by artico.b...@gmail.com on 6 Aug 2010 at 7:45

GoogleCodeExporter commented 9 years ago
for Redhat EnterpriseL Linux 5 that you seem to have this would be the wbxml2 
package.

Then you have to care that the files xml2wbxml and wbxml2xml are within a path 
that is configured withing you PHP variable open_base. If you don't want to 
open open_base to a significant part of your system you can move these files 
into your mooha folder (I use a bin folder) and adapt the file 
./inc/WbxmlHelper.php
from:
/usr/bin/
/usr/local/bin/
to:
/usr/share/webapps/bin/

Original comment by aschr...@gmail.com on 7 Aug 2010 at 6:19

GoogleCodeExporter commented 9 years ago
I was having this same issue as well, also on an E51. The decoded XML looked 
like this:

<SyncML 
xmlns="syncml:syncml1.2"><SyncHdr><VerDTD>1.2</VerDTD><VerProto>SyncML/1.2</VerP
roto><SessionID>21</SessionID><MsgID>3</MsgID><Target><LocURI>http://www.stdin.n
l/mooha/index.php</LocURI></Target><Source><LocURI>IMEI:357663012691055</LocURI>
</Source><Meta><MaxMsgSize 
xmlns="syncml:metinf1.2">65535</MaxMsgSize></Meta></SyncHdr><SyncBody><Status><C
mdID>1</CmdID><MsgRef>2</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd><TargetRef>I
MEI:357663012691055</TargetRef><SourceRef>http://www.stdin.nl/mooha/index.php</S
ourceRef><Data>200</Data></Status><Status><CmdID>2</CmdID><MsgRef>2</MsgRef><Cmd
Ref>3</CmdRef><Cmd>Sync</Cmd><TargetRef>./C:Contacts.cdb</TargetRef><SourceRef>c
ontacts</SourceRef><Data>200</Data></Status><Status><CmdID>3</CmdID><MsgRef>2</M
sgRef><CmdRef>4</CmdRef><Cmd>Replace</Cmd><TargetRef>35</TargetRef><Data>415</Da
ta><Item><Data><![CDATA[</Data></Item></Status><Status><CmdID>4</CmdID><MsgRef>2
</MsgRef><CmdRef>5</CmdRef><Cmd>Add</Cmd><SourceRef>1</SourceRef><Data>415]]></D
ata><Item><Data></Data></Item></Status><Final></Final></SyncBody></SyncML>

Note the CDATA section that doesn't contain the proper CDATA.

Switching over to external wbxml tools fixed this problem for me (though I had 
to bump the WBXML_VERSION to 1.2 to get it to work with SyncEvolution). When I 
switched back to the internal WBXML decoder, the problem didn't occur anymore 
(not sure why), so I don't have the encoded WBXML for comparison...

Original comment by matthijskooijman@gmail.com on 31 Aug 2010 at 12:19