BeSimple/BeSimpleSoapBundle — Issue #17: Empty parts attribute for soap:body in operation
Author: joksnet
Created: 2011-11-18 13:48:39+00:00
State: open

The same problem as #16 but with other field. Here is a patch:

```patch
diff --git a/ServiceDefinition/Dumper/WsdlDumper.php b/ServiceDefinition/Dumper/WsdlDumper.php
index 97517f7..76bc35d 100644
--- a/ServiceDefinition/Dumper/WsdlDumper.php
+++ b/ServiceDefinition/Dumper/WsdlDumper.php
@@ -80,17 +80,25 @@ class WsdlDumper implements DumperInterface
);
$portOperation->setAttribute('parameterOrder', implode(' ', array_keys($requestParts)));

- $baseBinding = array(
+ $baseBinding = $inputBinding = $outputBinding = array(
'use' => 'literal',
'namespace' => $definition->getNamespace(),
'encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/',
);

+ if (!empty($requestParts)) {
+ $inputBinding['parts'] = implode(' ', array_keys($requestParts));
+ }
+
+ if (!empty($responseParts)) {
+ $outputBinding['parts'] = implode(' ', array_keys($responseParts));
+ }
+
$bindingOperation = $this->wsdl->addBindingOperation(
$binding,
$method->getName(),
- array_merge(array('parts' => implode(' ', array_keys($requestParts))), $baseBinding),
- array_merge(array('parts' => implode(' ', array_keys($responseParts))), $baseBinding)
+ $inputBinding,
+ $outputBinding
);
$bindingOperation = $this->wsdl->addBindingOperationHeader(
$bindingOperation,
```