[OGo-Users] xmlrpc_call troubles
Friedrich Dominicus
users@opengroupware.org
Sat, 20 Oct 2007 10:16:40 +0200
Well I followed:=20
http://www.opengroupware.org/en/devs/resources/xmlrpc/xmlrpc_call.html
Result:
xmlrpc_call http://localhost:20000/RPC2=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20
<<0x0x6e52f8[HandleCredentialsClient]>>D Note: got HTML response: <0x0x72c3=
88[WOResponse]: status=3D200 headers=3D{
"content-length" =3D 5029;
"content-type" =3D "text/html; charset=3Diso-8859-1";
} content-size=3D5029>
Exception caught
Name : XmlRpcCallFailed
Reason: got HTML response
Seems to be a problem somehow.=20
Also tried the tips in the xml-rpc-de.pdf for Python:
e.g page 30
server =3D Server(url, login=3D. password...")=20
does not work according to the python docs something along thies lines
should do the job:
import xmlrpclib
>>> server =3D xmlrpclib.Server("http://user:password@localhost:2000/x/xmlr=
pc")
>>> server
Indeed I get ServerProxy
but than I can not call the function as suggested
server.account.getByLogin("Friedrich")
connect: (localhost, 20000)
send: 'POST /x/xmlrpc HTTP/1.0\r\nHost: localhost:20000\r\nAuthorization: B=
asic RnJpZWRyaWNoOjEyM0lu\r\nUser-Agent: xmlrpclib.py/1.0.1 (by www.pythonw=
are.com)\r\nContent-Type: text/xml\r\nContent-Length: 171\r\n\r\n'
send: "<?xml version=3D'1.0'?>\n<methodCall>\n<methodName>account.getByLogi=
n</methodName>\n<params>\n<param>\n<value><string>Friedrich</string></value=
>\n</param>\n</params>\n</methodCall>\n"
reply: 'HTTP/1.0 200 Ok\r\n'
header: content-type: text/html; charset=3Diso-8859-1
header: content-length: 5035
body: '<html>\n <head>\n <title>OpenGroupware.org</title>\n <link ty=
pe=3D"text/css" rel=3D"stylesheet" href=3D"/OpenGroupware11.woa/WebServerRe=
sources/English.lproj/OGo.css" />\n </head>\n\n <body id=3D"LoginPageBody=
">\n <table id=3D"mainheader" \n\t cellpadding=3D"0" cellspacing=3D"0"=
border=3D"0" width=3D"98%">\n <tr>\n <td align=3D"left" valign=
=3D"bottom" width=3D"50%" class=3D"headline">\n <nobr>\n =
<a href=3D"http://www.opengroupware.org/en/about/" \n\t target=3D"O=
Go">About</a> |\n <a href=3D"http://www.opengroupware.org/en/p=
rojects/documentation/"\n target=3D"OGo">Docs</a> |\n\t <a=
href=3D"http://www.opengroupware.org/en/users/faq/index.html"\n\t ta=
rget=3D"OGo">FAQ</a> |\n\t <a href=3D"http://www.opengroupware.org/e=
n/license/"\n\t target=3D"OGo">License</a> |\n\t <a href=3D"http:/=
/www.opengroupware.org/en/users/support/"\n\t target=3D"OGo">Support<=
/a> |\n <a href=3D"http://www.opengroupware.org/en/devs/bugs/"\n=
\t target=3D"OGo">Report Bugs!</a>\n </nobr>\n '
body: ' </td>\n <td align=3D"right"><a href=3D"http://www.opengro=
upware.org/" target=3D"OGo"\n ><img src=3D"/OpenGroupware11.woa/W=
ebServerResources/English.lproj/menu_logo_top.gif" align=3D"center" border=
=3D"0" valign=3D"middle" /></a></td>\n </tr>\n </table>\n <table=
cellpadding=3D"0" cellspacing=3D"0" id=3D"headerline" width=3D"98%">\n =
<tr>\n <td class=3D"linecolor"><img src=3D"/OpenGroupware11.woa/We=
bServerResources/English.lproj/line_left.gif" /></td>\n <td class=3D=
"linecolor" width=3D"100%"><img src=3D"/OpenGroupware11.woa/WebServerResour=
ces/English.lproj/line_stretch.gif" /></td>\n <td class=3D"linecolor=
"><img src=3D"/OpenGroupware11.woa/WebServerResources/English.lproj/line_ri=
ght.gif" /></td>\n </tr>\n </table>\n <div id=3D"resistance">res=
istance is obsolete ™ ;-) </div>\n\n\n<p align> </p>\n<p align=
=3D"center">\n <table border=3D"0" cellpadding=3D"0" cellspacing=3D"0">\n =
<tr>\n <td valign=3D"middle" align=3D"center">\n \n \n\n \n=
\n <table border=3D"0">\n <tr>\n '
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
verbose=3Dself.__verbose
File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.4/xmlrpclib.py", line 1281, in _parse_response
p.feed(response)
File "/usr/lib/python2.4/xmlrpclib.py", line 527, in feed
self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: undefined entity: line 38, column 48
Is that a bug? A misconfiguration or something else?
Regards
Friedrich