|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54928 SoapServer handling SoapHeader and __call method
Submitted: 2011-05-25 18:15 UTC Modified: -
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: guislain dot duthieuw at gmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.6 OS: Linux Ubuntu 11.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-05-25 18:15 UTC] guislain dot duthieuw at gmail dot com
In order to illustrate the problem, I use the test file 

Then I changed with the code at and it raised 2 warning and SoapServer::handle() returned no xml output.

The SoapServer::addSoapHeader must be called during the handle() execution. Then I had to inject the SoapServer instance inside the class used for SOAP servicing.

Please note that with this code (no more __call magic method use, a public fixed method called "test") the result is as expected.

So, the SoapServer can't handle a SoapServer::addSoapHeader() call inside a class that has the magic method __call().

Test script:
Here is the code that doesn't work :

Here is a code example (send header on destruction) that works :

Expected result:
The result should be as following (see the header content) :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1="answers" xmlns:ns2="" xmlns:xsd="" xmlns:xsi="" xmlns:SOAP-ENC="" SOAP-ENV:encodingStyle=""><SOAP-ENV:Header><ns1:everything>42</ns1:everything></SOAP-ENV:Header><SOAP-ENV:Body><ns2:testResponse><return xsi:type="xsd:string">Hello World</return></ns2:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

Actual result:
The result I obtained is :

The SoapServer raises the 2 following warnings 
PHP Warning:  Invalid callback , no array or string given in index.php on line 34
PHP Warning:  SoapServer::handle(): Function '(null)' call failed in index.php on line 34


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 27 11:03:36 2023 UTC