php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38494 xmlrpc_encode_request generates invalid xmlrpc request
Submitted: 2006-08-18 10:12 UTC Modified: 2006-12-12 10:01 UTC
From: giunta dot gaetano at sea-aeroportimilano dot it Assigned:
Status: Not a bug Package: XMLRPC-EPI related
PHP Version: 4.4.4 OS: windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: giunta dot gaetano at sea-aeroportimilano dot it
New email:
PHP Version: OS:

 

 [2006-08-18 10:12 UTC] 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>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-12 10:01 UTC] mike@php.net
This is rather an odd feature of libxmlrpc. Use:

xmlrpc_encode_request('hello', array(array("faultCode"=>...,"faultString"=>...)));

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC