[Spce-user] XML-RPC
HFC-Network Kft - Szabó János
szabojanos at hfcnetwork.hu
Wed May 23 09:21:30 EDT 2012
Hi,
We are using the nuSOAP php library to access the Sipwise's Soap side.
But you have to compile the curl module into the php to access the https
url.
2012.05.23. 15:11 keltezéssel, Juan José Ivars írta:
> 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 <http://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
--
Üdvözlettel,
Szabó János
HFC-Network Kft
E-mail: szabojanos at hfcnetwork.hu
Telefon: +36-20/344-4449
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20120523/7adf264b/attachment-0001.html>
More information about the Spce-user
mailing list