[phpxmlrpc] Need help for xmlrpc

Gaetano Giunta giunta.gaetano at gmail.com
Wed Dec 17 19:05:31 CET 2008


Aymen GRUN a écrit :
> Hi all,
> I'm using xmlrpc.inc,v 1.158 2007/03/01 21:21:02
> My problem is that xmlrpc_client() needs $path variable, I'm beginner 
> with this framework and I don't understand what's this variable ?
> I asked the xmlrpc server admin and he said that he don't know about 
> this variable, all what he gives me is the server url and methods name :
> for example :             https://toto.titi.com:8443/tata/getSomething
>
> he also gives me a client example but in java :
>            
>             PostMethod post = new 
> PostMethod("https://toto.titi.com:8443/tata/getSomething");
>             RequestEntity entity = new 
> StringRequestEntity(inputRequest, "application/xml", "ISO-8859-1");
>             post.setRequestEntity(entity);
>            
>             HttpClient httpclient = new HttpClient();   
>             int result = httpclient.executeMethod(post);
>
> How can I communicate with this server and execute those methods in 
> php and using xmlrpc.inc,v 1.158 2007/03/01 21:21:02 ?
>
The online docs for the creator method of the client are here: 
http://phpxmlrpc.sourceforge.net/doc-1.1/ch05s01.html#d0e322

In short, the line you need is:
$client = new xmlrpc_client("/tata/getSomething 
<https://toto.titi.com:8443/tata/getSomething> 
<https://toto.titi.com:8443/tata/getSomething>", "toto.titi.com 
<https://toto.titi.com:8443/tata/getSomething>", 8443 
<https://toto.titi.com:8443/tata/getSomething>);

One thing that worries me a little bit in the java example you gave is 
that I see no trace of xmlrpc in there - of course the inputRequest 
creation is not shown, but the "method name" looks to be coded in the 
url, while in xmlrpc it is usually only part of the post body.
Are you sure you are using the xmlrpc protocol? Maybe the server just 
expects a plain xml request via post (also known as REST-style 
webservices, and not supported by phpxmlrpc lib)
> Another issue : when using https, why it fails returning this error 
> message : "Fault code: [16] Reason: 'No CURL support compiled in.'"
> what's the solution to work with a https server ? Knowing that I have 
> the security certificate xxx.cer for this https server.
To support https, the phpxmlrpc lib needs to have the curl extension 
compiled in into php. Look up the documentation about setting up php on 
your platform for that.

Bye
Gaetano



More information about the phpxmlrpc mailing list