The bundle is back!
The definition of service has changed, read the README.
This commit is contained in:
@ -18,8 +18,8 @@ class SoapAttachment
|
||||
|
||||
public function __construct($id, $type, $content)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->type = $type;
|
||||
$this->id = $id;
|
||||
$this->type = $type;
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,8 @@ class SoapHeader
|
||||
public function __construct($namespace, $name, $data)
|
||||
{
|
||||
$this->namespace = $namespace;
|
||||
$this->name = $name;
|
||||
$this->data = $data;
|
||||
$this->name = $name;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function getNamespace()
|
||||
|
@ -53,9 +53,9 @@ class SoapRequest extends Request
|
||||
{
|
||||
parent::initialize($query, $request, $attributes, $cookies, $files, $server, $content);
|
||||
|
||||
$this->soapMessage = null;
|
||||
$this->soapHeaders = new Collection('getName');
|
||||
$this->soapAttachments = new Collection('getId');
|
||||
$this->soapMessage = null;
|
||||
$this->soapHeaders = new Collection('getName', 'Bundle\WebServiceBundle\Soap\SoapHeader');
|
||||
$this->soapAttachments = new Collection('getId', 'Bundle\WebServiceBundle\Soap\SoapAttachment');
|
||||
|
||||
$this->setRequestFormat('soap');
|
||||
}
|
||||
@ -67,7 +67,7 @@ class SoapRequest extends Request
|
||||
*/
|
||||
public function getSoapMessage()
|
||||
{
|
||||
if($this->soapMessage === null) {
|
||||
if(null === $this->soapMessage) {
|
||||
$this->soapMessage = $this->initializeSoapMessage();
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ class SoapResponse extends Response
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->soapHeaders = new Collection('getName');
|
||||
$this->soapHeaders = new Collection('getName', 'Bundle\WebServiceBundle\Soap\SoapHeader');
|
||||
$this->setReturnValue($returnValue);
|
||||
}
|
||||
|
||||
|
@ -10,22 +10,14 @@
|
||||
|
||||
namespace Bundle\WebServiceBundle\Soap;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Christian Kerl <christian-kerl@web.de>
|
||||
*/
|
||||
use Bundle\WebServiceBundle\ServiceDefinition\Type;
|
||||
|
||||
use Bundle\WebServiceBundle\ServiceDefinition\Dumper\FileDumper;
|
||||
|
||||
use Bundle\WebServiceBundle\Converter\ConverterRepository;
|
||||
|
||||
use Bundle\WebServiceBundle\SoapKernel;
|
||||
|
||||
use Bundle\WebServiceBundle\ServiceDefinition\ServiceDefinition;
|
||||
use Bundle\WebServiceBundle\ServiceDefinition\Type;
|
||||
use Bundle\WebServiceBundle\Util\QName;
|
||||
|
||||
use Bundle\WebServiceBundle\ServiceDefinition\ServiceDefinition;
|
||||
|
||||
/**
|
||||
* @author Christian Kerl <christian-kerl@web.de>
|
||||
*/
|
||||
class SoapServerFactory
|
||||
{
|
||||
private $definition;
|
||||
@ -35,17 +27,17 @@ class SoapServerFactory
|
||||
public function __construct(ServiceDefinition $definition, $wsdlFile, ConverterRepository $converters)
|
||||
{
|
||||
$this->definition = $definition;
|
||||
$this->wsdlFile = $wsdlFile;
|
||||
$this->wsdlFile = $wsdlFile;
|
||||
$this->converters = $converters;
|
||||
}
|
||||
|
||||
public function create(&$request, &$response)
|
||||
public function create($request, $response)
|
||||
{
|
||||
$server = new \SoapServer(
|
||||
$this->wsdlFile,
|
||||
array(
|
||||
'classmap' => $this->createSoapServerClassmap(),
|
||||
'typemap' => $this->createSoapServerTypemap($request, $response),
|
||||
'typemap' => $this->createSoapServerTypemap($request, $response),
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
|
||||
)
|
||||
);
|
||||
@ -53,20 +45,20 @@ class SoapServerFactory
|
||||
return $server;
|
||||
}
|
||||
|
||||
private function createSoapServerTypemap(&$request, &$response)
|
||||
private function createSoapServerTypemap($request, $response)
|
||||
{
|
||||
$result = array();
|
||||
|
||||
foreach($this->converters->getTypeConverters() as $typeConverter) {
|
||||
$result[] = array(
|
||||
'type_name' => $typeConverter->getTypeName(),
|
||||
'type_ns' => $typeConverter->getTypeNamespace(),
|
||||
'from_xml' => function($input) use (&$request, $typeConverter) {
|
||||
'type_ns' => $typeConverter->getTypeNamespace(),
|
||||
'from_xml' => function($input) use ($request, $typeConverter) {
|
||||
return $typeConverter->convertXmlToPhp($request, $input);
|
||||
},
|
||||
'to_xml' => function($input) use (&$response, $typeConverter) {
|
||||
'to_xml' => function($input) use ($response, $typeConverter) {
|
||||
return $typeConverter->convertPhpToXml($response, $input);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -93,7 +85,7 @@ class SoapServerFactory
|
||||
private function addSoapServerClassmapEntry(&$classmap, Type $type)
|
||||
{
|
||||
// TODO: fix this hack
|
||||
if($type->getXmlType() === null) return;
|
||||
if(null === $type->getXmlType()) return;
|
||||
|
||||
$xmlType = QName::fromPackedQName($type->getXmlType())->getName();
|
||||
$phpType = $type->getPhpType();
|
||||
|
Reference in New Issue
Block a user