php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69311 Can't override __soapCall function
Submitted: 2015-03-26 16:12 UTC Modified: 2015-09-02 02:37 UTC
From: aavindraa at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5.6.7 OS: Linux (SLES 11 SP3)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: aavindraa at gmail dot com
New email:
PHP Version: OS:

 

 [2015-03-26 16:12 UTC] aavindraa at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/soapclient.soapcall
---


I am unable to override the method __soapCall in SoapClient.

Is there something fundamental that I'm missing?

Test script:
---------------
public TestSoap extends SoapClient {
      public function __soapCall($function_name, $arguments, $options = null, $input_headers = null, &$output_headers = null)
      {
              echo "OVERRIDEN";
              exit(1);
      }
}

$myClient = new SoapClient("http://example.com/some-service.wsdl");
$myClient->someMethod();


Expected result:
----------------
THe method override should echo OVERRIDDEN and stop the script

Actual result:
--------------
The method is never called and it continues as normal

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-09 10:25 UTC] falundir at gmail dot com
Well, you should instantiate your class instead of SoapClient:

$myClient = new TestSoap("http://example.com/some-service.wsdl");
 [2015-09-02 02:37 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-09-02 02:37 UTC] cmb@php.net
> Well, you should instantiate your class instead of SoapClient:

Good catch!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 09:01:27 2025 UTC