I have the following code...
<?php
include("lib/xmlrpc.inc");
$email='[email protected]';
$c=new xmlrpc_client("/register/index.php", "ws.myserver.com", 80);
$f=new xmlrpcmsg('existsEmail', array(new xmlrpcval($email, "base64")));
print "<pre>" . htmlentities($f->serialize( )) . "</pre>";
$r=$c->send($f);
$v=$r->value( );
if (!$r->faultCode( )) {
print "Email is". $email . " is " .
$v->scalarval( ) . "<br />";
print "<hr />I got this value back<br /><pre>" .
htmlentities($r->serialize( )). "</pre><hr />\n";
} else {
print "Fault: ";
print "Code: " . $r->faultCode( ) .
" Reason '" .$r->faultString( )."'<br />";
}
?>
I need to consume the WebService located at http://ws.myserver.com/register/index.php.
I pass the email as a parameter and then the XMLRPC.inc library will encode it using base64.
I've got a good XML request shown below:
<?xml version="1.0"?>
<methodCall>
<methodName>existsEmail</methodName>
<params>
<param>
<value><base64>dnJvZHJpZ3VlekBpY2NrLm5ldC5jbw==</base64></value>
</param>
</params>
</methodCall>
BUUUT, when I tried to get a response from the server I've to the following error
Fault: Code: -32601 Reason 'server error. requested method not found'
Any ideas? I'm getting crazy about how to call the existsEmail method from my PHP code...I'm sure it is there but I don't know if I'm missing something..