added initial support for service definition

This commit is contained in:
Christian Kerl
2010-10-07 15:16:56 +02:00
parent 783ced3b7b
commit 31d40380a6
18 changed files with 677 additions and 34 deletions

37
Soap/SoapHeader.php Normal file
View File

@ -0,0 +1,37 @@
<?php
namespace Bundle\WebServiceBundle\Soap;
class SoapHeader
{
private $namespace;
private $name;
private $data;
public function __construct($namespace, $name, $data)
{
$this->namespace = $namespace;
$this->name = $name;
$this->data = $data;
}
public function getNamespace()
{
return $this->namespace;
}
public function getName()
{
return $this->name;
}
public function getData()
{
return $this->data;
}
public function toNativeSoapHeader()
{
return new \SoapHeader($this->namespace, $this->name, $this->data);
}
}

View File

@ -10,6 +10,8 @@
namespace Bundle\WebServiceBundle\Soap;
use Bundle\WebServiceBundle\Util\Collection;
use Symfony\Component\HttpFoundation\Request;
/**
@ -30,9 +32,9 @@ class SoapRequest extends Request
protected $soapAction;
/**
* @var unknown
* @var \Bundle\WebServiceBundle\Util\Collection
*/
protected $soapHeader;
protected $soapHeaders;
/**
* @var unknown
@ -44,6 +46,8 @@ class SoapRequest extends Request
parent::__construct($query, null, $attributes, $cookies, null, $server);
$this->rawContent = $rawContent != null ? $rawContent : $this->loadRawContent();
$this->soapHeaders = new Collection('getName');
}
/**
@ -56,6 +60,11 @@ class SoapRequest extends Request
return $this->rawContent;
}
public function getSoapHeaders()
{
return $this->soapHeaders;
}
/**
* Loads the plain HTTP POST data.
*

View File

@ -10,6 +10,8 @@
namespace Bundle\WebServiceBundle\Soap;
use Bundle\WebServiceBundle\Util\Collection;
use Symfony\Component\HttpFoundation\Response;
/**
@ -19,21 +21,19 @@ use Symfony\Component\HttpFoundation\Response;
*/
class SoapResponse extends Response
{
/**
* @var \Bundle\WebServiceBundle\Util\Collection
*/
protected $soapHeaders;
protected $soapReturnValue;
public function __construct($returnValue)
public function __construct($returnValue = null)
{
parent::__construct();
$this->soapHeaders = array();
$this->soapReturnValue = $returnValue;
}
public function addSoapHeader(\SoapHeader $header)
{
$this->soapHeaders[] = $header;
$this->soapHeaders = new Collection('getName');
$this->setReturnValue($returnValue);
}
public function getSoapHeaders()
@ -41,6 +41,11 @@ class SoapResponse extends Response
return $this->soapHeaders;
}
public function setReturnValue($value)
{
$this->soapReturnValue = $value;
}
public function getReturnValue()
{
return $this->soapReturnValue;