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