SOAP and functions in external files

From: Date: Sun, 27 Oct 2002 17:58:46 +0000
Subject: SOAP and functions in external files
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-10299@lists.php.net to get a copy of this message
27/10/2002 18.58.46 Hi, I'm stuck with a problem... Whenever I create a PEAR::SOAP_server, it seems I can't get functions defined in external files working... I mean: if I write a simple SOAP client/server, it works as expected. But when I try to use a function which has been defined in another file (yes, I included it as well...) it fails. Here's a code sample... <?php // require SOAP classes and useful functions... require_once 'SOAP/Server.php'; require_once './includes/library.class.php'; $server = new SOAP_Server; $server->_auto_translation = true; class SOAP_Library_Server { var $__dispatch_map = array(); function SOAP_Library_Server() { } function getBookPrice($inputISBN) { $library = new Library; // getPriceByISBN is obviously a method // defined in file "library.class.php"... // It always fails. // It works if I put my func in this file, though... return $library ->getPriceByISBN($inputISBN); } } $soapclass = new SOAP_Library_Server(); $server->addObjectMap($soapclass,'urn:SOAP_Library_Server'); $server->service($HTTP_RAW_POST_DATA); ?> I've also tryed a similar code with nusoap class, but it has exactly the same behaviour. Any suggestion? Regards, Lorenzo Alberton --- [Quipo ISP - Questa E-mail e' stata controllata dal programma Declude Virus] [Quipo ISP - This E-mail was scanned for viruses by Declude Virus]

« previous php.pear.dev (#10299) next »