|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-12-31 00:34 UTC] cmb@php.net
-Package: Feature/Change Request
+Package: SOAP related
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 05:00:01 2025 UTC |
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.