refactored service definition dumper classes
This commit is contained in:
parent
ff6eca48ee
commit
aa1dfdf0f8
|
@ -14,5 +14,5 @@ use Bundle\WebServiceBundle\ServiceDefinition\ServiceDefinition;
|
||||||
|
|
||||||
interface DumperInterface
|
interface DumperInterface
|
||||||
{
|
{
|
||||||
function dumpServiceDefinition(ServiceDefinition $definition);
|
function dumpServiceDefinition(ServiceDefinition $definition, array $options = array());
|
||||||
}
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
* This file is part of the WebServiceBundle.
|
|
||||||
*
|
|
||||||
* (c) Christian Kerl <christian-kerl@web.de>
|
|
||||||
*
|
|
||||||
* This source file is subject to the MIT license that is bundled
|
|
||||||
* with this source code in the file LICENSE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Bundle\WebServiceBundle\ServiceDefinition\Dumper;
|
|
||||||
|
|
||||||
use Bundle\WebServiceBundle\ServiceDefinition\Dumper\DumperInterface;
|
|
||||||
use Bundle\WebServiceBundle\Util\Assert;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Christian Kerl <christian-kerl@web.de>
|
|
||||||
*/
|
|
||||||
abstract class FileDumper implements DumperInterface
|
|
||||||
{
|
|
||||||
protected $file;
|
|
||||||
|
|
||||||
public function __construct($file)
|
|
||||||
{
|
|
||||||
Assert::thatArgumentNotNull('file', $file);
|
|
||||||
|
|
||||||
$this->file = $file;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -22,11 +22,11 @@ use Zend\Soap\Wsdl;
|
||||||
*
|
*
|
||||||
* @author Christian Kerl <christian-kerl@web.de>
|
* @author Christian Kerl <christian-kerl@web.de>
|
||||||
*/
|
*/
|
||||||
class WsdlFileDumper extends FileDumper
|
class WsdlDumper implements DumperInterface
|
||||||
{
|
{
|
||||||
private $definition;
|
private $definition;
|
||||||
|
|
||||||
public function dumpServiceDefinition(ServiceDefinition $definition)
|
public function dumpServiceDefinition(ServiceDefinition $definition, array $options = array())
|
||||||
{
|
{
|
||||||
Assert::thatArgumentNotNull('definition', $definition);
|
Assert::thatArgumentNotNull('definition', $definition);
|
||||||
|
|
||||||
|
@ -75,13 +75,11 @@ class WsdlFileDumper extends FileDumper
|
||||||
$wsdl->addSoapOperation($bindingOperation, $this->getSoapOperationName($method));
|
$wsdl->addSoapOperation($bindingOperation, $this->getSoapOperationName($method));
|
||||||
}
|
}
|
||||||
|
|
||||||
$wsdl->dump($this->file);
|
|
||||||
|
|
||||||
$this->definition = null;
|
$this->definition = null;
|
||||||
|
|
||||||
return $this->file;
|
return $wsdl->toXml();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getPortTypeName()
|
protected function getPortTypeName()
|
||||||
{
|
{
|
||||||
return $this->definition->getName() . 'PortType';
|
return $this->definition->getName() . 'PortType';
|
Loading…
Reference in New Issue