| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- namespace ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap;
- use SoapClient;
- /**
- *
- * Created by PhpStorm.
- * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
- * Date: 27.08.19
- * Time: 15:47
- * Class MySoapClient
- */
- class MySoapClient extends SoapClient
- {
- /**
- * @param string $request
- * @param string $location
- * @param string $action
- * @param int $version
- * @return string
- */
- public function __doRequest($request, $location, $action, $version)
- {
- if(stripos($request, 'DistributionListActionRequest') !== false)
- {
- $request = str_replace(array('ns1:DistributionListActionRequest', 'xmlns:ns2="urn:zimbra"'), array('ns2:DistributionListActionRequest', 'xmlns:ns2="urn:zimbraAccount"'), $request);
- }
- $exception = null;
- try {
-
- $response = parent::__doRequest($request, $location, $action, $version);
-
- }
-
- catch (SoapFault $sf) {
-
- //this code was not reached
-
- $exception = $sf;
-
- }
-
- catch (Exception $e) {
-
- //nor was this code reached either
-
- $exception = $e;
-
- }
- if((isset($this->__soap_fault)) && ($this->__soap_fault != null)) {
-
- //this is where the exception from __doRequest is stored
-
- $exception = $this->__soap_fault;
- logModuleCall(
- 'zimbraEmail',
- __FUNCTION__,
- $exception,
- "Debug: response",
- $result
- );
- }
-
- return $response;
- }
- /**
- * @param string $function_name
- * @param array $arguments
- * @param array|null $options
- * @param null $input_headers
- * @param array|null $output_headers
- * @return mixed|void
- */
- public function __soapCall($function_name, array $arguments, array $options = null, $input_headers = null, array &$output_headers = null)
- {
- $response = parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
- return $response;
- }
- }
|