From:             
Operating system: Linux Ubuntu 11.04
PHP version:      5.3.6
Package:          SOAP related
Bug Type:         Bug
Bug description:SoapServer handling SoapHeader and __call method

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





-- 
Edit bug report at http://bugs.php.net/bug.php?id=54928&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=54928&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=54928&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=54928&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=54928&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54928&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=54928&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=54928&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=54928&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=54928&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=54928&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=54928&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=54928&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=54928&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=54928&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54928&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54928&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=54928&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=54928&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=54928&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=54928&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=54928&r=mysqlcfg

Reply via email to