Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

is_soap_fault(3) [php man page]

IS_SOAP_FAULT(3)							 1							  IS_SOAP_FAULT(3)

is_soap_fault - Checks if a SOAP call has failed

SYNOPSIS
bool is_soap_fault (mixed $object) DESCRIPTION
This function is useful to check if the SOAP call failed, but without using exceptions. To use it, create a SoapClient object with the exceptions option set to zero or FALSE. In this case, the SOAP method will return a special SoapFault object which encapsulates the fault details (faultcode, faultstring, faultactor and faultdetails). If exceptions is not set then SOAP call will throw an exception on error. is_soap_fault(3) checks if the given parameter is a SoapFault object. PARAMETERS
o $object - The object to test. RETURN VALUES
This will return TRUE on error, and FALSE otherwise. EXAMPLES
Example #1 is_soap_fault(3) example <?php $client = new SoapClient("some.wsdl", array('exceptions' => 0)); $result = $client->SomeFunction(); if (is_soap_fault($result)) { trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR); } ?> Example #2 SOAP's standard method for error reporting is exceptions <?php try { $client = new SoapClient("some.wsdl"); $result = $client->SomeFunction(/* ... */); } catch (SoapFault $fault) { trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR); } ?> SEE ALSO
SoapClient::SoapClient, SoapFault::SoapFault. PHP Documentation Group IS_SOAP_FAULT(3)

Check Out this Related Man Page

SOAP::WSDL::SOAP::Typelib::Fault11(3pm) 		User Contributed Perl Documentation		   SOAP::WSDL::SOAP::Typelib::Fault11(3pm)

NAME
SOAP::WSDL::SOAP::Typelib::Fault11 - SOAP 1.1 Fault class DESCRIPTION
Models a SOAP 1.1 Fault. SOAP::WSDL::SOAP::Typelib::Fault11 objects are false in boolean context and serialize to XML on stringification. This means you can do something like: my $soap = SOAP::WSDL::Client->new(); # ... my $result = $soap->call($method, $data); if (not $result) { die "Error calling SOAP method: ", $result->get_faultstring(); } METHODS
get_faultcode / set_faultcode Getter/setter for object's faultcode property. get_faultstring / set_faultstring Getter/setter for object's faultstring property. get_faultactor / set_faultactor Getter/setter for object's faultactor property. get_detail / set_detail Getter/setter for detail object's detail property. The detail element is a SOAP::WSDL::SOAP::Typelib::Fault11Detail object. This class is automatically loaded when using SOAP::WSDL::SOAP::Typelib::Fault11, so you can't use it separately. Any string or object not of this class will be automatically wrapped into a detail object. Note that passing a list of detail object is currently not supported (though the SOAP1.1 note allows this). LICENSE AND COPYRIGHT
Copyright 2007 Martin Kutter. All rights reserved. This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself AUTHOR
Martin Kutter <martin.kutter fen-net.de> REPOSITORY INFORMATION
$Rev: 851 $ $LastChangedBy: kutterma $ $Id: Fault11.pm 851 2009-05-15 22:45:18Z kutterma $ $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/SOAP/Typelib/Fault11.pm $ perl v5.10.1 2010-12-21 SOAP::WSDL::SOAP::Typelib::Fault11(3pm)
Man Page