#1  
Old 23rd June 2009, 23:09
afandino afandino is offline
Member
 
Join Date: May 2009
Posts: 35
Thanks: 1
Thanked 3 Times in 3 Posts
Default till please look at this

till,

I have written a couple of functions one works, the other won't,
one function has been placed in ispconfig_web.lib.php. the other in the reseller_web.lib.php
class file. I have been having a hard time trying to trap errors that occur on the soap server side trying to debug the functions. any ideas on how to set up my environment.

lets get to the code
/*
Function web_plans
params
return Array with all web plans from invoicing
*/

function web_plans($session,$params) {
global $go_api, $go_info;


if($session["user"]["web_query"] != 1) {
$this->errorMessage .= "method not allowed for user\r\n";
return false;

}

$wplans = $go_api->db->queryAllRecords("SELECT isp_fakt_artikel.artikelbezeichnung AS web_plan, isp_fakt_artikel.artikelpreis FROM isp_fakt_artikel WHERE isp_fakt_artikel.artikeltyp = 'Web' ORDER BY isp_fakt_artikel.artikelbezeichnung");


if(!empty($wplans)) {
foreach($wplans as $plan) {

$out[$plan["web_plan"]] = $plan;

}
return $out;


} else {
$this->errorMessage .= "no records found\r\n";
return false;

}

}

The way it is right now this will not return the array or an error to the soap server. Can you see anything? bellow is some test code i used to call the function through the soap connector.


<?php
include_once('soap.lib.php');
include('err_lib.php');
// Insert here your ispconfig server
$server_url = "https://xxxxx.xxxxx:81";

// creating object for soap_client
$soap_client = new soap_client($server_url.'/remote/index.php');
//echo ($server_url.'/remote/index.php');
//echo "<br>";


// Username and Password of the remoting user (not identical
// with the user to log into the web interface!)

$parameters = array('user' => 'xxxxxxx',
'pass' => 'xxxxxx');

// Login into ispconfig Server
$session_id = $soap_client->call('login',$parameters);
//echo "<br> Calling soap client" ;

// Error Check
if($err = $soap_client->getError()) die("Error: ".$err);



$df2 = 1 ;

//if($_POST['p_df'] == 1) {
//$df2 =1 ;
//}


if($df2==1) {


//get web plans list as an array
// and fill in the select menu

$paramsL = array ( 'sid' => $session_id,
'module' => 'web',
'function' => 'web_plans',
'params' => array( 'reseller_title' => "AJFNET.COM", // Reseller1, admin, all
'kunde_id' => '1' // kunde_title or kuunde_id (kunde_title/kunde_id overrides reseller_title)
));

$Planlist = $soap_client->call('service',$paramsL);

// Error Check

if($err = $soap_client->getError()) die("Error: ".$err);
print_r($Planlist) ;


print_r('<form name="formPlan" method="post" action="auto.php">
<select name="planSelect">');
echo "\n";


foreach($Planlist as $plan => $plan["web_plan"] ) {
#
echo "<option>$plan</option>\n";
}
//$df2 = 0 ;
print_r('</select>
<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="p_df" value= "');
echo $df2;
print_r('">
</form>');


}
print_r($Planlist) ;
$soap_client->call('logout',array('sid' => $session_id));
?>
Reply With Quote
Sponsored Links
  #2  
Old 29th June 2009, 12:19
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,395
Thanks: 833
Thanked 5,490 Times in 4,322 Posts
Default

And the other remoting functions are working?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 29th June 2009, 13:38
afandino afandino is offline
Member
 
Join Date: May 2009
Posts: 35
Thanks: 1
Thanked 3 Times in 3 Posts
Default

yes the other functions are working
Reply With Quote
  #4  
Old 30th June 2009, 20:14
afandino afandino is offline
Member
 
Join Date: May 2009
Posts: 35
Thanks: 1
Thanked 3 Times in 3 Posts
 
Default

I guess i'll post the solution myself. It appears that the query returned an array but the way i walked through the array was wrong. The function was returning a multidimensional array which the loop could not handle, array(array(array))).
So getting back on track now...

Tony Fandino
Reply With Quote
The Following User Says Thank You to afandino For This Useful Post:
falko (1st July 2009)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thank You falko & till ! wpwood3 General 6 10th April 2009 15:27
Till, Falko, developer enviroments? quentusrex Developers' Forum 3 11th November 2008 19:56
Till and Felko my guru confighelp Smalltalk 2 17th November 2007 09:45
till. You exceeded your private messages quota edge Smalltalk 1 5th July 2007 10:53
Thanks to Falko and Till rdutton Smalltalk 8 22nd September 2006 20:43


All times are GMT +2. The time now is 08:56.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.