ZF-1364: Zend_XmlRpc_Client forces faultCode and faultString on response
Description
The faultCode/faultString in the response should be optional and not considered mandatory.
For example from Java a standard exception has no code what so ever, hence, the field faultCode in the response is empty, which leads to a Zend_XmlRpc_Client_Exception.
Comments
Posted by Bill Karwin (bkarwin) on 2007-05-12T12:23:03.000+0000
Assigning to Matthew.
Posted by Till Klampaeckel (till) on 2007-05-12T13:00:00.000+0000
Just to give feedback, if this is mandatory indeed (I found and read the www.xmlrpc.com/spec" rel="nofollow">spec in the meantime and it's not so clear on this) this may be a week implementation in the Java-based XML-RPC service I have to query. What would be your advice then?
Posted by Matthew Weier O'Phinney (matthew) on 2007-05-17T11:03:19.000+0000
Can you give an example fault response payload that triggers the exception? Zend_XmlRpc_Fault::loadXml() only throws exceptions for the following conditions:
In the case of a missing code, it simply sets it to '404', and uses the message provided. My inclination is that the response you're getting back is so far different from a typical XML-RPC response as to be unrecognizable.
Posted by Till Klampaeckel (till) on 2007-05-23T06:51:35.000+0000
Apologies for the delay - this is what I get when I dump:
Response:
Exception: Fault code and string required
Posted by Matthew Weier O'Phinney (matthew) on 2007-05-23T07:55:00.000+0000
The problem is with the XML, in particular, the faultString value; it's missing the tag indicating the value type. Instead of:
it should be reading:
The only way to fix this is to intercept the XML as it arrives and insert the tag (can be done using either regexp, DOM, or SimpleXML).
Posted by Matthew Weier O'Phinney (matthew) on 2007-05-23T07:56:01.000+0000
Fault response returned from third-party server does not conform to XML-RPC spec; not an issue of ZF.
Posted by Till Klampaeckel (till) on 2007-05-29T05:52:44.000+0000
The XML-RPC spec states that if no type supplied, "string" is assumed. So this fault is not so far away from the standard. ;-)
http://www.xmlrpc.com/spec https://issues.apache.org/jira/browse/…
Posted by Matthew Weier O'Phinney (matthew) on 2007-06-13T09:21:09.000+0000
Zend_XmlRpc_Value is correctly defaulting to using strings if no type is provided; however, Zend_XmlRpc_Fault is not using Zend_XmlRpc_Value to pull the fault struct.
Posted by Matthew Weier O'Phinney (matthew) on 2007-06-13T09:21:30.000+0000
Resolved in r5279.
Posted by Till Klampaeckel (till) on 2007-06-13T11:24:09.000+0000
Thanks!