Hi<br><br>This is the code completed.<br>Only one advise, VOIP ACCOUNT SUBSCRIBER return null if all is ok, else return the error.<br><br><br><?php<br>require_once('lib/nusoap.php');<br><br>$phone = "123123123";<br>
$external_id = "4444444";<br>$password = "333333";<br>$user = $external_id; // for my test<br><br><br><br>// get wsdl<br>$client = new nusoap_client("<a href="https://xx.xx.xx.xx:2443/SOAP/Provisioning.wsdl">https://xx.xx.xx.xx:2443/SOAP/Provisioning.wsdl</a>", true, "", "", "user", "password");<br>
$client ->setCredentials("user","password");<br><br>$err = $client->getError();<br>if ($err) {<br>    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';<br>
    echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';<br>    exit();<br>}<br><br>$client->setUseCurl('0');<br>$client->useHTTPPersistentConnection();<br>
<br><br><br>// authentication string<br><br>$authentication = '         <br>    <authentication><br>        <type xsi:type="xsd:string">admin</type><br>        <username xsi:type="xsd:string">user</username><br>
        <password xsi:type="xsd:string">password</password><br>    </authentication>';<br><br>// **************************************<br>// CREATE VOIP ACCOUNT<br>$params = $authentication.'<br>
         <parameters><br>             <data><br>                <billing_profile xsi:type="xsd:string">default</billing_profile><br>                <status xsi:type="xsd:string">active</status><br>
                <external_id xsi:type="xsd:string">'.$external_id.'</external_id><br>                    <subscribers SOAP-ENC:arrayType="xsd:SubscriberWriteArray[]"><br>                    </subscribers>    <br>
                </data><br>         </parameters><br>';<br><br>// get the id of the new account<br>$id_voip = $client->call('create_voip_account', $params, '<a href="https://xx.xx.xx.xx:2443/SOAP">https://xx.xx.xx.xx:2443/SOAP</a>', '<a href="https://xx.xx.xx.xx:2443/SOAP'">https://xx.xx.xx.xx:2443/SOAP'</a>);<br>
<br>echo 'voip account id = '.$id_voip.'<br/>';<br>// END VOIP ACCOUNT<br>// **************************************<br><br><br>// **************************************<br>// ADD  SUBSCRIBER to VOIP ACCOUNT<br>
$params = $authentication.'<br>         <parameters><br>         <id xsi:type="xsd:int">'.$id_voip.'</id><br>                    <subscriber><br><br>                                    <username xsi:type="xsd:string">'.$user.'</username><br>
                                    <domain xsi:type="xsd:string">domain</domain><br>                                   <password xsi:type="xsd:string">'.$password.'</password><br>
                        </subscriber>    <br>         </parameters><br>';<br>$result = $client->call('add_voip_account_subscriber', $params, '<a href="https://xx.xx.xx.xx:2443/SOAP">https://xx.xx.xx.xx:2443/SOAP</a>', '<a href="https://xx.xx.xx.xx:2443/SOAP'">https://xx.xx.xx.xx:2443/SOAP'</a>);<br>
<br>echo '<h2>result</h2><pre>'; print_r($result); echo '</pre>';<br>// END ADD VOIIP ACCOUNT SUBSCRIBER<br>// **************************************<br>// END PHP<br>?><br><div class="gmail_quote">
2012/6/18 Skyler <span dir="ltr"><<a href="mailto:skchopperguy@gmail.com" target="_blank">skchopperguy@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div><br><div class="gmail_quote"><div class="im">On Tue, Jun 12, 2012 at 4:31 AM, Alejandro Rodriguez <span dir="ltr"><<a href="mailto:alejandro@beeztel.com" target="_blank">alejandro@beeztel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br><br>This is fixed :).<br><br></blockquote><div><br></div></div><div> Would you mind sharing your final working PHP code used to the community? Any special instructions?</div><span class="HOEnZb"><font color="#888888"><div>
<br></div><div>Skyler</div></font></span><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I cant create all the information in one step. I use two calls:<br>create_voip_account<br>add_voip_account_subscriber<br><br>This is not the correct solution. Because on create_voip_account, it's possible to create the account subscriber... but I don't know how.<br>


<br>$aut ='         <authentication><div><br>
            <type xsi:type="xsd:string">admin</type><br>
            <username xsi:type="xsd:string">user</username><br>
            <password xsi:type="xsd:string">password</password><br></div>
         </authentication>';<br><br><br>$params = $aut.'<div><br>          <parameters><br>             <data><br>                <billing_profile xsi:type="xsd:string">default</billing_profile><br>


                <status xsi:type="xsd:string">active</status><br></div>                <external_id xsi:type="xsd:string">5555555</external_id><div><br>                    <subscribers SOAP-ENC:arrayType="xsd:SubscriberWriteArray[]"><br>

</div>
                    </subscribers>    <br>                </data><br>         </parameters><br>';<br><br><br>$id_voip = $client->call('create_voip_account', $params, '<a href="https://xx.yy.zz.aa:2443/SOAP" target="_blank">https://xx.yy.zz.aa:2443/SOAP</a>', '<a href="https://xx.yy.zz.aa:2443/SOAP%27" target="_blank">https://xx.yy.zz.aa:2443/SOAP'</a>);<br>


<br>echo 'voip account='.$id_voip.'<br/>';<br><br>$params =$aut.'<br>         <parameters><br>         <id xsi:type="xsd:int">'.$id_voip.'</id><br>                    <subscriber><br>


<br>                                    <username xsi:type="xsd:string">444444</username><div><br>                                    <domain xsi:type="xsd:string">xx.yy.zz.aa</domain><br>

</div>
                                   <password xsi:type="xsd:string">11111111</password><br>                        </subscriber>    <br><br>         </parameters><br>';<br>$result = $client->call('add_voip_account_subscriber', $params, '<a href="https://xx.yy.zz.aa:2443/SOAP" target="_blank">https://xx.yy.zz.aa:2443/SOAP</a>', '<a href="https://xx.yy.zz.aa:2443/SOAP%27" target="_blank">https://xx.yy.zz.aa:2443/SOAP'</a>);<div>

<div><br>
<br><br><br><br><div class="gmail_quote">2012/6/12 Skyler <span dir="ltr"><<a href="mailto:skchopperguy@gmail.com" target="_blank">skchopperguy@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi,<div><br></div><div> I think your problem is because you are trying to submit xml using soap. XML-RPC is different than SOAP. The example I sent is using SOAP not XML-RPC. 
You need to choose one and try again.</div><div><br></div><div> If you read the documentation at https://<ce-ip>:2443/SOAP/Provisioning.wsdl you will see there are 2 different capabilities. SOAP or XML-RPC. Each have different URL also.</div>



<div><br></div><div> Does the example I proposed work? .. when using 'default' as billing_profile?</div><span><font color="#888888"><div><br></div></font></span><div><span><font color="#888888">Skyler</font></span><div>


<div><br><br><div class="gmail_quote">On Mon, Jun 11, 2012 at 4:27 PM, Alejandro Rodriguez <span dir="ltr"><<a href="mailto:alejandro@beeztel.com" target="_blank">alejandro@beeztel.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Not, this don't work. I try with the code attached.</div><div>I use the xml soap instead of the arrays.</div>



<div>I think all is correct, but I have this error, and I don't have idea why.</div>
<div><span style="font-family:Times;font-size:medium"><pre>Array
(
    [faultcode] => soap:Server
    [faultstring] => Can't use string ("666666666") as a HASH ref while "strict refs" in use at /usr/share/perl5/Sipwise/Provisioning/Billing.pm line 1009.

)</pre></span></div><div>This is the code using nusoap</div><div><br></div><div><?php</div><div><br></div><div><div>require_once('lib/nusoap.php');</div><div><br></div><div>$useCURL =  '0';</div><div><br>




</div><div>$client = new nusoap_client("https://xx.yy.zz.aa:nnnn/SOAP/Provisioning.wsdl", true, "", "", "USER", "PASSWORD");</div><div>$client ->setCredentials("USER","PASSWORD");</div>




<div><br></div><div>$err = $client->getError();</div><div>if ($err) {</div><div>    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';</div><div>    echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';</div>




<div>    exit();</div><div>}</div><div><br></div><div>$client->setUseCurl($useCURL);</div><div>$client->useHTTPPersistentConnection();</div><div><br></div><div><br></div><div>// CREATE ACCOUNT</div><div>$params = '</div>




<div>         <authentication></div><div>            <type xsi:type="xsd:string">admin</type></div><div>            <username xsi:type="xsd:string">user</username></div><div>




            <password xsi:type="xsd:string">password</password></div><div>         </authentication></div><div>         <parameters></div><div>             <data></div><div>                <billing_profile xsi:type="xsd:string">default</billing_profile></div>




<div>                <status xsi:type="xsd:string">active</status></div><div>                <external_id xsi:type="xsd:string">44444444</external_id></div><div>                    <subscribers SOAP-ENC:arrayType="xsd:SubscriberWriteArray[]"></div>




<div>                              <span style="white-space:pre-wrap">    </span>  <username xsi:type="xsd:string">666666666</username></div><div>                             <span style="white-space:pre-wrap">        </span>   <domain xsi:type="xsd:string">xx.yy.zz.aa</domain></div>




<div>                             <span style="white-space:pre-wrap">     </span>  <password xsi:type="xsd:string">2222222</password></div><div>                        </subscribers><span style="white-space:pre-wrap">   </span></div>




<div>                </data></div><div>         </parameters></div><div>';</div><div><br></div><div><span>$result = $client->call('create_voip_account', $params, 'https://xx.yy.zz.aa:nnnn/SOAP', 'https://</span>xx.yy.zz.aa:nnnn<span>/SOAP');</span></div>




<div>echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>';</div><div><br></div><div>if ($client->fault) {</div><div><span style="white-space:pre-wrap">       </span>echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>';</div>




<div>} else {</div><div><span style="white-space:pre-wrap">   </span>$err = $client->getError();</div><div><span style="white-space:pre-wrap">   </span>if ($err) {</div><div><span style="white-space:pre-wrap">              </span>echo '<h2>Error</h2><pre>' . $err . '</pre>';</div>




<div><span style="white-space:pre-wrap">  </span>} else {</div><div><span style="white-space:pre-wrap">         </span>echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';</div>
<div><span style="white-space:pre-wrap">  </span>}</div><div>}</div><div><br></div><div>echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';</div>




<div>echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';</div><div>echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';</div>




<div><br></div><div><br></div></div><div><div><div><br></div><div><br><br><div class="gmail_quote">2012/6/12 Skyler <span dir="ltr"><<a href="mailto:skchopperguy@gmail.com" target="_blank">skchopperguy@gmail.com</a>></span><br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div> Did this work for you?</div><span><font color="#888888"><div><br></div></font></span><div>
<span><font color="#888888">Skyler</font></span><div><div><br><br><div class="gmail_quote">On Thu, Jun 7, 2012 at 1:52 PM, Alejandro Rodriguez <span dir="ltr"><<a href="mailto:alejandro@beeztel.com" target="_blank">alejandro@beeztel.com</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>Perfect.</p>
<p>I will try. </p>
<p>Regards</p>
<div class="gmail_quote">El 07/06/2012 21:50, "Skyler" <<a href="mailto:skchopperguy@gmail.com" target="_blank">skchopperguy@gmail.com</a>> escribió:<div><div><br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






Hi,<div><br></div><div>  Don't forget to reply-all so everyone can help or know solutions ;)<br><br><div class="gmail_quote">On Thu, Jun 7, 2012 at 1:22 PM, Alejandro Rodriguez <span dir="ltr"><<a href="mailto:alejandro@beeztel.com" target="_blank">alejandro@beeztel.com</a>></span> wrote:<br>







<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Skyler,<div><br></div><div>With nusoap, all is correct and easy. (I don't think on use this instead of php soap)<div>







<br></div><div>I'm not sure if you can help me with a new question. Create the structure for create_voip_account. I can't create the correct structure.</div>
<div>I receive this message "<span style="font-family:monospace;white-space:pre-wrap;font-size:medium">need a billing profile for the new account"</span></div><div><span style="font-family:monospace;white-space:pre-wrap;font-size:medium"><br>







</span></div></div></blockquote><div><br></div><div> I have this same trouble but not had time to further investigate. I suspect that the 'billing_profile' may require the ID number assigned in the database to be passed where if 'Default Billing Profile' has ID of '3' then pass the '3'.</div>







<div><br></div><div>...just guessing, maybe you can help to confirm this for everyone? :)</div><div><br></div><div>Skyler</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div><div><span style="font-family:monospace;white-space:pre-wrap;font-size:medium">
</span></div><div>Thanks.</div><div><br></div><div><div>$params = array(</div><div>        'authentication' => array('type' => 'admin', 'username' => 'username', 'password' => 'password'),</div>








<div>        'parameters' => array( 'data' => array (</div><div>                   <span style="white-space:pre-wrap">                                  </span>'billing_profile' => 'Default Billing Profile',</div>








<div>                   <span style="white-space:pre-wrap">                                       </span>'status'  => 'active',</div><div>                    <span style="white-space:pre-wrap">                            </span>'external_id' => '44444444',</div>








<div>                    <span style="white-space:pre-wrap">                              </span>'subscribers' => array(</div><div>                            <span style="white-space:pre-wrap">                                           </span>'username' => '44444444',</div>








<div>                            <span style="white-space:pre-wrap">                                              </span>'domain' => '94.23.232.121',</div><div>                            <span style="white-space:pre-wrap">                                              </span>'password' => '2222222'</div>








<div>                            <span style="white-space:pre-wrap">                                              </span>)</div><div>                    <span style="white-space:pre-wrap">                            </span>)</div><div>            <span style="white-space:pre-wrap">                    </span>)               </div>








<div>    <span style="white-space:pre-wrap">              </span>);</div></div><div><div><div><br></div><div><br></div><div><br></div><div><br><div class="gmail_quote">2012/6/7 Alejandro Rodriguez <span dir="ltr"><<a href="mailto:alejandro@beeztel.com" target="_blank">alejandro@beeztel.com</a>></span><br>








<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>Thanks a lot nusoap :)</p>
<div class="gmail_quote">El 07/06/2012 19:45, "Skyler" <<a href="mailto:skchopperguy@gmail.com" target="_blank">skchopperguy@gmail.com</a>> escribió:<div><div><br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">










Hi,<div><br></div><div> See attached php/soap connection example. This is from a very helpful person on the list some months ago. Maybe it will assist your problem ;)</div><div><br></div><div>Skyler<br><br><div class="gmail_quote">











On Thu, Jun 7, 2012 at 6:47 AM, Alejandro Rodriguez <span dir="ltr"><<a href="mailto:alejandro@beeztel.com" target="_blank">alejandro@beeztel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">











Hello, <br><br>I'm trying to use XML-RPC and SOAP with sipwise. But I cant connect with the server with XML-RPC and with SOAP versión everytime I get the message "SOAP-ERROR: Parsing Schema: unexpected  in complexType"<br>












<br>Please have you some example in php to usu XML-RPC or with SOAP.<br><br><br>This is my php for load the wsdl in SOAP.<br><br>try<br>{<br>$client = new SoapClient("<a href="https://ipserver:2443/SOAP/Provisioning.wsdl" target="_blank">https://ipserver:2443/SOAP/Provisioning.wsdl</a>",array('login' => "login", 'password' => "password"));<br>












<br>} catch ( SoapFault $fault ) {<br>echo '<pre>';<br>echo var_dump($fault) ;<br>echo '</pre>';<br>exit ;<br>}<br><br><br>Regards<span><font color="#888888"><br>Alejandro<br>
</font></span><br>_______________________________________________<br>
Spce-user mailing list<br>
<a href="mailto:Spce-user@lists.sipwise.com" target="_blank">Spce-user@lists.sipwise.com</a><br>
<a href="http://lists.sipwise.com/listinfo/spce-user" target="_blank">http://lists.sipwise.com/listinfo/spce-user</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div></div></div><br></div>
</blockquote></div><br>