ZF-12013: Zend_XmlRpc_Server_Fault doesn't return Content-type text/xml (the default Zend_XmlRpc_Response_Http response)

Issue Type: Bug Created: 2012-01-19T21:42:37.000+0000 Last Updated: 2012-01-19T21:47:25.000+0000 Status: Open Fix version(s): Reporter: Patrick Nijs (patricknijs) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_XmlRpc_Server

Related issues: Attachments:


If the server raises an xmlrpc fault, the response is not a default Zend_XmlRpc_Response_Http response. Thus, the content-type: text/xml headers are not set by default, in contrary to all other successful responses.

See this telnet session where I deliberately generate a faulty response:

patrick@vm:~/www_plugins/zend_framework/Zend/XmlRpc$ telnet 80 Trying X.X.X.37... Connected to Escape character is '^]'. POST /api/v1.0/xmlrpc HTTP/1.1 Host: Connection: keep-alive Content-Type: text/xml Content-Length: 149

getTestData1111111111111111111ZZ HTTP/1.1 200 OK Date: Thu, 19 Jan 2012 21:28:10 GMT Server: Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1 PHP/5.2.6-1+lenny13 with Suhosin-Patch mod\_ssl/2.2.9 OpenSSL/0.9.8g X-Powered-By: PHP/5.2.6-1+lenny13 Content-Length: 283 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html _--> NOT A DEFAULT text/xml response_ faultCode631faultStringFailed to parse request

When I look at Zend/XmlRpc/Server.php I think it has to do with this function:

{quote} /** * Raise an xmlrpc server fault * * @param string|Exception $fault * @param int $code * @return Zend_XmlRpc_Server_Fault */ public function fault($fault = null, $code = 404) { if (!$fault instanceof Exception) { $fault = (string) $fault; if (empty($fault)) { $fault = 'Unknown Error'; } require_once 'Zend/XmlRpc/Server/Exception.php'; $fault = new Zend_XmlRpc_Server_Exception($fault, $code); }

    return Zend_XmlRpc_Server_Fault::getInstance($fault);

{quote} Just like in the protected function _handle I think there has to be checked which response class to use: $responseClass = $this->getResponseClass(); return new $responseClass($return);

Greetings, Patrick


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.