#45093 [NEW]: soap exceptions problem
| From: | romain dot lamarche at april-waf dot com | Date: | Mon, 26 May 2008 15:17:30 +0000 |
| Subject: | #45093 [NEW]: soap exceptions problem | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-125260@lists.php.net to get a copy of this message | ||
From: romain dot lamarche at april-waf dot com
Operating system: Windows XP
PHP version: 5.2.6
PHP Bug Type: Feature/Change Request
Bug description: soap exceptions problem
Description:
------------
I'm using php-soap as a client for webservices in WSDL mode. (webservices
in java)
When the service which is call throw a specific exception (eg MyException)
which exist in PHP and in Java (and classmap ok), the soap call throw a
"SoapFault" instead of a "MyException".
It could be very very ... very useful if PHP could map the exception to
"MyException" with all its fields, instead of throwing SoapFault with just
the message as detail.
In the soap response of the webservice, the Exception is detailled as any
other object, with all custom fields of "MyException".
Reproduce code:
---------------
class MyException extends Exception
{
protected myDetail;
public function getMyDetail()
{
return $this->myDetail;
}
public function setMyDetail($myDetail)
{
$this->myDetail = $myDetail;
}
}
(and the same in Java)
Service's pojo on the java side :
class MyService
{
public String testException() throws MyException
{
MyException e = new MyException();
e->setMyDetail("test detail");
throw e;
}
}
and the service call : (assuming the soap client with classmap
array('MyException' => MyException) :
(in PHP)
$service = new MyService();
try {
$service->testException()
} catch (MyException $e) {
echo $e->getMyDetail();
}
Expected result:
----------------
test detail
Actual result:
--------------
SoapFault exception is thrown.
--
Edit bug report at http://bugs.php.net/?id=45093&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45093&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45093&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45093&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45093&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45093&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45093&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45093&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45093&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45093&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45093&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45093&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45093&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45093&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45093&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45093&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45093&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45093&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45093&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45093&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45093&r=mysqlcfg