#38494 [Opn->Bgs]: xmlrpc_encode_request generates invalid xmlrpc request

From: Date: Tue, 12 Dec 2006 10:01:06 +0000
Subject: #38494 [Opn->Bgs]: xmlrpc_encode_request generates invalid xmlrpc request
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106238@lists.php.net to get a copy of this message
ID: 38494 Updated by: mike@php.net Reported By: giunta dot gaetano at sea-aeroportimilano dot it -Status: Open +Status: Bogus Bug Type: XMLRPC-EPI related Operating System: windows 2000 PHP Version: 4.4.4 New Comment: This is rather an odd feature of libxmlrpc. Use: xmlrpc_encode_request('hello', array(array("faultCode"=>...,"faultString"=>...))); Previous Comments: ------------------------------------------------------------------------ [2006-08-18 10:12:51] giunta dot gaetano at sea-aeroportimilano dot it Description: ------------ If an array containing members 'faultCode' and 'faultString' is passed as second parameter to xmlrpc_encode_request, a weird xml is generated, containing a methocall member and a fault member. Needless to say, it is not a valid xmlrpc request... Reproduce code: --------------- xmlrpc_encode_request('hello', array('faultCode' => 666, 'faultString' => 'hello world')) Expected result: ---------------- <?xml version="1.0" encoding="iso-8859-1"?> <methodCall> <methodName>hello</methodName> <params> <param> <value><struct> <member><name>faultCode</name> <value><int>666</int></value> </member> <member><name>faultString</name> <value><string>hello world</string></value> </member> </struct></value> </param> </params> </methodCall> Actual result: -------------- <?xml version="1.0" encoding="iso-8859-1"?> <methodCall> <methodName>hello</methodName> <fault> <value> <struct> <member> <name>faultCode</name> <value> <int>666</int> </value> </member> <member> <name>faultString</name> <value> <string>hello world</string> </value> </member> </struct> </value> </fault> </methodCall> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38494&edit=1

« previous php.bugs (#106238) next »