LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 02-20-2006, 11:14 AM   #1
Jim44
Member
 
Registered: Feb 2006
Location: Atlanta, Georgia, USA
Distribution: Mint, Ubuntu, Centos
Posts: 52

Rep: Reputation: 15
Question PHP xmlrpc problem.


I'm venturing into php, specifically xmlrpc and wrote what I thought was going to be the simplest client possible, but what it is telling me makes no sense.
Here's the code.

Quote:
<?php
include ('XML/RPC.php');


$client = new XML_RPC_CLIENT("/RPC2","localhost",8181);
$client->setDebug(1);
$str = new XML_RPC_Value("Test String ", "string");
$msg = new XML_RPC_Message("local.echo",array($str));
$response = $client->send($msg);
if (!$response->faultCode()) {
$value = $response->value();
echo $value;
} else {
print "Error code: " . $response->faultCode() . " Message: " . $response->faultString() . "\n";
}

?>
And here is the error output. "missing top level xmlrpc element"??? Sure looks like <methodResponse> to me.


Any ideas?


Quote:
---GOT---
HTTP/1.1 200 OK
Date: Sun, 19 Feb 2006 11:24:44 GMT
Server: libwww-perl-daemon/1.36
Content-Length: 130
Content-Type: text/xml

<?xml version="1.0"?>
<methodResponse>
<params>
<param><value><string>Echo: </string></value></param>
</params>
</methodResponse>

---END---

---PARSED---
NULL
---END---

Error code: 2 Message: Invalid return payload: enabling debugging to examine incoming payload missing top level xmlrpc element
This fails on two different systems, so I'm sure it's something I'm doing wrong.
The server works fine with a perl client, so I kind of think it's in this code somewhere.

Thanks,
Jim.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/MYSQL problem. Rename of table-name solves the problem... mosedrengen Linux - Software 3 01-06-2006 07:07 AM
New to PHP and Postgressql. Is this a PHP problem or a sql problem. Please help sendas4 Linux - General 2 11-05-2004 01:54 PM
RH9: PHP session problem (or Apache problem) fengcn Red Hat 0 12-01-2003 06:32 PM
Apache php index.php problem neurotic Linux - Software 3 11-18-2003 06:02 PM
xmlrpc.rhn.redhat:https ESTABLISHED micxz Linux - General 3 03-04-2003 01:48 PM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration