Re: [PHP] How to catch an exception using SoapClient.

2012-08-15 Thread Ellis Antaya
like any other exception ... using a try catch block ;)

Ellis
110010100001
 Unfortunately, no one can be told what The Matrix is.  You have to see it
for yourself. 
twitter.com/floverdevel
facebook.com/ellis.antaya
google.com/profiles/ellis.antaya
linkedin.com/in/ellisantaya



On Mon, Aug 6, 2012 at 10:56 PM, James Newman 
james.new...@primalmedia.co.nz wrote:

 I was wondering how I'd catch an exception using SoapClient.



 $data = array(
 'Particular'='Payment for stuff',
  'Email' ='e phi...@newman.net.nzmail address',
  'CardNumber'=',
 '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);



[PHP] How to catch an exception using SoapClient.

2012-08-06 Thread James Newman
I was wondering how I'd catch an exception using SoapClient.



$data = array(
'Particular'='Payment for stuff',
 'Email' ='e phi...@newman.net.nzmail address',
 'CardNumber'=',
'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);