filoquin / json-xml-rpc

Automatically exported from code.google.com/p/json-xml-rpc
0 stars 0 forks source link

xml-rpc methodresponse with one boolean value error #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. use json-xml-rpc to call a method that has one boolean value returned 
in the response document.
2. The method returns false
3. If the above steps are true, you receive the exception: "Malformed XML-
RPC methodResponse document."

What is the expected output? What do you see instead?
I would expect the response to be accepted.  Instead the following code 
fails to properly interpret a case where response.result == false.

     if(!response.result && !response.error)
       throw Error("Malformed XML-RPC methodResponse document.");

What version of the product are you using? On what operating system?
0.8.0.2 released 2007-12-06.

Please provide any additional information below.

the !response.result will be true if response.result were not defined
(which is the intended purpose of the statement), but also when a valid 
response was returned that is the value of false.  Therefore the condition 
is errantly passed and the exception is thrown.

Original issue reported on code.google.com by arcanasu...@gmail.com on 11 Jul 2009 at 12:46

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I had success after changing the line (945) to:

    if (!"result" in response && !"error" in response)

Original comment by andrew.b...@gmail.com on 6 Dec 2010 at 8:22