R: [phpxmlrpc] Arguments not passed through

Gaetano Giunta giunta.gaetano at sea-aeroportimilano.it
Tue Feb 1 14:04:33 GMT 2005


weird indeed: I tried this:

> $f=new xmlrpcmsg('auth', array(
>     new xmlrpcval("someUsername"),
>     new xmlrpcval("somePassword")));
> print "out = " . $f->serialize();

 and got 

"out = <?xml version="1.0"?>
<methodCall>
<methodName>auth</methodName>
<params>
<param>
<value>someUsername</value>
</param>
<param>
<value>somePassword</value>
</param>
</params>
</methodCall>"

in the browser.

(of course, looking at the 'source view' of the page genrated by php. the xml showed up as "out = auth someUsername somePassword ")

What version of PHP are you running?

Are you using the 1.0.99.2 version or the files from CVS?

By the way, are you testing the exact code you sent?
I ask because it looks like the decoding of the response from the xmlrpc server works ok, and it is starnge that decoding works but encoding does not, so I suspect the error could be in the username and password values not being set before creation of the xmlrpcmsg object.

An option is to use the php xmlrpc server, with its debugging option turned on: it will send back to the clients the complete request it received...

> -----Messaggio originale-----
> Da: phpxmlrpc-bounces at lists.usefulinc.com
> [mailto:phpxmlrpc-bounces at lists.usefulinc.com]Per conto di 
> Niklas Saers
> Inviato: martedì 1 febbraio 2005 14:46
> A: phpxmlrpc at usefulinc.com
> Oggetto: [phpxmlrpc] Arguments not passed through
> 
> 
> Dear sirs,
> I'm trying to do XMLRPC/SSL via PHP and I'm using your library that I 
> found on sourceforge. But apparently no variables are sent with the 
> request, or they are emptied. Can anyone tell me why they are sent as 
> empty strings? I'm using the latest published version of the 
> libraries. 
> Here is my code:
> 
> $f=new xmlrpcmsg('auth', array(
>     new xmlrpcval("someUsername"),
>     new xmlrpcval("somePassword")));
> print "out = " . $f->serialize();
> 
> // This outputs only
> //                                   out = auth   $c=new 
> xmlrpc_client("/", $server, 1443);
> $c->setSSLVerifyPeer(0);   $c->setDebug(1);
> $r=$c->send($f,20,"https");
> 
> This outputs:
> 
> out = auth   ---GOT---
> HTTP/1.0 200 OK
> Server: BaseHTTP/0.2 Python/2.2.2
> Date: Tue, 01 Feb 2005 11:37:49 GMT
> Content-type: text/xml
> Content-length: 158
> 
> <?xml version='1.0'?>
> <methodResponse>
> <params>
> <param>
> <value><string>ERROR, invalid username/password</string></value>
> </param>
> </params>
> </methodResponse>
> 
> ---END---
> 
> HEADER: HTTP/1.0 200 OK
> HEADER: Server: BaseHTTP/0.2 Python/2.2.2
> HEADER: Date: Tue, 01 Feb 2005 11:37:49 GMT
> HEADER: Content-type: text/xml
> HEADER: Content-length: 158
> 
> ---EVALING---[53 chars]---
> new xmlrpcval("ERROR, invalid username/password", '');
> ---END---
> 
> And the debug messages from my server is:
> 
> username =  and password =
> 
> The same stuff works excelent with both Python and Java. But 
> now I need 
> to do this with PHP. Any ideas?
> 
> Cheers
> 
>   Nik
> 
> _______________________________________________
> phpxmlrpc mailing list
> phpxmlrpc at lists.usefulinc.com
> http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc



More information about the phpxmlrpc mailing list