ID: 29844 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Assigned Bug Type: SOAP related Operating System: WinXP SP2 PHP Version: 5.0.1 -Assigned To: +Assigned To: dmitry
Previous Comments: ------------------------------------------------------------------------ [2004-08-26 06:29:55] [EMAIL PROTECTED] Description: ------------ I have written a simple Hello World client/server application. When I issue my request, no exception is thrown, but the result is NULL, even though the SOAP response suggests it should be otherwise. - Davey Reproduce code: --------------- Server: <?php class hello_world { /** * Say Hello to Somebody * * @param string $to The person to say Hello to * @return string The greeting */ public function hello($to) { return $this->constructMsg($to); } public function goodBye($to) { return "Goodbye $to"; } /** * Construct Greeting * * @param string $to * @return string */ private function constructMsg($to) { return 'Hello ' . $to; } } $server = new SoapServer('HelloWorld.wsdl', array('trace' => 1)); $server->setClass('hello_world'); if ($_SERVER["REQUEST_METHOD"] == "POST") { $server->handle(); } else { echo "This SOAP server can handle following functions: <br />"; $functions = $server->getFunctions(); foreach($functions as $func) { echo $func . "<br />"; } } ?> Client: <?php $client = new SoapClient('http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/HelloWorld.wsdl', array('trace' => 1)); try { echo $client->hello('davey'); echo $client->__getLastRequestHeaders(); echo "\n"; echo "\n"; echo $client->__getLastRequest(); echo "\n"; echo "\n"; echo $client->__getLastResponse(); } catch (Exception $e) { echo $e; echo "\n"; echo "\n"; echo $client->__getLastRequestHeaders(); echo "\n"; echo "\n"; echo $client->__getLastRequest(); echo "\n";echo "\n"; echo $client->__getLastResponse(); } ?> Expected result: ---------------- "Hello davey" Actual result: -------------- returns NULL Headers: POST /php-mag/shafikdavey_automaticwebservices/src/Listing%201.php HTTP/1.1 Host: davey.synapticmedia.net Connection: Keep-Alive User-Agent: PHP SOAP 0.1 Content-Type: text/xml; charset="utf-8" SOAPAction: "http://davey.synapticmedia.net/php-mag/shafikdavey_automaticwebservices/src/Listing%201.php#hello" Content-Length: 430 Request: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:Body> <to xsi:type="xsd:string">davey</to> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Response: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:Body> <helloReturn xsi:type="xsd:string">Hello davey</helloReturn> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29844&edit=1