soap-clientsoapserverispconfig

ispConfig soap client functions of billing module does not exist


I am very new to ISPConfig and php soap technology. I downloaded the example script from http://www.ispconfig.org/page/en/addons/billing-module.html

but when I am trying to add_invoice it's telling billing_invoice_add function I am getting exception:

//* Create the SOAP client connection
$client = new SoapClient(null, array('location' => $soap_location,
                                 'uri'      => $soap_uri,
                                 'trace' => 1,
                                 'exceptions' => 1));
//* Login as remote user
if($session_id = $client->login($username,$password)) {
    echo 'Logged successfull. Session ID:'.$session_id.'<br />';
}

//* We will create a invouce for the client with the following ID
$client_id = 4;

//* Optional parameters to override the client address or client settings
$params = array();

//* Add the invoice
$invoice_id = $client->billing_invoice_add($session_id, $client_id, $params); # Here I am getting exception.
echo 'InvoiceID: '.$invoice_id.'<br />';

I am able to login successfully.

ispConfig version: 3.0

Please suggest any method to add invoice to server, remotly.

I am able to add it in dashboard.


Solution

  • Oh after hours of debugging, got the point. The error was due to $soap_location . $soap_location location was directing to remote.php

    Generally when we create any module for ispconfig, the module class should inherit from remoting class. Now when we need to use the module we need to call that module location.

    For example in my case billing is a module. It is inheriting from remoting class module. so to get the functions of both remoting and billing, we need to make the soapclient loation as billing.php, not remoting.php