How to catch an exception using SoapClient.

From: Date: Tue, 07 Aug 2012 02:56:00 +0000
Subject: How to catch an exception using SoapClient.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-318642@lists.php.net to get a copy of this message
I was wondering how I'd catch an exception using SoapClient. $data = array( 'Particular'=>'Payment for stuff', 'Email' =>'e <philip@newman.net.nz>mail address', 'CardNumber'=>'0000000000000000, 'CardType' =>'MC', 'CardExpiry'=>'0423', 'CardHolderName'=>'James Newman', 'CardCSC' =>'111', 'StoreCard' =>'true' ); $vars = array( 'trace' => 1, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_NONE, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS); $client = new SoapClient("http://XMLSERVICEURLws/paymentws.asmx?WSDL", $vars); #$out = $client->ListCards($text); #$this->_result = $client->ProcessPurchase($data); $this->_result = $client->ProcessAuthorise($data); #var_dump($client->__getLastRequestHeaders()); #var_dump($client->__getTypes()); print_r($this->_result);

« previous php.general (#318642) next »