SoapFault getMessage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm currently playing with the PHP5 SOAP extension and now have a little
problem with the exception handling.

I tried to query a NuSOAP service, which can return an error like this
(body only):

<SOAP-ENV:Body><SOAP-ENV:Fault>
<faultcode>Client</faultcode>
<faultactor>Authentication
error</faultactor>
<faultstring>You are not recognized by the
authentication process</faultstring>
<detail><soapVal
xsi:type="xsd:string"></soapVal></detail></SOAP-ENV:Fault></SOAP-ENV:Body>

This, of course, causes a SoapFault exception to be thrown, but it seems
like I can't access the error message:

$client = new
SoapClient("http://www.myweb-services.com/server/UserApps.wsdl";);

$fname = "Ali"; $lname = "Baba";
$email = "test@example.com"; $passwd = '123456789';

try {
	$myAuthenticationStruct = $client->AuthenticateUser($email, $passwd .
	"____"); var_dump($myAuthenticationStruct);
}
catch (SoapFault $f){
	var_dump($f->getMessage()); // yields string(0) ""
}

If I don't catch the SoapFault, a fatal error is issued containing the
message "You are not recognized by the authentication process", so the
information must be somewhere inside the exception. So how to access it,
except just echoing the entire exception?

I tried with yesterday's snapshot if that matters.


Thanks a lot and kind regards,
Hannes



-- 
http://hannes.kaywa.com

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux