2010-10-05 21:44:30 +02:00
|
|
|
<?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\Soap;
|
|
|
|
|
2010-10-07 15:16:56 +02:00
|
|
|
use Bundle\WebServiceBundle\Util\Collection;
|
|
|
|
|
2010-10-05 21:44:30 +02:00
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SoapRequest.
|
|
|
|
*
|
|
|
|
* @author Christian Kerl <christian-kerl@web.de>
|
|
|
|
*/
|
|
|
|
class SoapRequest extends Request
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $rawContent;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $soapAction;
|
|
|
|
|
|
|
|
/**
|
2010-10-07 15:16:56 +02:00
|
|
|
* @var \Bundle\WebServiceBundle\Util\Collection
|
2010-10-05 21:44:30 +02:00
|
|
|
*/
|
2010-10-07 15:16:56 +02:00
|
|
|
protected $soapHeaders;
|
2010-10-05 21:44:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var unknown
|
|
|
|
*/
|
|
|
|
protected $soapArguments;
|
|
|
|
|
|
|
|
public function __construct($rawContent = null, array $query = null, array $attributes = null, array $cookies = null, array $server = null)
|
|
|
|
{
|
|
|
|
parent::__construct($query, null, $attributes, $cookies, null, $server);
|
|
|
|
|
|
|
|
$this->rawContent = $rawContent != null ? $rawContent : $this->loadRawContent();
|
2010-10-07 15:16:56 +02:00
|
|
|
|
|
|
|
$this->soapHeaders = new Collection('getName');
|
2010-10-05 21:44:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the SOAP XML content.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getRawContent()
|
|
|
|
{
|
|
|
|
return $this->rawContent;
|
|
|
|
}
|
|
|
|
|
2010-10-07 15:16:56 +02:00
|
|
|
public function getSoapHeaders()
|
|
|
|
{
|
|
|
|
return $this->soapHeaders;
|
|
|
|
}
|
|
|
|
|
2010-10-05 21:44:30 +02:00
|
|
|
/**
|
|
|
|
* Loads the plain HTTP POST data.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
protected function loadRawContent()
|
|
|
|
{
|
|
|
|
return isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : file_get_contents('php://input');
|
|
|
|
}
|
|
|
|
}
|