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

Bug #3317 Wrong WSDL base structure
Submitted: 2005-01-27 20:57 UTC
From: Hruska at gratex dot com Assigned: yunosh
Status: No Feedback Package: SOAP
PHP Version: 4.3.10 OS: Linux RedHat
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 40 + 19 = ?

 
 [2005-01-27 20:57 UTC] Hruska at gratex dot com
Description: ------------ Example for auto WSDL generation with DISCO server generates wrong XML. (8� characters are unrecognisable chars. I cant find where that bug incease, but i think what it's simple to correct. The same result is from SOAP version 0.7.3 and 0.8.1 too. Reproduce code: --------------- <?php require_once 'SOAP/Server.php'; // Your class class HelloServer { var $__dispatch_map = array(); function HelloServer() { // Define the signature of the dispatch map $this->__dispatch_map['sayHello'] = array('in' => array('inputString' => 'string'), 'out' => array('outputString' => 'string'), ); } // Required function by SOAP_Server function __dispatch($methodname) { if (isset($this->__dispatch_map[$methodname])) return $this->__dispatch_map[$methodname]; return NULL; } // Your function function sayHello($inputString) { return 'Hello '.$inputString; } } // Fire up PEAR::SOAP_Server $server = new SOAP_Server; // Fire up your class $helloServer = new HelloServer(); // Add your object to SOAP server (note namespace) $server->addObjectMap($helloServer,'urn:HelloServer'); // Handle SOAP requests coming is as POST data if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD']=='POST') { $server->service($HTTP_RAW_POST_DATA); } else { // Deal with WSDL / Disco here require_once 'SOAP/Disco.php'; // Create the Disco server $disco = new SOAP_DISCO_Server($server,'HelloServer'); header("Content-type: text/xml"); if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'],'wsdl')==0) { echo $disco->getWSDL(); // if we're talking http://www.example.com/index.php?wsdl } else { echo $disco->getDISCO(); } exit; } ?> Expected result: ---------------- <?xml version="1.0"?> <definitions name="HelloServer" targetNamespace="urn:HelloServer" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:HelloServer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types xmlns="http://schemas.xmlsoap.org/wsdl/"> </types> <portType name="HelloServerPort"> <operation name="sayHello"> <input message="tns:sayHelloRequest" /> <output message="tns:sayHelloResponse" /> </operation> </portType> <binding name="HelloServerBinding" type="tns:HelloServerPort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http/" /> <operation name="sayHello"> <soap:operation soapAction="urn:HelloServer#helloserver#sayHello" /> <input> <soap:body use="encoded" namespace="urn:HelloServer" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </input> <output> <soap:body use="encoded" namespace="urn:HelloServer" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </output> </operation> </binding> <service name="HelloServerService"> <documentation /> <port name="HelloServerPort" binding="tns:HelloServerBinding"> <soap:address location="http://localhost/wsdl/hello_server.php" /> </port> </service> <message name="sayHelloRequest"> <part name="inputString" type="xsd:string" /> </message> <message name="sayHelloResponse"> <part name="outputString" type="xsd:string" /> </message> </definitions> Actual result: -------------- <?xml version="1.0"?><definitions name="HelloServer" targetNamespace="urn:HelloServer" xmlns:(8�="http://schemas.xmlsoap.org/wsdl/" xmlns:(8� ="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:HelloServer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types xmlns="http://schemas.xmlsoap.org/wsdl/"> </types> <portType name="HelloServerPort"> <operation name="sayHello"> <input message="tns:sayHelloRequest" /> <output message="tns:sayHelloResponse" /> </operation> </portType> <binding name="HelloServerBinding" type="tns:HelloServerPort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http/" /> <operation name="sayHello"> <soap:operation soapAction="urn:HelloServer#helloserver#sayHello" /> <input> <soap:body use="encoded" namespace="urn:HelloServer" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </input> <output> <soap:body use="encoded" namespace="urn:HelloServer" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </output> </operation> </binding> <service name="HelloServerService"> <documentation /> <port name="HelloServerPort" binding="tns:HelloServerBinding"> <soap:address location="http://www.selekcia.com/soap/index.php" /> </port> </service> <message name="sayHelloRequest"> <part name="inputString" type="xsd:string" /> </message> <message name="sayHelloResponse"> <part name="outputString" type="xsd:string" /> </message> </definitions>

Comments

 [2005-09-16 10:33 UTC] whillas at gmail dot com
YEAH! Its completely screwed. This is a major issue man! I have a Java client typing to talk to my server and it can't understand the messages my SOAP server is sending it. This makes SOAP_Server completely useless! Is there active development on this project? Does anyone know if NuSOAP handles this properly?
 [2005-11-27 15:30 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!
 [2006-01-09 23:40 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!