php.net |  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: -
Votes:1
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
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: guislain dot duthieuw at gmail dot com
New email:
PHP Version: OS:

 

 [2011-05-25 18:15 UTC] guislain dot duthieuw at gmail dot com
Description:
------------
In order to illustrate the problem, I use the test file http://svn.php.net/viewvc/php/php-src/trunk/ext/soap/tests/server021.phpt?revision=296679&view=co 

Then I changed with the code at http://pastebin.com/SV82M47K 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 http://pastebin.com/jL6c1rsK (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 :
http://pastebin.com/SV82M47K

Here is a code example (send header on destruction) that works :
http://pastebin.com/ZKnp4vPP

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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="answers" xmlns:ns2="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><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>
ok


Actual result:
--------------
The result I obtained is :
ok

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



Patches

Pull Requests

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 04:01:28 2025 UTC