MySoapClient.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. namespace ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap;
  3. use SoapClient;
  4. /**
  5. *
  6. * Created by PhpStorm.
  7. * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
  8. * Date: 27.08.19
  9. * Time: 15:47
  10. * Class MySoapClient
  11. */
  12. class MySoapClient extends SoapClient
  13. {
  14. /**
  15. * @param string $request
  16. * @param string $location
  17. * @param string $action
  18. * @param int $version
  19. * @return string
  20. */
  21. public function __doRequest($request, $location, $action, $version)
  22. {
  23. if(stripos($request, 'DistributionListActionRequest') !== false)
  24. {
  25. $request = str_replace(array('ns1:DistributionListActionRequest', 'xmlns:ns2="urn:zimbra"'), array('ns2:DistributionListActionRequest', 'xmlns:ns2="urn:zimbraAccount"'), $request);
  26. }
  27. logModuleCall(
  28. 'zimbraEmail',
  29. __FUNCTION__,
  30. [
  31. $request,
  32. $location,
  33. $action,
  34. $version
  35. ],
  36. "Debug: request, location, action, version",
  37. $this
  38. );
  39. return parent::__doRequest($request, $location, $action, $version);
  40. }
  41. /**
  42. * @param string $function_name
  43. * @param array $arguments
  44. * @param array|null $options
  45. * @param null $input_headers
  46. * @param array|null $output_headers
  47. * @return mixed|void
  48. */
  49. public function __soapCall($function_name, array $arguments, array $options = null, $input_headers = null, array &$output_headers = null)
  50. {
  51. logModuleCall(
  52. 'zimbraEmail',
  53. __FUNCTION__,
  54. [
  55. $function_name,
  56. $arguments,
  57. $options,
  58. $input_headers,
  59. $output_headers
  60. ],
  61. "Debug: function_name, arguments, options, input_headers, output_headers",
  62. $this
  63. );
  64. //todo logg
  65. return parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers); // TODO: Change the autogenerated stub
  66. }
  67. }