<html><head></head><body bgcolor="#FFFFFF"><div>Use XML-RPC client class like in Zend framework</div><div><br>Enviado desde mi iPhone</div><div><br>El 23/05/2012, a las 15:12, "Juan José Ivars" <<a href="mailto:juanjo@beeztel.com">juanjo@beeztel.com</a>> escribió:<br>
<br></div><div></div><blockquote type="cite"><div>Hello everybody<div><br></div><div><br></div><div>Could you post an example code in php for accessing XML-RPC in SipWise?</div><div><br></div><div>I am trying with that:</div>
<div><div>$strRequest = utf8_encode(‘</div><div>
<?xml version="1.0" encoding="UTF-8"?></div><div><methodCall></div><div> <methodName>XMLRPC.Provisioning.get_voip_account_subscriber</methodName></div><div> <params><param></div>
<div> <value><struct></div><div> <member></div><div> <name>authentication</name></div><div> <value><struct></div><div> <member></div>
<div> <name>type</name></div><div> <value><string>admin</string></value></div><div> </member></div><div> <member></div>
<div> <name>username</name></div><div> <value><string>administrator</string></value></div><div> </member></div><div> <member></div>
<div> <name>password</name></div><div> <value><string>administrator</string></value></div><div> </member></div><div> </struct></value></div>
<div> </member></div><div> <member></div><div> <name>parameters</name></div><div> <value><struct></div><div> <member></div><div>
<name>id</name></div><div> <value><int>6</int></value></div><div> </member></div><div> <member></div><div> <name>username</name></div>
<div> <value><string>nobody</string></value></div><div> </member></div><div> <member></div><div> <name>domain</name></div>
<div> <value><string><a href="http://example.com">example.com</a></string></value></div><div> </member></div><div> </struct></value></div>
<div> </member></div><div> </struct></value></div><div> </param></params></div><div></methodCall></div><div>/>‘);</div></div><div><br></div><div><div>$url = "<a href="https://XX.YY.ZZ.FF:2443/XMLRPC">https://XX.YY.ZZ.FF:2443/XMLRPC</a>";</div>
<div><br></div><div>$resultado = httpsPost($url, $strRequest);</div><div><br></div><div>var_dump($resultado);</div><div><br></div><div>function httpsPost($Url, $strRequest)</div><div>{</div><div>$ch=curl_init();</div><div>
curl_setopt($ch, CURLOPT_URL, $url);</div><div>curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);</div><div>curl_setopt($ch, CURLOPT_POST, 1) ;</div><div>curl_setopt($ch, CURLOPT_POSTFIELDS, $strRequest);</div><div>curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);</div>
<div>curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);</div><div>$result = curl_exec($ch);</div><div>curl_close($ch);</div><div>return $result;</div><div>}</div></div><div><br></div><div>Best regards.</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Spce-user mailing list</span><br><span><a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a></span><br>
<span><a href="http://lists.sipwise.com/listinfo/spce-user">http://lists.sipwise.com/listinfo/spce-user</a></span><br></div></blockquote></body></html>