Discussion:
SoapClient try/catch problem
Fabio_Floripa
2008-05-13 18:14:14 UTC
Permalink
Hey All

Im having some problem on my client side
at the client code i'm doing something like this

try {
return $this->updateSoapReturn( $this->getService()->
$str_method( $this->fixSlashes($arr_param) )->{$str_method .
'Return'} );
} catch ( Exception $e ) {
$e->getmessage();
return false;
}

Well, my problem is that my WebService when trow the exceptio he use
an code
that i should get using
$e->getCode();

correct??

but that doesnt work.

i put and print_r($e) this is the print

message:protected] => You need a valid Id to load the info.
[string:private] =>
[code:protected] => 0
[file:protected] => /home/fabio/html/SOA_Lib/services/
IPXService.php
[line:protected] => 205
[trace:private] => Array
(
[0] => Array
(
[function] => __call
[class] => SoapClient
[type] => ->
[args] => Array


Please, some one have any idea?
Silvano Girardi Jr
2008-05-16 20:05:16 UTC
Permalink
Hey Fabio,
this is not a SCA problem. Its in the PHP's SOAP extension (I guess).
For some reason (which I am trying to figure out and once I do I will put
here) the faultcode is not translated into the Exception code.

In order to make this work you have to call $e->faultcode instead of
$e->getCode().

Silvano
Post by Fabio_Floripa
Hey All
Im having some problem on my client side
at the client code i'm doing something like this
try {
return $this->updateSoapReturn( $this->getService()->
$str_method( $this->fixSlashes($arr_param) )->{$str_method .
'Return'} );
} catch ( Exception $e ) {
$e->getmessage();
return false;
}
Well, my problem is that my WebService when trow the exceptio he use
an code
that i should get using
$e->getCode();
correct??
but that doesnt work.
i put and print_r($e) this is the print
message:protected] => You need a valid Id to load the info.
[string:private] =>
[code:protected] => 0
[file:protected] => /home/fabio/html/SOA_Lib/services/
IPXService.php
[line:protected] => 205
[trace:private] => Array
(
[0] => Array
(
[function] => __call
[class] => SoapClient
[type] => ->
[args] => Array
Please, some one have any idea?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...