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)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to