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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!