[Spce-user] Create account SOAP
Juan José Ivars
juanjo at beeztel.com
Mon Jun 11 07:19:01 EDT 2012
Hello
I am trying to create a voip account through the SOAP interface sending the
following XML code:
<?php
ini_set ('error_reporting', E_ALL);
ini_set ('display_errors', true);
require_once('lib/nusoap.php');
$proxyhost ='';
$proxyport = '';
$proxyusername = '';
$proxypassword = '';
$useCURL = '0';
$client = new nusoap_client("https://XX.XX.XX.XX:2443/SOAP/Provisioning.wsdl",
true, "", "", "root", "root_pass");
$client ->setCredentials("root","root_pass");
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(),
ENT_QUOTES) . '</pre>';
exit();
}
$client->setUseCurl($useCURL);
$client->useHTTPPersistentConnection();
$params = '
<authentication>
<type xsi:type="xsd:string">admin</type>
<username xsi:type="xsd:string">administrator</username>
<password xsi:type="xsd:string">admin_pass</password>
</authentication>
<parameters>
<data>
<billing_profile
xsi:type="xsd:string">default</billing_profile>
<status xsi:type="xsd:string">active</status>
<external_id xsi:type="xsd:string">44444444</external_id>
<subscribers
SOAP-ENC:arrayType="xsd:SubscriberWriteArray[]">
<username
xsi:type="xsd:string">666666666</username>
<domain
xsi:type="xsd:string">XX.XX.XX.XX</domain>
<password
xsi:type="xsd:string">2222222</password>
</subscribers>
</data>
</parameters>
';
$result = $client->call('create_voip_account', $params, '
https://XX.XX.XX.XX:2443/SOAP', 'https://XX.XX.XX.XX:2443/SOAP');
echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>';
if ($client->fault) {
echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>';
} else {
$err = $client->getError();
if ($err) {
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
}
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request,
ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response,
ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(),
ENT_QUOTES) . '</pre>';
echo 'fin';
But i get that answer:
Can't use string ("666666666") as a HASH ref while "strict refs" in use at
/usr/share/perl5/Sipwise/Provisioning/Billing.pm line 1009
Is like the 666666666 value is not correct for the username field, can
anybody help me?
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/mailman/private/spce-user_lists.sipwise.com/attachments/20120611/2af5885f/attachment.html>
More information about the Spce-user
mailing list