mirror of
https://github.com/Icinga/icingaweb2-module-reactbundle.git
synced 2025-10-24 00:44:12 +02:00
38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Clue\React\Soap\Protocol;
|
|
|
|
use \SoapClient;
|
|
|
|
class ClientDecoder extends SoapClient
|
|
{
|
|
private $response = null;
|
|
|
|
public function __construct()
|
|
{
|
|
// to not pass actual WSDL to parent constructor
|
|
// use faked non-wsdl-mode to let every method call pass through (pseudoCall)
|
|
parent::__construct(null, array('location' => '1', 'uri' => '2'));
|
|
}
|
|
|
|
public function decode($response)
|
|
{
|
|
// temporarily save response internally for further processing
|
|
$this->response = $response;
|
|
|
|
// pretend we just invoked a SOAP function.
|
|
// internally, use the injected response to parse its results
|
|
$ret = $this->pseudoCall();
|
|
$this->response = null;
|
|
|
|
return $ret;
|
|
}
|
|
|
|
public function __doRequest($request, $location, $action, $version, $one_way = 0)
|
|
{
|
|
// the actual result doesn't actually matter, just return the given result
|
|
// this will be processed internally and will return the parsed result
|
|
return $this->response;
|
|
}
|
|
}
|