DotNet.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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-2008 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /** Zend_Soap_Client */
  22. require_once 'Zend/Soap/Client.php';
  23. if (extension_loaded('soap')) {
  24. /**
  25. * Zend_Soap_Client_Local
  26. *
  27. * Class is intended to be used with .Net Web Services.
  28. *
  29. * Important! Class is at experimental stage now.
  30. * Please leave your notes, compatiblity issues reports or
  31. * suggestions in fw-webservices@lists.zend.com or fw-general@lists.com
  32. *
  33. * @category Zend
  34. * @package Zend_Soap
  35. * @subpackage Client
  36. */
  37. class Zend_Soap_Client_DotNet extends Zend_Soap_Client
  38. {
  39. /**
  40. * Constructor
  41. *
  42. * @param string $wsdl
  43. * @param array $options
  44. */
  45. public function __construct($wsdl = null, $options = null)
  46. {
  47. // Use SOAP 1.1 as default
  48. $this->setSoapVersion(SOAP_1_1);
  49. parent::__construct($wsdl, $options);
  50. }
  51. /**
  52. * Perform arguments pre-processing
  53. *
  54. * My be overridden in descendant classes
  55. *
  56. * @param array $arguments
  57. * @throws Zend_Soap_Client_Exception
  58. */
  59. protected function _preProcessArguments($arguments)
  60. {
  61. if (count($arguments) > 1 ||
  62. (count($arguments) == 1 && !is_array(reset($arguments)))
  63. ) {
  64. require_once 'Zend/Soap/Client/Exception.php';
  65. throw new Zend_Soap_Client_Exception('.Net webservice arguments have to be grouped into array: array(\'a\' => $a, \'b\' => $b, ...).');
  66. }
  67. // Do nothing
  68. return array($arguments);
  69. }
  70. /**
  71. * Perform result pre-processing
  72. *
  73. * My be overridden in descendant classes
  74. *
  75. * @param array $arguments
  76. */
  77. protected function _preProcessResult($result)
  78. {
  79. $resultProperty = $this->getLastMethod() . 'Result';
  80. return $result->$resultProperty;
  81. }
  82. }
  83. } // end if (extension_loaded('soap')