PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Web Services » SOAP » Bug #6462

Incorrect WSDL generated

Details

Submitted2006-01-11 12:27 UTC
Fromjefimm at hotmail dot com
Assignedyunosh
StatusClosed
PackageSOAP
PHP Version4.3.8
OSLinux
Roadmaps(Not assigned)

Comments

[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

[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;
+ }
}
}