Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.14.0

Bug #2694 dispatch_map not used for plain output values (does not work with gSOAP)
Submitted: 2004-11-04 22:02 UTC
From: rainer dot glaschick at c-lab dot de Assigned: yunosh
Status: Closed Package: SOAP
PHP Version: Irrelevant OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2004-11-04 22:02 UTC] rainer dot glaschick at c-lab dot de
Description: ------------ The reply generated by Server.php does not honor the dispatch_map for plain values, but always uses 'return' for plain values. Version is SOAP 0.8RC3 The relevant part of the WSDL generated by DISCO is: <message name="jetztResponse"> <part name="uhrzeit" type="xsd:string" /> </message> Reproduce code: --------------- Patch for Server.php $Id: Server.php,v 1.44.2.1 2003/12/20 21:21:59 sklar Exp $ @@ -539,11 +539,7 @@ function getReturnType($returndata) { if (is_array($returndata)) { - if (count($returndata) > 1) { - return $returndata; - } - $type = array_shift($returndata); - return $type; + return $returndata; } return false; } PHP Code used: <?php class Service { function jetzt($format) { if ($format == null || trim($format) == "") return date("H:i"); else return date($format); } var $__dispatch_map = array(); function Service() { $this->__dispatch_map["jetzt"] = array ("out" => array("uhrzeit" => "string"), "in" => array("format" => "string")); } function __dispatch($methode) { if (isset($this->__dispatch_map[$methode])) { return $this->__dispatch_map[$methode]; } else { return NUL; } } } require_once "SOAP/Server.php"; $soap = new SOAP_Server(); $service = new Service(); $soap->addObjectMap($service, "urn:Date"); if (isset($_SERVER["REQUEST_METHOD"]) && $_SERVER["REQUEST_METHOD"] == "POST") { $soap->service($HTTP_RAW_POST_DATA); } else { require_once "SOAP/Disco.php"; $disco = new SOAP_DISCO_Server($soap, "Date"); header("Content-type: text/xml"); print $disco->getWSDL(); } ?> Expected result: ---------------- <ns4:jetztResponse> <uhrzeit xsi:type="xsd:string">22:33:40</uhrzeit> </ns4:jetztResponse> Actual result: -------------- <ns4:jetztResponse> <return xsi:type="xsd:string">22:32:54</return> </ns4:jetztResponse>

Comments

 [2005-05-27 22:42 UTC] yunosh
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.