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
SoapFault クラス
導入
SOAP fault をあらわします。
クラス概要
SoapFault
SoapFault
extends
Exception
{
/* Properties */
/* メソッド */
__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
]]]] )
/* 継承したメソッド */
}プロパティ
- message
-
Prop description
- code
-
Prop description
- file
-
Prop description
- line
-
Prop description
目次
- SoapFault::__construct — SoapFault コンストラクタ
- SoapFault::SoapFault — SoapFault コンストラクタ
- SoapFault::__toString — SoapFault の文字列表現を取得する
SoapFault
dmitry dot koterov at gmail dot com
29-Oct-2009 10:21
29-Oct-2009 10:21
