Re: Need help for xmlrpc
Gaetano Giunta <[email protected]> Wed, 17 Dec 2008 19:05:31 +0100
| Newsgroups | gmane.comp.php.xml-rpc |
|---|---|
| Message-ID | <[email protected]> |
Aymen GRUN a =E9crit :
> 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 =3D new =
> PostMethod("https://toto.titi.com:8443/tata/getSomething");
> RequestEntity entity =3D new =
> StringRequestEntity(inputRequest, "application/xml", "ISO-8859-1");
> post.setRequestEntity(entity);
> =
> HttpClient httpclient =3D new HttpClient(); =
> int result =3D 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 =3D 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