xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Stocks <amillionhitpoi...@yahoo.com>
Subject RE: PHP Xindice Classes and Xindice 1.1b1?
Date Mon, 17 Nov 2003 09:51:46 GMT
I would LOVE a working PHP Xindice class.  Even though it's not too difficult to put one together,
I would much rather put my attention towards my core project.  If you get something working
please post it.  I would really appreciate it.
 
 Thanks, Don

Jill Rhoads <jill@rhoads.nu> wrote:
You'll have to excuse me for not being able to directly follow your
thread, but I just joined the mailing list.

It seems that the XMLRPC calls have changed significantly between
versions. Not to mention PHP has just baked a XMLRPC implementation into
the latest version. As a result, I have yet to find a working PHP
implementation of a Xindice class; however, it's not too difficult to
create your own (or wait about 4 days until I finish mine) using the new
libraries.

My question is if the xindice project is interested in a php class
library? I was planning on make a browser with PHP. If the project wants
it, I'm willing to post it along with a tutorial.

/Jill

Here's some of my proof-of-concept (really fugly) sample code:


$host = "localhost";
$url = "/xindice";
$params = array ( "collection"=>"/db","message"=>"ListCollections");

$response = xmlrpc_encode_request("run", $params);

$header = "POST " .$url . " HTTP/1.0\n";
$header .= "User-Agent: simple\n";
$header .= "Host: " . $host . "\n";
if ($this->username != "") {
$header .= "Authorization: Basic " . base64_encode($username . ":" .
$password) . "\n";
}
$header .= "Content-Type: text/xml\n";
$header .= "Content-Length: " . strlen($response) . "\n\n";

$whole = $header.$response;

echo ($whole);

$fp = fsockopen($host, 8888, $errno, $errstr, 0);

if (!$fp) {
echo ("Fsocks error: $errno, $errstr");
die();
} else {
fputs($fp, $whole, strlen($whole));

while (!feof($fp)) {
$received .=fgets ($fp,128);
}

fclose($fp);
}

echo $received;

$xml=(substr($received, strpos($received, "\r\n\r\n")+4));
echo $xml;


//$phpvars = xmlrpc_decode_request($xml, $method);

$phpvars = xmlrpc_decode($xml);

//echo $method;
echo ($phpvars."\n");

foreach ($phpvars as $key => $value){
echo $key."=>".$value."\n";
foreach ($value as $key2 => $value2){
echo $key2."=>".$value2."\n";
}
}



?>


-------------------------------
I have been trying to get the PHP Xidice class from \
http://phpxmlclasses.sourceforge.net/ to work with Xindice 1.1b1. I can
make a \
connection to the server no problem. But when I make an XML-RPC call I
always get \
back the following 404 error message (see message below). No matter what
method I \
call I always get the same 404 error. Even when I try to create a
collection or list \
collections.
I have a feeling that this has something to do with the change in the
XML-RPC syntax \
between Xindice 1.0 and v. 1.1b1. But that's just my guess.
Are there any suggestions for getting this class working with 1.1b1? Or
better yet, \
is there a resource out there for a PHP Class that works with 1.1b1. Or
maybe I'm \
just doing something wrong. After all, I'm a rookie at this!
Any help would be appreciated. I would really like to work with Xindice
using PHP.

Thanks, Don

Here's the message I'm getting:

---GOT---
HTTP/1.1 404 %2F+Not+Found
Date: Tue, 11 Nov 2003 06:29:18 GMT
Server: Jetty/4.2.8 (Windows 2000/5.0 x86 java/1.4.1_05)
Content-Type: text/html
Content-Length: 1104




HTTP ERROR: 404 / Not Found
RequestURI=/




---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
Mime
View raw message