[Spce-user] XML-RPC
Sébastien Cramatte
scramatte at gmail.com
Wed May 23 09:48:56 EDT 2012
Use XML-RPC client class like in Zend framework
Enviado desde mi iPhone
El 23/05/2012, a las 15:12, "Juan José Ivars" <juanjo at beeztel.com> escribió:
Hello everybody
Could you post an example code in php for accessing XML-RPC in SipWise?
I am trying with that:
$strRequest = utf8_encode(‘
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>XMLRPC.Provisioning.get_voip_account_subscriber</methodName>
<params><param>
<value><struct>
<member>
<name>authentication</name>
<value><struct>
<member>
<name>type</name>
<value><string>admin</string></value>
</member>
<member>
<name>username</name>
<value><string>administrator</string></value>
</member>
<member>
<name>password</name>
<value><string>administrator</string></value>
</member>
</struct></value>
</member>
<member>
<name>parameters</name>
<value><struct>
<member>
<name>id</name>
<value><int>6</int></value>
</member>
<member>
<name>username</name>
<value><string>nobody</string></value>
</member>
<member>
<name>domain</name>
<value><string>example.com</string></value>
</member>
</struct></value>
</member>
</struct></value>
</param></params>
</methodCall>
/>‘);
$url = "https://XX.YY.ZZ.FF:2443/XMLRPC";
$resultado = httpsPost($url, $strRequest);
var_dump($resultado);
function httpsPost($Url, $strRequest)
{
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1) ;
curl_setopt($ch, CURLOPT_POSTFIELDS, $strRequest);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
Best regards.
_______________________________________________
Spce-user mailing list
Spce-user at lists.sipwise.com
http://lists.sipwise.com/listinfo/spce-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20120523/5a94b38b/attachment-0001.html>
More information about the Spce-user
mailing list