1
kikov
XMLRPC
  • 2004/6/7 1:50

  • kikov

  • Just popping in

  • Posts: 13

  • Since: 2003/10/2


Hi!

I'm trying to develop a XMLRPC client for Xoops. Now I'm testing the BloggerApi Interface.

I have studying the code on the xmlrpc.php file and the class/xml/rpc/* files.
In special the *tag.php file and the bloggerapi file.
I don't get any response to the blogger.getUserInfo message.

Please, correct my thoughs:
I think that this is the behaviour of the XmlRPC system of Xoops.
1) First xmlrpc.php file is called.
2) mainfile.php is called in RPC mode ( I think this will prevent from loading headers and so... )
3) parser and tag clases are loaded
4) we choose the xmlrpc API with the first part of "method". My client is using blogger.getUserInfo, so it's blogger.
Quote:

case 'blogger':
include_once XOOPS_ROOT_PATH.'/class/xml/rpc/bloggerapi.php';
$rpc_api = new BloggerApi($parser->getParam(), $response, $module);


As we can see in the code, bloggerapi.php class is loaded, and rpc_api is filled with the class to proccess the thing.

Previously, the $response variable has been initialized with a new XoopsXmlRpcResponse object.

Then, $rpc_api->$method() is called ( $method is extracted from Methods[] array, that should contain getUserInfo... I have seen that is correct, with a dump ).

Then the render is called, and besides headers, the result is printed.

My client make a dump of everything that xmlrpc prints ( xml or plain text, whatever... )

Well.. playing with "echo" I can see how the getUserInfo from bloggerapi.php is called. The xmlRpcStruct is filled, and datas are extracted correctly from Db.

But, render function seems to not be called ( neither RpcDocument, nor RcpResponse ).

And besides that, no "echo" could be seen after the call of $rpc_api->$method().

What's wrong?

Thx for hearing me.

2
kikov
Re: XMLRPC
  • 2004/6/7 2:28

  • kikov

  • Just popping in

  • Posts: 13

  • Since: 2003/10/2


Hi...

I have get it working with the following code in bloggerapi.php
function getUserInfo()
    {
        if (!
$this->_checkUser($this->params[1], $this->params[2])) {
            
$this->response->add(new XoopsXmlRpcFault(104));
        } else {
            
$arr = new XoopsXmlRpcArray();
            
$struct = new XoopsXmlRpcStruct();
            
$struct->add('nickname', new XoopsXmlRpcString($this->user->getVar('uname')));
            
$struct->add('userid', new XoopsXmlRpcString($this->user->getVar('uid')));
            
$struct->add('url', new XoopsXmlRpcString($this->user->getVar('url')));
            
$struct->add('email', new XoopsXmlRpcString($this->user->getVar('email')));
            
$struct->add('lastname', new XoopsXmlRpcString($this->user->getVar('')));
            
$struct->add('firstname', new XoopsXmlRpcString($this->user->getVar('name')));
            
$arr->add($struct);
            
$this->response->add($arr);
        }
    }

So if you think it's correct, and you can verify that it work with another clients in this way... this should be in the CVS ;)

Thx, and CU!

3
kikov
Re: XMLRPC
  • 2004/6/10 17:02

  • kikov

  • Just popping in

  • Posts: 13

  • Since: 2003/10/2


I wanted to know if a Xoop developer plan to submit this to the CVS.
Anyway, I can prepare a patch, but since it's so easy...

Thx
BR


4
Mithrandir
Re: XMLRPC

Sounds good.

I'm not an XMLRPC or blogger expert, so I will have to look further into it - but please (also in the future if you come across similar things) Submit it to the SourceForge Patches Tracker and we'll have a look at it.

Thanks for your support.

Login

Who's Online

243 user(s) are online (159 user(s) are browsing Support Forums)


Members: 0


Guests: 243


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits