A newbie needs hand holding implementing Newsisfree web services

<[email protected]> Sun, 4 Feb 2007 12:36:39 -0800 (PST)
Newsgroups gmane.comp.php.xml-rpc
Message-ID <[email protected]>
I'm a newbie who doesn't know anything about php coding or xml-rpc, but t=
rying
to implement news syndication on my site using Newsisfree, using XMLRPC-2=
.1.=20
I'm completely lost regarding the "Incorrect parameters passed to method:
Wanted , got  at param" error message I've been getting.

First, some background information:

I want to seach Newsisfree and compile a list of news items relating to t=
he
search word or phrase in xml format, then for my visitors to subscribe to=
 it. =20

Here are some of the specifications from Newisfree:

Configure your XML-RPC client using the information below. All methods on=
 the
server require that you give your user login and password (MD5 encoded) a=
s
strings in the first two parameters.=20
At this time, there are three methods configured on the server (see sampl=
es
below):
hpe.getSource : retrieve the meta data AND list of news items for a given
source. To find an ID for a source, use the source browsing page.=20
hpe.getSourceInfo : retrieve the meta data for a given source.=20
hpe.getSourceItems : retrieve the list of news items for a given source.=20
hpe.getSources : retrieve the list of news items for a several sources.=20
hpe.searchSources : search for sources which contain a string in their na=
me.=20
hpe.createUser : creates a new user.=20

And the code I'm using so far is:

<?php
  include("xmlrpc.inc");

  $c=3Dnew xmlrpc_client("/RPC", "www.newsisfree.com", 80);
  $c->setCredentials("username removed", "password removed");
  $f=3Dnew xmlrpcmsg('hpe.getSource', array('search term removed'));
  $c->setDebug(2);
  $r=3D$c->send($f);
  if (!$r->faultCode()) {
    $v=3D$r->value();
    print "I received:" . htmlspecialchars($v->scalarval()) . "<br/>";
    print "<hr/>I got this value back<br/>pre>" .
      htmlentities($r->serialize()). "</pre>\n";
  } else {
    print "An error occurred: ";
    print "Code: " . htmlspecialchars($r->faultCode()) .
      " Reason: '" . ($r->faultString()) . "'<br/>";
  }
/*** client side ***/
// $c =3D new xmlrpc_client('http://www.newsisfree.com/RPC');

// tell the client to return raw xml as response value
$c->return_type =3D 'xml';

if ($r->faultCode())
  // HTTP transport error
  echo 'Got error '.$r->faultCode();
else
{
  // HTTP request OK, but XML returned from server not parsed yet
  $v =3D xmlrpc_decode($r->value());
  // check if we got a valid xmlrpc response from server
  if ($v =3D=3D=3D NULL)
    echo 'Got invalid response';
  else
  // check if server sent a fault response
  if (xmlrpc_is_fault($v))
    echo 'Got xmlrpc fault '.$v['faultCode'];
  else
    echo'Got response: '.htmlentities($v);
}
 =20
?>
</body>
</html>

Here is what is happening:

---SENDING---
POST /RPC HTTP/1.0
User-Agent: XML-RPC for PHP 2.1
Host: www.newsisfree.com:80
Authorization: Basic removed=20
Accept-Encoding: gzip, deflate
Accept-Charset: UTF-8,ISO-8859-1,US-ASCII
Content-Type: text/xml
Content-Length: 106

<?xml version=3D"1.0"?>
<methodCall>
<methodName>hpe.getSource</methodName>
<params>
</params>
</methodCall>
---END---

---GOT---
HTTP/1.1 200 OK
Date: Sun, 04 Feb 2007 19:42:07 GMT
Server: Apache/1.3.33 (Unix) mod_gzip/1.3.26.1a PHP/4.3.9 mod_ssl/2.8.22
OpenSSL/0.9.7e
X-Powered-By: PHP/4.3.9
Connection: close
Content-Type: text/xml
Content-length: 388

<?xml version=3D"1.0" ?>
<methodResponse>
<fault>
  <value>
    <struct>
      <member>
        <name>faultCode</name>
        <value><int>3</int></value>
      </member>
      <member>
        <name>faultString</name>
        <value><string>Incorrect parameters passed to method: Wanted , go=
t  at
param )</string></value>
      </member>
    </struct>
  </value>
</fault>
</methodResponse>
---END---

HEADER: date: Sun, 04 Feb 2007 19:42:07 GMT
HEADER: server: Apache/1.3.33 (Unix) mod_gzip/1.3.26.1a PHP/4.3.9
mod_ssl/2.8.22 OpenSSL/0.9.7e
HEADER: x-powered-by: PHP/4.3.9
HEADER: connection: close
HEADER: content-type: text/xml
HEADER: content-length: 388

---PARSED---
class xmlrpcval {
  var $me =3D=20
  array (
    'struct' =3D>=20
    array (
      'faultCode' =3D>=20
      class xmlrpcval {
        var $me =3D=20
        array (
          'int' =3D> 3,
        );
        var $mytype =3D 1;
        var $_php_class =3D NULL;
      },
      'faultString' =3D>=20
      class xmlrpcval {
        var $me =3D=20
        array (
          'string' =3D> 'Incorrect parameters passed to method: Wanted , =
got  at
param )',
        );
        var $mytype =3D 1;
        var $_php_class =3D NULL;
      },
    ),
  );
  var $mytype =3D 3;
  var $_php_class =3D NULL;
}
---END---
An error occurred: Code: 3 Reason: 'Incorrect parameters passed to method=
:
Wanted , got at param )'
Got error 3=20

I know this is a lengthy email, but I wanted to answer as much question u=
pfront
as possible.  I hope someone here can help me get this thing implemented.=
=20

Thank you.