I think you are right.
$serveur->register('this.test');
I suspect you want NuSOAP to use the "this" instance of tx_ftpusermgt_pi3.
NuSOAP cannot do that. It can either create its own instance, or it can call a
method statically (e.g. tx_ftpusermgt_pi3::test).
Scott Nichol
Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----
From: "Nicolas CERISIER" <nicolas.cerisier@xxxxxxxxx>
To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, March 17, 2006 3:55 AM
Subject: [Nusoap-general] nusoap server inside a class
Hi All,
I'm working on integration of nusoap into an existing Typo3 extension in
order to provide a Soap API.
If I use this dummy code alone it works fine :
<?php
include('nusoap.php');
$serveur = new soap_server;
$serveur->register('test');
$serveur->service($HTTP_RAW_POST_DATA);
function test($var)
{
return "Hello $var!";
}
?>
but when I put these lines into the plugin, it failed :
include_once(t3lib_extMgm::extPath('ftp_user_mgt').'nusoap.php');
class tx_ftpusermgt_pi3 extends tx_ftpusermgt_pibase {
var $scriptRelPath = 'pi3/class.tx_ftpusermgt_pi3.php'; // Path to
this script relative to the extension dir.
var $dataApiClassName = 'tx_ftpusermgt_dataapi_pi3';
function main($content,$conf) {
$this->conf=$conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$debug = 1;
$this->initDataAPI();
$serveur = new soap_server;
$serveur->register('this.test');
$serveur->service($HTTP_RAW_POST_DATA);
die();
//return $this->pi_wrapInBaseClass($content);
}
function test($var) {
return "Hello $var!";
}
}
To my mind, the problem is the function "$server->register" can't register
the good function ($this->test) and failed ...
Maybe did you already meet this problem ?
Thanks & Regards,
Nicolas.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
|