Source for file Fault.php
Documentation is available at Fault.php
* This file contains the SOAP_Fault class, used for all error objects in this
* LICENSE: This source file is subject to version 2.02 of the PHP license,
* that is bundled with this package in the file LICENSE, and is available at
* through the world-wide-web at http://www.php.net/license/2_02.txt. If you
* did not receive a copy of the PHP license and are unable to obtain it
* through the world-wide-web, please send a note to license@php.net so we can
* mail you a copy immediately.
* @author Dietrich Ayala <dietrich@ganx4.com> Original Author
* @author Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more
* @author Chuck Hagenbuch <chuck@horde.org> Maintenance
* @author Jan Schneider <jan@horde.org> Maintenance
* @copyright 2003-2006 The PHP Group
* @license http://www.php.net/license/2_02.txt PHP License 2.02
* @link http://pear.php.net/package/SOAP
* PEAR::Error wrapper used to match SOAP Faults to PEAR Errors
* SOAP_Fault can provide a complete backtrace of the error. Revealing these
* details in a public web services is a bad idea because it can be used by
* attackers. Thus you have to enable backtrace information in SOAP_Fault
* responses by putting the following code in your script after your
* "require_once 'SOAP/Server.php';" line:
* $backtrace =& PEAR::getStaticProperty('SOAP_Fault', 'backtrace');
* @author Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more
* @author Dietrich Ayala <dietrich@ganx4.com> Original Author
* @param string $faultstring Message string for fault.
* @param mixed $faultcode The faultcode.
* @param mixed $faultactor
* @param mixed $detail @see PEAR_Error
* @param array $mode @see PEAR_Error
* @param array $options @see PEAR_Error
function SOAP_Fault($faultstring = 'unknown error', $faultcode = 'Client',
$faultactor = null , $detail = null , $mode = null ,
parent ::PEAR_Error ($faultstring, $faultcode, $mode, $options, $detail);
$this->error_message_prefix = $faultactor;
* Returns a SOAP XML message that can be sent as a server response.
function message($encoding = SOAP_DEFAULT_ENCODING )
$params[] = new SOAP_Value('faultcode', 'QName', SOAP_BASE ::SOAPENVPrefix (). ':' . $this->code);
$params[] = new SOAP_Value('faultstring', 'string', $this->message);
$params[] = new SOAP_Value('faultactor', 'anyURI', $this->error_message_prefix);
if (PEAR ::getStaticProperty ('SOAP_Fault', 'backtrace') &&
isset ($this->backtrace)) {
$params[] = new SOAP_Value('detail', 'string', $this->backtrace);
$params[] = new SOAP_Value('detail', 'string', $this->userinfo);
return $msg->makeEnvelope ($methodValue, $headers, $encoding);
* Returns a simple native PHP array containing the fault data.
$fault->faultcode = $this->code;
$fault->faultstring = $this->message;
$fault->faultactor = $this->error_message_prefix;
$fault->detail = $this->userinfo;
* Returns the SOAP actor for the fault.
return $this->error_message_prefix;
* Returns the fault detail.
Documentation generated on Mon, 04 Aug 2008 20:00:21 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|