SOAP function call

From: Date: Wed, 21 Apr 2004 22:22:02 +0000
Subject: SOAP function call
Groups: php.general 
Request: Send a blank email to php-general+get-184162@lists.php.net to get a copy of this message
I'm trying to create a simple (I think) SOAP function that checks whether or not a file was uploaded to a server. I have everything set up, but when I try to use the function I get an array disguised as an object. The function I've created should return either TRUE or FALSE and I can't find either result in the array. What am I doing wrong? Thanks, Craig. Server: <?php require_once('SOAP/Server.php'); class validate {
       var $method_namespace = 'urn:validate';
       function check($filename)
       {
               if(file_exists($filename))
               {
                       $return = "TRUE";
               }
               else
               {
                       $fp = fopen($filename, "a");
                       $contents = fread($filename, filesize($filename));
                       if(!strstr($contents, $filename))
                               fwrite($fp, $filename."/r/n");
                       fclose($fp);
                       $return = "FALSE";
               }
               return $return;
       }
} $check = new validate; $server = new SOAP_Server; $server->addObjectMap($check); $server->service($HTTP_RAW_POST_DATA); ?> Client: require_once("SOAP/Client.php"); $soap = new SOAP_Client('http://10.0.1.100/scanned_docs/index.php'); $params = array("filename" => $tmpname); $urn = "urn:validate"; $obj = $soap->call('verify', $params, $urn)

« previous php.general (#184162) next »