SoapFault->__construct()

(no version information, might be only in CVS)

SoapFault->__construct() --  SoapFault コンストラクタ

説明

class SoapFault {

__construct ( string faultcode, string faultstring [, string faultactor [, mixed detail [, string faultname [, SoapHeader headerfault]]]] )

}

このクラスは、PHP ハンドラから SOAP フォールトレスポンスを送信した場合に有用です。 faultcode, faultstring, faultactor および details は SOAP フォールトの標準的な要素です。

パラメータ

faultcode

SoapFault のエラーコード

faultstring

SoapFault のエラーメッセージ

faultactor

エラーの原因となったアクターを識別する文字列

detail

faultname

WSDL からの厳密なフォールトエンコーディングを取得するために利用可能

headerfault

レスポンスヘッダにおいて SOAP ハンドラがエラーの報告処理を行っている間に利用可能 Can be used during SOAP header handling to report an error in the response header.

例 1. いくつかの例

<?php
function test($x)
{
    return new
SoapFault("Server", "Some error message");
}

$server = new SoapServer(null, array('uri' => "http://test-uri/"));
$server->addFunction("test");
$server->handle();
?>

SOAP フォールトを投げるために PHP の例外機構を使用することができます。

例 2. いくつかの例

<?php
function test($x)
{
    
throw new SoapFault("Server", "Some error message");
}

$server = new SoapServer(null, array('uri' => "http://test-uri/"));
$server->addFunction("test");
$server->handle();
?>

参考

SoapClient->__construct()
SoapClient->__soapCall()
SoapVar->__construct()
SoapParam->__construct()
SoapFault->__construct()
is_soap_fault()