Parsing problems in XMLRPC module (and in the xml parser)
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=4631
Reported by Manifest0 , demanuel@gmail.com
The xmlrpc can't process the opensubtitles xml response.
Steps to reproduce:
Protocols.XMLRPC.Client cliente = Protocols.XMLRPC.Client("http://
www.opensubtitles.org/xml-rpc");
string auth_token = cliente["LogIn"]("","","en","python")[0]["token"];
array(mapping(string:string)) map =({});
mapping(string:string) params = ([]);
params["sublanguageid"]="eng";
params["moviehash"]="8c7419a68bd85bd8";
params["moviebytesize"]="733700096";
map+=({params});
cliente["SearchSubtitles"](auth_token,map);
Error: Bad arguments. Unknown program: `*(0,"")
Other info: 1- It seems that the bug is both in the xml parser and in the xmlrpc module 2- You can see the xml response by using the following code:
Protocols.XMLRPC.Client cliente = Protocols.XMLRPC.Client("http://
www.opensubtitles.org/xml-rpc");
string auth_token = cliente["LogIn"]("","","en","python")[0]["token"];
array(mapping(string:string)) map =({});
mapping(string:string) params = ([]);
params["sublanguageid"]="eng";
params["moviehash"]="8c7419a68bd85bd8";
params["moviebytesize"]="733700096";
map+=({params});
object c=Protocols.HTTP.do_method("POST", cliente->url, 0,
(["Content-Type":"text/xml"]), 0,
Protocols.XMLRPC.encode_call("SearchSubtitles", ({ auth_token, map })));
string result=c->data();
write(result);
I hope o didn't forget anything. Best regards!