|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #45093 soap exceptions problem
Submitted: 2008-05-26 15:17 UTC Modified: 2016-12-31 00:34 UTC
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:1 (25.0%)
From: romain dot lamarche at april-waf dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.2.6 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
38 + 7 = ?
Subscribe to this entry?

 [2008-05-26 15:17 UTC] romain dot lamarche at april-waf dot com
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 {
} catch (MyException $e) {
  echo $e->getMyDetail();

Expected result:
test detail

Actual result:
SoapFault exception is thrown.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:34 UTC]
-Package: Feature/Change Request +Package: SOAP related
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue May 26 14:01:26 2020 UTC