You may use undocumented and invisible property $e->faultcode to access string version of $code. Because standard $e->getCode() does not work:
<?php
$e = new SoapFault("test", "msg");
var_dump($e->getCode()); // prints "0"
var_dump($e->faultcode); // prints "test"
?>
Also you may use namespaced fault codes:
<?php
$e = new SoapFault(array("namespace", "test"), "msg");
?>
- see ext/soap/soap.php, PHP_METHOD(SoapFault, SoapFault). To access the namespace, use $e->faultcodens
La classe SoapFault
Introduction
Représente une erreur SOAP.
Synopsis de la classe
SoapFault
SoapFault
extends
Exception
{
/* Propriétés */
/* Méthodes */
__construct
( string $faultcode
, string $faultstring
[, string $faultactor
[, string $detail
[, string $faultname
[, string $headerfault
]]]] )
SoapFault
( string $faultcode
, string $faultstring
[, string $faultactor
[, string $detail
[, string $faultname
[, string $headerfault
]]]] )
/* Méthodes héritées */
}Propriétés
- message
-
Description
- code
-
Description
- file
-
Description
- line
-
Description
Sommaire
- SoapFault::__construct — Constructeur SoapFault
- SoapFault::SoapFault — SoapFault constructor
- SoapFault::__toString — Produit une représentation chaîne d'un objet SoapFault
SoapFault
dmitry dot koterov at gmail dot com
29-Oct-2009 11:21
29-Oct-2009 11:21
