how to configure soap-fault?
| From: | (Oliver Kuhl) | Date: | Tue, 13 Aug 2002 09:25:33 +0000 |
| Subject: | how to configure soap-fault? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-2103@lists.php.net to get a copy of this message | ||
Hi list!
I'm using the soap implementation of pear. On the soap-server-side, I
call the function mkdir like this:
function createDirectories($data){
$basedir = "/temp/".$data["dirname"];
if(!@mkdir($basedir, 0750)) {
return new PEAR_Error("error creating directory
$basedir");
}
return true;
}
function write($data){
$ret = $this->createDirectories($data);
if(PEAR::isError($ret)){
$data["status"] = error;
$data["errormessage"] = $ret->getMessage();
} else {
$data["status"] = "ok";
}
return $data;
}
The first time I call "write" via soap, the directory is created. If I
call it another time, the directory exists and the server directly
returns a soap-fault with the following error-message:
soap_fault Object
(
[error_message_prefix] => PHP
[mode] => 1
[level] => 1024
[code] => SOAP-ENV:Server
[message] => mkdir() failed (File exists)
[userinfo] => Errno: 2
Filename: /home/web/SOAP/server.php
Lineno: 217
[callback] =>
)
Ok, its a fine functionality, but I don't want this behaviour. I want
to return my own error-code (thats because soon I will create a list
of directories and return an array with the status of each directory).
But how can I do it? The '@' to supress the error-message doesn't
work. And I tried to set 'display_errors = Off' and 'error_reporting
=', but it didn't work.
Any suggestions?
Regards,
Oliver.