From 05a96310b3560f0397d62ed14746b7b7e17d47a5 Mon Sep 17 00:00:00 2001 From: Christian Kerl Date: Sat, 9 Apr 2011 00:38:39 +0200 Subject: [PATCH] fixed WsdlDumper to generate valid WSDL files --- ServiceDefinition/Dumper/WsdlDumper.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ServiceDefinition/Dumper/WsdlDumper.php b/ServiceDefinition/Dumper/WsdlDumper.php index ccc9a02..24c31cd 100644 --- a/ServiceDefinition/Dumper/WsdlDumper.php +++ b/ServiceDefinition/Dumper/WsdlDumper.php @@ -37,10 +37,10 @@ class WsdlDumper implements DumperInterface $wsdl = new Wsdl($definition->getName(), $definition->getNamespace()); $port = $wsdl->addPortType($this->getPortTypeName()); - $binding = $wsdl->addBinding($this->getBindingName(), $this->getPortTypeName()); + $binding = $wsdl->addBinding($this->getBindingName(), 'tns:' . $this->getPortTypeName()); $wsdl->addSoapBinding($binding, 'rpc'); - $wsdl->addService($this->getServiceName(), $this->getPortTypeName(), $this->getBindingName(), $options['endpoint']); + $wsdl->addService($this->getServiceName(), $this->getPortName(), 'tns:' . $this->getBindingName(), $options['endpoint']); foreach($definition->getMethods() as $method) { @@ -52,12 +52,15 @@ class WsdlDumper implements DumperInterface $requestParts[$argument->getName()] = $wsdl->getType($argument->getType()->getPhpType()); } - $responseParts['return'] = $wsdl->getType($method->getReturn()->getPhpType()); + if($method->getReturn() !== null) + { + $responseParts['return'] = $wsdl->getType($method->getReturn()->getPhpType()); + } $wsdl->addMessage($this->getRequestMessageName($method), $requestParts); $wsdl->addMessage($this->getResponseMessageName($method), $responseParts); - $portOperation = $wsdl->addPortOperation($port, $method->getName(), $this->getRequestMessageName($method), $this->getResponseMessageName($method)); + $portOperation = $wsdl->addPortOperation($port, $method->getName(), 'tns:' . $this->getRequestMessageName($method), 'tns:' . $this->getResponseMessageName($method)); $portOperation->setAttribute('parameterOrder', implode(' ', array_keys($requestParts))); $bindingInput = array( @@ -83,6 +86,11 @@ class WsdlDumper implements DumperInterface return $wsdl->toXml(); } + + protected function getPortName() + { + return $this->definition->getName() . 'Port'; + } protected function getPortTypeName() {