|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: romain dot lamarche at april-waf dot com
New email:
PHP Version: OS:


 [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-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 04 20:01:27 2023 UTC