downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SoapServer->getFunctions()> <SoapServer->__construct()
[edit] Last updated: Fri, 25 May 2012

view this page in

SoapServer::fault

(PHP 5 >= 5.0.1)

SoapServer::faultErzeugt einen SoapServer-Fehler, der einen Fehlerzustand anzeigt

Beschreibung

public void SoapServer::fault ( string $code , string $string [, string $actor [, string $details [, string $name ]]] )

Sendet dem Client der aktuellen Anfrage eine Antwort, die einen Fehler anzeigt.

Hinweis:

Diese Methode kann nur aufgerufen werden, wenn ein Request verarbeitet wird.

Parameter-Liste

code

Der Fehlercode, der übergeben werden soll

string

Eine kurze Beschreibung des Fehlers

actor

Eine Zeichenkette, die den Akteur identifiziert, der den Fehler verursacht hat.

details

Weitere Details zum Fehler

name

Der Name des Fehlers. Dies kann verwendet werden, um den Namen aus einer WSDL-Datei auszuwählen.

Rückgabewerte

Es wird kein Wert zurückgegeben.

Siehe auch



SoapServer->getFunctions()> <SoapServer->__construct()
[edit] Last updated: Fri, 25 May 2012
 
add a note add a note User Contributed Notes SoapServer::fault
brian dot reynolds at risaris dot com 21-Feb-2012 09:44
Example Usage:

return new SoapFault( "Client", "foo or bar must be supplied");

SOAP Fault Codes

VersionMismatch: Found an invalid namespace for the SOAP Envelope element
MustUnderstand    : An immediate child element of the Header element, with the mustUnderstand attribute set to "1", was not understood
Client: The message was incorrectly formed or contained incorrect information
Server: There was a problem with the server so the message could not proceed
dub357 at gmail dot com 08-Feb-2012 08:01
This function also sends a 500 response code back to the client with the request.
This was causing issues with an Apache Axis 1.2 client I had so I instead implemented by own fault handling:

<?php
header
("Content-Type: text/xml");
header("Status: 200");
die(
"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\"http://schemas.xmlsoap.org/soap/envelope/\\">
 
<SOAP-ENV:Body>
    <
SOAP-ENV:Fault>
      <
faultcode>500</faultcode>
      <
faultstring>".$ex->getMessage())."</faultstring>
    </
SOAP-ENV:Fault>
  </
SOAP-ENV:Body>
</
SOAP-ENV:Envelope>");
?>
Amr Mostafa 09-Sep-2009 06:16
This function currently terminates execution as well, which may be undesirable. See: http://bugs.php.net/bug.php?id=49513
Anonymous 16-Jul-2008 12:12
If you use Adobe Flex, Flash or AIR as SOAP client and are unable to get the error message in case of a soap fault, upgrade to PHP 5.2.6.

Details in:
http://bugs.php.net/bug.php?id=43507

 
show source | credits | sitemap | contact | advertising | mirror sites