Commit 832357b2 authored by Jens Jacobsen's avatar Jens Jacobsen

Fix soap service

- Removed hard coded namespace string
- Added typoscript for configuring previously hard coded namespace string
- Fix usage of HTTP_RAW_POST_DATA which is not supported anymore
parent e6b3fbae
Pipeline #1705 passed with stages
in 4 minutes and 52 seconds
......@@ -45,11 +45,11 @@ require_once(ExtensionManagementUtility::extPath('ter') . 'class.tx_ter_api.php'
*/
class tx_ter_pi1 extends AbstractPlugin
{
public $cObj; // Standard cObj (parent)
public $extensionsPID; // Start page for extension records
public $repositoryDir; // Absolute path to extension repository directory
public $conf; // The FE Plugin's TS configuration
public $cObj; // Standard cObj (parent)
public $extensionsPID; // Start page for extension records
public $wsdlNamespace; // Namespace
public $repositoryDir; // Absolute path to extension repository directory
public $conf; // The FE Plugin's TS configuration
function main($content, $conf)
{
......@@ -59,6 +59,7 @@ class tx_ter_pi1 extends AbstractPlugin
$this->conf = $conf;
$this->extensionsPID = $conf['pid'];
$this->wsdlNamespace = $conf['wsdlNamespace'];
$staticConfArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ter']);
if (is_array($staticConfArr)) {
$this->repositoryDir = $staticConfArr['repositoryDir'];
......@@ -68,9 +69,9 @@ class tx_ter_pi1 extends AbstractPlugin
}
try {
$server = new SoapServer(null, ['uri' => 'http://typo3.org/soap/tx_ter', "exceptions" => true]);
$server->setClass('tx_ter_api', $this);
$server->handle($GLOBALS['HTTP_RAW_POST_DATA']);
$server = new SoapServer(null, ["uri" => $this->wsdlNamespace, "trace" => true, "exceptions" => true]);
$server->setClass(\tx_ter_api::class, $this);
$server->handle(file_get_contents("php://input"));
} catch (tx_ter_exception $e) {
/**
* @author Christian Zenker <christian.zenker@599media.de>
......@@ -123,5 +124,3 @@ class tx_ter_pi1 extends AbstractPlugin
return '';
}
}
?>
......@@ -3,4 +3,5 @@ plugin.tx_ter_pi1 {
reviewersFrontendUsergroupUid =
adminFrontendUsergroupUid = 2
mirrorsFrontendUsergroupUid =
wsdlNamespace =
}
plugin.tx_ter_pi1 {
pid = {plugin.tx_ter_pi1.pid}
reviewersFrontendUsergroupUid = {plugin.tx_ter_pi1.reviewersFrontendUsergroupUid}
adminFrontendUsergroupUid = {plugin.tx_ter_pi1.adminFrontendUsergroupUid}
mirrorsFrontendUsergroupUid = {plugin.tx_ter_pi1.mirrorsFrontendUsergroupUid}
pid = {$plugin.tx_ter_pi1.pid}
reviewersFrontendUsergroupUid = {$plugin.tx_ter_pi1.reviewersFrontendUsergroupUid}
adminFrontendUsergroupUid = {$plugin.tx_ter_pi1.adminFrontendUsergroupUid}
mirrorsFrontendUsergroupUid = {$plugin.tx_ter_pi1.mirrorsFrontendUsergroupUid}
wsdlNamespace = {$plugin.tx_ter_pi1.wsdlNamespace}
}
......@@ -35,7 +35,7 @@ define('PATH_tslib', PATH_typo3 . 'sysext/cms/tslib/');
define('PATH_typo3conf', PATH_site . 'typo3conf/');
define('TYPO3_mainDir', 'typo3/');
$serviceLocation = $_SERVER['HTTP_HOST'] . 'index.php?id=ter';
$serviceLocation = 'https://' . $_SERVER['HTTP_HOST'] . '/index.php?id=ter';
$wsdlFileName = 'tx_ter.wsdl';
if (getenv('TYPO3_CONTEXT') === 'Production/Stage') {
......
......@@ -12,3 +12,9 @@ styles.content.loginform.pid = 8
# Page ID for the soap service
plugin.tx_ter_pi1.pid = 14
# wsdl Namespace for the soap server
plugin.tx_ter_pi1.wsdlNamespace = https://extensions.typo3.org/wsdl/tx_ter/
[applicationContext = Production/Stage]
plugin.tx_ter_pi1.wsdlNamespace = https://extensions-stage.typo3.org/wsdl/tx_ter/
[global]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment