By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

XML_RPC_Response fatal error: Call to undefined method kindof

P: n/a
I am new to php5 programming :)

I redirect users to another server to login. After they login
successfully, they will be redirected to test.php. The server provides
xml_rpc interface so I can communicate with it. After running my
scripts, I get this error:

Fatal error: Call to undefined method XML_RPC_Response::kindOf() in /
usr/share/PEAR/XML/RPC.php on line 1972

It seems it is these two lines that cause problems:

I do get some response from the server, though.

The followings are my scripts:

test.php

<?php

error_reporting(E_ALL);
ini_set('display_errors', true);

include("cwl.php");

$test=new cwl();

$test->test();

?>
cwl.php

<?php

require 'XML/RPC.php';
error_reporting(E_ALL);
ini_set('display_errors', true);

class cwl{

private $cwlURL;
private $xmlrpcPath;
private $appID;
private $appIDPassword;
private $cwlClient;
private $sessionTicket;
private $params;
function __construct()
{
$this->appID='xxx';
$this->appIDPassword='xxx';
$this->xmlrpcPath='/path';
$this->cwlURL='someurl;
$this->sessionTicket=$_GET['ticket'];
$this->params=array( new XML_RPC_Value($this->sessionTicket,
'string'));
$this->cwlClient=$this->getCWLClient();
}

private function getCWLClient()
{
$client=new XML_RPC_Client($this->xmlrpcPath, $this->cwlURL);
$client->setCredentials ($this->appID, $this->appIDPassword);
$client->setDebug(1);
return $client;
}

protected function makeCall($functionName)
{
$functionName='session.'.$functionName;

try
{
$msg = new XML_RPC_Message($functionName, $this->params);
$resp= new XML_RPC_Response(new XML_RPC_Value());
$resp= $this->cwlClient->send($msg);
return $resp;
}
catch (Exception $e)
{
$e->__toString();
}
}
public function test()
{
$val =new XML_RPC_Value();
$val = $this->makeCall('getIdentities');
//***************************
//It seems it the line below causes the problem

$data = XML_RPC_decode($val);
echo "<br>";

if (isset($data['student_number']))
echo $data['student_number']."<br>";
else echo "Not a student<br>";

if (isset($data['employee_number']))
echo $data['employee_number']."<br>";
else echo "Not an employee<br>";

}
}

?>

Any advice? Thanks,

May 16 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
A quick follow-up:

Never mine. I got it fixed.

May 16 '07 #2

P: n/a
On May 16, 1:02 pm, Ming <minghu...@gmail.comwrote:
I am new to php5 programming :)

I redirect users to another server to login. After they login
successfully, they will be redirected to test.php. The server provides
xml_rpc interface so I can communicate with it. After running my
scripts, I get this error:

Fatal error: Call to undefined method XML_RPC_Response::kindOf() in /
usr/share/PEAR/XML/RPC.php on line 1972

It seems it is these two lines that cause problems:

I do get some response from the server, though.

The followings are my scripts:

test.php

<?php

error_reporting(E_ALL);
ini_set('display_errors', true);

include("cwl.php");

$test=new cwl();

$test->test();

?>

cwl.php

<?php

require 'XML/RPC.php';
error_reporting(E_ALL);
ini_set('display_errors', true);

class cwl{

private $cwlURL;
private $xmlrpcPath;
private $appID;
private $appIDPassword;
private $cwlClient;
private $sessionTicket;
private $params;

function __construct()
{
$this->appID='xxx';
$this->appIDPassword='xxx';
$this->xmlrpcPath='/path';
$this->cwlURL='someurl;
$this->sessionTicket=$_GET['ticket'];
$this->params=array( new XML_RPC_Value($this->sessionTicket,
'string'));
$this->cwlClient=$this->getCWLClient();
}

private function getCWLClient()
{
$client=new XML_RPC_Client($this->xmlrpcPath, $this->cwlURL);
$client->setCredentials ($this->appID, $this->appIDPassword);
$client->setDebug(1);
return $client;
}

protected function makeCall($functionName)
{
$functionName='session.'.$functionName;

try
{
$msg = new XML_RPC_Message($functionName, $this->params);
$resp= new XML_RPC_Response(new XML_RPC_Value());
$resp= $this->cwlClient->send($msg);
return $resp;

}
catch (Exception $e)
{
$e->__toString();
}
}

public function test()
{
$val =new XML_RPC_Value();
$val = $this->makeCall('getIdentities');

//***************************
//It seems it the line below causes the problem

$data = XML_RPC_decode($val);
cwl::makeCall() is probably not returning an XML_RPC_Value object.
Refer to XML_RPC_Client::send() in XML/RPC.php to make sure it returns
an XML_RPC_Value object.

-Mike PII

May 16 '07 #3

P: n/a
On May 16, 4:04 pm, Mike P2 <sumguyovrt...@gmail.comwrote:
On May 16, 1:02 pm, Ming <minghu...@gmail.comwrote:
I am new to php5 programming :)
I redirect users to another server to login. After they login
successfully, they will be redirected to test.php. The server provides
xml_rpc interface so I can communicate with it. After running my
scripts, I get this error:
Fatal error: Call to undefined method XML_RPC_Response::kindOf() in /
usr/share/PEAR/XML/RPC.php on line 1972
It seems it is these two lines that cause problems:
I do get some response from the server, though.
The followings are my scripts:
test.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
include("cwl.php");
$test=new cwl();
$test->test();
?>
cwl.php
<?php
require 'XML/RPC.php';
error_reporting(E_ALL);
ini_set('display_errors', true);
class cwl{
private $cwlURL;
private $xmlrpcPath;
private $appID;
private $appIDPassword;
private $cwlClient;
private $sessionTicket;
private $params;
function __construct()
{
$this->appID='xxx';
$this->appIDPassword='xxx';
$this->xmlrpcPath='/path';
$this->cwlURL='someurl;
$this->sessionTicket=$_GET['ticket'];
$this->params=array( new XML_RPC_Value($this->sessionTicket,
'string'));
$this->cwlClient=$this->getCWLClient();
}
private function getCWLClient()
{
$client=new XML_RPC_Client($this->xmlrpcPath, $this->cwlURL);
$client->setCredentials ($this->appID, $this->appIDPassword);
$client->setDebug(1);
return $client;
}
protected function makeCall($functionName)
{
$functionName='session.'.$functionName;
try
{
$msg = new XML_RPC_Message($functionName, $this->params);
$resp= new XML_RPC_Response(new XML_RPC_Value());
$resp= $this->cwlClient->send($msg);
return $resp;
}
catch (Exception $e)
{
$e->__toString();
}
}
public function test()
{
$val =new XML_RPC_Value();
$val = $this->makeCall('getIdentities');
//***************************
//It seems it the line below causes the problem
$data = XML_RPC_decode($val);

cwl::makeCall() is probably not returning an XML_RPC_Value object.
Refer to XML_RPC_Client::send() in XML/RPC.php to make sure it returns
an XML_RPC_Value object.

-Mike PII
Sorry, my post was delayed. Didn't see your follow-up until after it
went through.

-Mike PII

May 17 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.