Hi everyone,
Can anyone help me to integrate jbilling with phhp.
I'm trying to do it by Nusoap, But unable to do so whenever i goi to create any user i get
"soap:Server: Error calling jBilling API. Method: createUser Cause: Invalid default username/password"
My code is,
require_once('nusoap.php');
require_once('class.wsdlcache.php') ;
$wsdlurl = 'http://localhost:8080/billing/cxf/soap.service?wsdl';
$cache = new wsdlcache('.', 120);
$wsdl = $cache->get($wsdlurl);
if (is_null($wsdl)) {
$wsdl = new wsdl($wsdlurl,'http://192.168.0.189', 8080, 'admin', '123qwe');
//$wsdl = new wsdl($wsdlurl,$proxyhost, $proxyport, $proxyusername, $proxypassword);
$cache->put($wsdl);
} else {
$wsdl->debug_str = '';
$wsdl->debug('Retrieved from cache');
}
$USER = "admin";
$PASS = "123qwe";
$client = new nusoap_client($wsdlurl, true);
//$client->setCredentials($USER, $PASS, 'basic', array ());
$err = $client->getError();
if ($err) {
echo 'Constructor error' . $err . '';
}
else {echo "Successful"; }
$proxy = $client->getProxy();
$err = $client->getError();
if($err) {
echo '\nCould not connect to jbilling\n'. $err;
exit();
}
else {
echo 'connected to jbilling';
/////////////////////////////////////
$user = array ('currencyId' => 1,
'contact' => array ('address1' => "dfsdfsdfsd",
'address2' => "dfsdfsdfsd",
'city' => "dfsdfsdfsd",
'countryCode' => '',
'stateProvince' => '',
'email' => 'dffd@sds.com',
'organizationName' => "dfdsfsd",
'firstName' => "dfdsfsd",
'lastName' => "dfdsfsd",
'initial' => "",
'phoneNumber' => "",
'postalCode' => "",
'type' => 1,
'title' => "",
'deleted' => 0),
'userName' => "dfdsfsd",
'password' => "fdsfdf",
'mainRoleId' => 5,
'statusId' => 1,
'role' => "5",
'subscriberStatusId' => 1,
'languageId' => 1,
'deleted' => 0,
'creditCard' => array ('name' => 'dfsdf',
'number' => '1236547899874562',
'expiry' => '05/31/2015',
'securityCode' => 1025,
'type' => 1)
);
$parameters = array ('arg0' => $user);
$result2 = $proxy->createUser($parameters);
$err = $proxy->getError();
if($err)
{
echo $err;
//echo "Error :".$err;
}
////////////////////////////////////////
}
.......................................................
Please help me its urgent
Plz reply as early as possible
Thanx in advance,
Rahul
Still getting error
Hi,
I followed your procedure. But I am still getting error.
Successful\nCould not connect to jbilling\nwsdl error: Getting http://192.168.0.189:8080/jbilling/cxf/soap.service?wsdl - HTTP ERROR: Unsupported HTTP response status 404 Not Found (soapclient->response has contents of the response)
Can you help me in this regard?
I am running the code from "http://localhost/lib/test1.php", where "lib" is the "NuSoap" library copied into "htdocs" folder.
Thanks & regards
Rahul
you need to uncomment this
you need to uncomment this line.
//$client->setCredentials($USER, $PASS, 'basic', array ());
Otherwise code seems to be fine.