- XMLRPC showing -32601 error (using PHP)
- <?php
- include("lib/xmlrpc.inc");
- $email='whatever@hotmail.com';
- $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 />";
- }
- ?>
- <?xml version="1.0"?>
- <methodCall>
- <methodName>existsEmail</methodName>
- <params>
- <param>
- <value><base64>dnJvZHJpZ3VlekBpY2NrLm5ldC5jbw==</base64></value>
- </param>
- </params>
- </methodCall>
- -32601 ---> server error. requested method not found
- $path = 'http://xmlrpc-c.sourceforge.net/api/sample.php';
- printf("n XMLRPC Service Discoverynn for: '%s'nn", $path);
- $discovery = new Discovery($path);
- $methods = $discovery->getMethods();
- printf(" Method Summary:n ===============n", count($methods));
- foreach ($methods as $i => $method)
- {
- printf(" %'.-2d %sn", $i + 1, $method->getName());
- }
- printf("n Method Details (%d):n ===================n", count($methods));
- foreach ($methods as $i => $method)
- {
- printf(" %'.-2d %sn", $i + 1, $method->getName());
- printf("n %sn", $method);
- printf("n%snn", preg_replace('/^/um', ' ', wordwrap($method->getHelp(), 46)));
- }
- XMLRPC Service Discovery
- for: 'http://xmlrpc-c.sourceforge.net/api/sample.php'
- Method Summary:
- ===============
- 1. debug.authInfo
- 2. sample.add
- 3. sample.sumAndDifference
- 4. system.listMethods
- 5. system.methodHelp
- 6. system.methodSignature
- Method Details (6):
- ===================
- 1. debug.authInfo
- <struct> debug.authInfo
- Report any HTTP authentication in use
- 2. sample.add
- <int> sample.add (<int>, <int>)
- Add two numbers
- 3. sample.sumAndDifference
- <struct> sample.sumAndDifference (<int>, <int>)
- Add and subtract two numbers
- 4. system.listMethods
- <array> system.listMethods (<string>)
- This method lists all the methods that the
- XML-RPC server knows how to dispatch
- 5. system.methodHelp
- <string> system.methodHelp (<string>)
- Returns help text if defined for the method
- passed, otherwise returns an empty string
- 6. system.methodSignature
- <array> system.methodSignature (<string>)
- Returns an array of known signatures (an array
- of arrays) for the method name passed. If no
- signatures are known, returns a none-array
- (test for type != array to detect missing
- signature)