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

Bug #6462 Incorrect WSDL generated
Submitted: 2006-01-11 12:27 UTC
From: jefimm at hotmail dot com Assigned: yunosh
Status: Closed Package: SOAP
PHP Version: 4.3.8 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-01-11 12:27 UTC] jefimm at hotmail dot com
Description: ------------ The wsdl generation code does incorrect generation of the WSDL if mulitple methods present in the __dispatch_map. If 2 methods are present in the dispatch map , first with both input and output parameters, second with one parameter (either input or output) the generated wsdl contains input and output parameters for both methods tested with 0.9.1

Comments

 [2006-01-11 12:48 UTC] jefimm at hotmail dot com
The following patch can solve this: --- Disco.php.orig Wed Jan 11 14:32:02 2006 +++ Disco.php Wed Jan 11 14:38:20 2006 @@ -233,6 +233,7 @@ $method_namespace = $namespace; } // INPUT + $has_input = $has_output = false; if (isset($method_types['in']) && is_array($method_types['in'])) { $input_message =& $this->_wsdl['definitions']['message'][]; $input_message['attr']['name'] = $method_name . 'Request'; @@ -242,6 +243,7 @@ $part['attr']['name'] = $name; $part['attr']['type'] = $typens . ':' . $type; } + $has_input = true; } // OUTPUT @@ -254,6 +256,7 @@ $part['attr']['name'] = $name; $part['attr']['type'] = $typens . ':' . $type; } + $has_output = true; } // PORTTYPES @@ -261,11 +264,13 @@ $operation['attr']['name'] = $method_name; // INPUT - $operation['input']['attr']['message'] = 'tns:' + if ($has_input) + $operation['input']['attr']['message'] = 'tns:' . $input_message['attr']['name']; // OUTPUT - $operation['output']['attr']['message'] = 'tns:' + if ($has_output) + $operation['output']['attr']['message'] = 'tns:' . $output_message['attr']['name']; // BINDING @@ -275,16 +280,20 @@ $binding['soap:operation']['attr']['soapAction'] = $action; // INPUT - $binding['input']['attr'] = ''; - $binding['input']['soap:body']['attr']['use'] = 'encoded'; - $binding['input']['soap:body']['attr']['namespace'] = $method_namespace; - $binding['input']['soap:body']['attr']['encodingStyle'] = SOAP_SCHEMA_ENCODING; + if ($has_input) { + $binding['input']['attr'] = ''; + $binding['input']['soap:body']['attr']['use'] = 'encoded'; + $binding['input']['soap:body']['attr']['namespace'] = $method_namespace; + $binding['input']['soap:body']['attr']['encodingStyle'] = SOAP_SCHEMA_ENCODING; + } // OUTPUT - $binding['output']['attr'] = ''; - $binding['output']['soap:body']['attr']['use'] = 'encoded'; - $binding['output']['soap:body']['attr']['namespace'] = $method_namespace; - $binding['output']['soap:body']['attr']['encodingStyle'] = SOAP_SCHEMA_ENCODING; + if ($has_output){ + $binding['output']['attr'] = ''; + $binding['output']['soap:body']['attr']['use'] = 'encoded'; + $binding['output']['soap:body']['attr']['namespace'] = $method_namespace; + $binding['output']['soap:body']['attr']['encodingStyle'] = SOAP_SCHEMA_ENCODING; + } } }
 [2007-01-21 18:00 UTC] yunosh (Jan Schneider)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.