DotNet.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Soap
  17. * @subpackage Client
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /** Zend_Soap_Client */
  23. #require_once 'Zend/Soap/Client.php';
  24. if (extension_loaded('soap')) {
  25. /**
  26. * Zend_Soap_Client_Local
  27. *
  28. * Class is intended to be used with .Net Web Services.
  29. *
  30. * Important! Class is at experimental stage now.
  31. * Please leave your notes, compatiblity issues reports or
  32. * suggestions in fw-webservices@lists.zend.com or fw-general@lists.com
  33. *
  34. * @category Zend
  35. * @package Zend_Soap
  36. * @subpackage Client
  37. */
  38. class Zend_Soap_Client_DotNet extends Zend_Soap_Client
  39. {
  40. /**
  41. * Constructor
  42. *
  43. * @param string $wsdl
  44. * @param array $options
  45. */
  46. public function __construct($wsdl = null, $options = null)
  47. {
  48. // Use SOAP 1.1 as default
  49. $this->setSoapVersion(SOAP_1_1);
  50. parent::__construct($wsdl, $options);
  51. }
  52. /**
  53. * Perform arguments pre-processing
  54. *
  55. * My be overridden in descendant classes
  56. *
  57. * @param array $arguments
  58. * @throws Zend_Soap_Client_Exception
  59. */
  60. protected function _preProcessArguments($arguments)
  61. {
  62. if (count($arguments) > 1 ||
  63. (count($arguments) == 1 && !is_array(reset($arguments)))
  64. ) {
  65. #require_once 'Zend/Soap/Client/Exception.php';
  66. throw new Zend_Soap_Client_Exception('.Net webservice arguments have to be grouped into array: array(\'a\' => $a, \'b\' => $b, ...).');
  67. }
  68. // Do nothing
  69. return $arguments;
  70. }
  71. /**
  72. * Perform result pre-processing
  73. *
  74. * My be overridden in descendant classes
  75. *
  76. * @param array $arguments
  77. */
  78. protected function _preProcessResult($result)
  79. {
  80. $resultProperty = $this->getLastMethod() . 'Result';
  81. return $result->$resultProperty;
  82. }
  83. }
  84. } // end if (extension_loaded('soap')