Welcome Guest, Not a member yet? Register   Sign In
Xmlrpc error
#1

Message:The XML data received was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.


Controller : $this->xmlrpc->set_debug(TRUE);

<p>Severity: Runtime Notice</p>
<p>Message: Resource ID#32 used as offset, casting to integer (32)</p>
<p>Filename: libraries/Xmlrpcs.php</p>
<p>Line Number: 237</p>
Reply
#2

Something is going wrong server-side, and you are getting a PHP error there, not an XML-RPC error.
Please post your RPC server/controller code ... I suspect a configuration problem.
Reply
#3

(03-14-2015, 11:47 AM)ciadmin Wrote: Something is going wrong server-side, and you are getting a PHP error there, not an XML-RPC error.
Please post your RPC server/controller code ... I suspect a configuration problem.


Code:
<?php

class Xmlrpc_server extends CI_Controller
{

    public function index()
    {
        $this->load->library('xmlrpc');
        $this->load->library('xmlrpcs');

        $config['functions']['Greetings'] = array('function' => 'Xmlrpc_server.process');

        $this->xmlrpcs->initialize($config);
        $this->xmlrpcs->serve();
    }

    public function process($request)
    {
        $parameters = $request->output_parameters();

        $response = array(
            array(
                'you_said'  => $parameters[0],
                'i_respond' => 'Not bad at all.'
            ),
            'struct'
        );

        return $this->xmlrpc->send_response($response);
    }
}
?>
Reply
#4

The only thing I different between your usage and mine ... in my xmlrpcs configuration, I have one additional line...

$config['object'] = $this;

I can't see that omission causing your issue. It looks like the xmlrpcs is blowing up trying to parse your first (& only) parameter ... could you post the fragment from your XML-RPC client that calls this? Thanks
Reply
#5

(03-14-2015, 01:09 PM)ciadmin Wrote: The only thing I different between your usage and mine ... in my xmlrpcs configuration, I have one additional line...

$config['object'] = $this;

I can't see that omission causing your issue. It looks like the xmlrpcs is blowing up trying to parse your first (& only) parameter ... could you post the fragment from your XML-RPC client that calls this? Thanks

All code from the user manual, CI version : 3.0rc3
PHP Code:
<?php

class Xmlrpc_client extends CI_Controller
{

 public function 
index()
 {
 
$this->load->helper('url');
 
$server_url site_url('xmlrpc_server');

 
$this->load->library('xmlrpc');

 
$this->xmlrpc->server($server_url80);
 
$this->xmlrpc->method('Greetings');

 
$request = array('How is it going?');
 
$this->xmlrpc->request($request);

 if ( ! 
$this->xmlrpc->send_request())
 {
 echo 
$this->xmlrpc->display_error();
 }
 else
 {
 echo 
'<pre>';
 
print_r($this->xmlrpc->display_response());
 echo 
'</pre>';
 }
 }
}
?>
Reply
#6

(This post was last modified: 03-26-2015, 03:42 PM by sandman.)

(03-14-2015, 10:09 AM)pcjingl Wrote: <p>Message:  Resource ID#32 used as offset, casting to integer (32)</p>
<p>Filename: libraries/Xmlrpcs.php</p>
<p>Line Number: 237</p>
I think Xmlrpcs.php#237 need a patch like Xmlrpc.php#1135 (using $pname = (string) $parser; and then xh[$pname] for each reference).

Still I'm having some trouble then, is Xmlrpcs still supported and expected to work?

The POST incoming $data passed to xml_parse seems to be urlencoded, and give me a "Not well-formed (invalid token) at line 1" error, but if I insert a urldecode before parsing my <?xml version="1.0" ?> become <?xml_version="1.0" ?> (underscore added??) and the error become "Space required at line 1"

Any suggestion?

update

I was using CI-3.0rc3, using 2.1.0 work as expected.

update

The resource ID problem has been fixed on 3.0-dev, still there's a problem with this commit, http_build_query return urlencoded data.

https://github.com/bcit-ci/CodeIgniter/issues/3703

update

Xmlrpcs should be working now on 3.0-dev
https://github.com/bcit-ci/CodeIgniter/c...0f7f6ac766
Reply
#7

I found that I had to make one change to the systems/libraries/Xmlrpc.php file

After line 1161  ==> ($data = implode("\r\n",$lines);
inserting


Code:
$data = trim($data);


finally got the code working for me.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB