ID: 42010 Updated by: [EMAIL PROTECTED] Reported By: alexander at abee dot de -Status: Open +Status: Feedback Bug Type: SOAP related Operating System: Windows XP SP2 PHP Version: 5.2.3 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi Previous Comments: ------------------------------------------------------------------------ [2007-08-03 18:26:37] alexander at abee dot de Very interesting indeed! Meanwhile I don't use axis2 anymore... ------------------------------------------------------------------------ [2007-08-03 18:22:33] misam dot abbas at gmail dot com Interestingly I am getting exactly the same kind of error when I use axis2 on the server side and VB on the client side. So there is probably some bug in axis2 or we have both made the same error in configuration. Works fine on the same method call, but if different methods are called then one of them gets a NULL response. ------------------------------------------------------------------------ [2007-07-16 15:37:26] alexander at abee dot de Here are the results as they appear in the browser (just to help you as the original post is not quite readable): Expected result: (executed once) ---------------- http://www.abee.de/php/soap/expected.html Actual result: (executed while script is already running) ---------------- http://www.abee.de/php/soap/actual.html ------------------------------------------------------------------------ [2007-07-16 15:25:15] alexander at abee dot de Description: ------------ I wrote a very simple webservice using Axis2 in Java and deployed it using Apache Tomcat. The soap service contains just two functions, dummy and dummy2. Both functions just sleep for a second and then return an integer (42 and 43). When I execute the php client code below once, the output is as expected ($v1 is 42 and $v2 is 43) but when I hit reload before both calls are finished I only get a return value from the second call although "__getLastResponse()" returns a valid xml document which contains the expected result. It looks like the parsing of the xml response doesn't work correctly when multiple threads are running. Strangely this doesn't happen when I call the same method twice (ie. dummy and then dummy again in the same script) - then I get the same value in $v1 and $v2. As __getLastResponse() return the correct xml response I assume this is a php bug and not an Axis2 bug. I tried several versions of PHP including 5.1.2.2, 5.2.3 and the latest snapshot - all with the same result. Reproduce code: --------------- <?php function printResult($result, $soap) { print "<pre>\n"; print "Result :\n"; var_dump($result); print "\n"; print "Request :\n".htmlspecialchars($soap->__getLastRequest()) ."\n"; print "Response:\n".htmlspecialchars($soap->__getLastResponse())."\n"; print "</pre><br>"; } $soap = new SoapClient('http://127.0.0.1:8080/axis2/services/WebhandlerService?wsdl', array('trace' => 1)); $v1 = $soap->dummy(array('v' => '4')); printResult($v1, $soap); $v2 = $soap->dummy2(array('v' => '5')); printResult($v2, $soap); ?> Expected result: ---------------- This is the result I expect and which I get on the first call of the php script: <pre> Result : object(stdClass)#2 (1) { ["return"]=> int(42) } Request : <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://webhandler.zmi.de/xsd"><SOAP-ENV:Body><ns1:dummy><ns1:v>4</ns1:v></ns1:dummy></SOAP-ENV:Body></SOAP-ENV:Envelope> Response: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:dummyResponse xmlns:ns="http://webhandler.zmi.de/xsd"><ns:return>42</ns:return></ns:dummyResponse></soapenv:Body></soapenv:Envelope> </pre><br><pre> Result : object(stdClass)#3 (1) { ["return"]=> int(43) } Request : <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://webhandler.zmi.de/xsd"><SOAP-ENV:Body><ns1:dummy2><ns1:v>5</ns1:v></ns1:dummy2></SOAP-ENV:Body></SOAP-ENV:Envelope> Response: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:dummy2Response xmlns:ns="http://webhandler.zmi.de/xsd"><ns:return>43</ns:return></ns:dummy2Response></soapenv:Body></soapenv:Envelope> </pre><br> Actual result: -------------- This is the result I get when I hit the reload button twice: <pre> Result : NULL Request : <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://webhandler.zmi.de/xsd"><SOAP-ENV:Body><ns1:dummy><ns1:v>4</ns1:v></ns1:dummy></SOAP-ENV:Body></SOAP-ENV:Envelope> Response: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:dummy2Response xmlns:ns="http://webhandler.zmi.de/xsd"><ns:return>42</ns:return></ns:dummy2Response></soapenv:Body></soapenv:Envelope> </pre><br><pre> Result : object(stdClass)#2 (1) { ["return"]=> int(43) } Request : <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://webhandler.zmi.de/xsd"><SOAP-ENV:Body><ns1:dummy2><ns1:v>5</ns1:v></ns1:dummy2></SOAP-ENV:Body></SOAP-ENV:Envelope> Response: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:dummy2Response xmlns:ns="http://webhandler.zmi.de/xsd"><ns:return>43</ns:return></ns:dummy2Response></soapenv:Body></soapenv:Envelope> </pre><br> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42010&edit=1