Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merged from zf2/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 40 changed files with 495 additions and 124 deletions.
2 changes: 1 addition & 1 deletion src/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage AutoDiscover
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down
4 changes: 2 additions & 2 deletions src/AutoDiscover/DiscoveryStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage WSDL
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -34,7 +34,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage WSDL
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface DiscoveryStrategy
Expand Down
4 changes: 2 additions & 2 deletions src/AutoDiscover/DiscoveryStrategy/ReflectionDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage WSDL
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -35,7 +35,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage WSDL
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down
26 changes: 16 additions & 10 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,24 @@
* @category Zend
* @package Zend_Soap
* @subpackage Client
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* @namespace
*/
namespace Zend\Soap;

use Zend\Server\Client as ServerClient;

/**
* \Zend\Soap\Client\Client
*
* @uses \Zend\Soap\Client\Common
* @uses \Zend\Soap\Client\Exception
* @uses \Zend\Soap\Client\Local
* @uses \Zend\Soap\Server
* @category Zend
* @package Zend_Soap
* @subpackage Client
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Client
class Client implements ServerClient
{
/**
* Encoding
Expand Down Expand Up @@ -1101,6 +1096,17 @@ public function __call($name, $arguments)
return $this->_preProcessResult($result);
}

/**
* Send an RPC request to the service for a specific method.
*
* @param string $method Name of the method we want to call.
* @param array $params List of parameters for the method.
* @return mixed Returned results.
*/
public function call($method, $params = array())
{
return call_user_func_array(array($this, '__call'), $params);
}

/**
* Return a list of available functions
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage Client
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Client/DotNet.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage Client
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Client/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage Client
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down
4 changes: 2 additions & 2 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage AutoDiscover
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -28,7 +28,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage AutoDiscover
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Exception
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/AutoDiscoverException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage AutoDiscover
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down
9 changes: 9 additions & 0 deletions src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Zend\Soap\Exception;

class BadMethodCallException
extends \BadMethodCallException
implements \Zend\Soap\Exception
{
}
4 changes: 2 additions & 2 deletions src/Exception/ServerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage Server
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -29,7 +29,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage Server
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class ServerException extends Exception
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/WsdlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage WSDL
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -31,7 +31,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage Wsdl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class WsdlException extends Exception { }
23 changes: 13 additions & 10 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage Server
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -37,7 +37,7 @@
* @category Zend
* @package Zend_Soap
* @subpackage Server
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Server implements \Zend\Server\Server
Expand Down Expand Up @@ -535,7 +535,7 @@ public function addFunction($function, $namespace = '')
*
* See {@link setObject()} to set preconfigured object instances as request handlers.
*
* @param string $class Class Name which executes SOAP Requests at endpoint.
* @param string|object $class Class name or object instance which executes SOAP Requests at endpoint.
* @return \Zend\Soap\Server
* @throws \Zend\Soap\ServerException if called more than once, or if class
* does not exist
Expand All @@ -546,6 +546,10 @@ public function setClass($class, $namespace = '', $argv = null)
throw new Exception\InvalidArgumentException('A class has already been registered with this soap server instance');
}

if (is_object($class)) {
return $this->setObject($class);
}

if (!is_string($class)) {
throw new Exception\InvalidArgumentException('Invalid class argument (' . gettype($class) . ')');
}
Expand All @@ -555,10 +559,9 @@ public function setClass($class, $namespace = '', $argv = null)
}

$this->_class = $class;
if (1 < func_num_args()) {
if (2 < func_num_args()) {
$argv = func_get_args();
array_shift($argv);
$this->_classArgs = $argv;
$this->_classArgs = array_slice($argv, 2);
}

return $this;
Expand Down Expand Up @@ -705,7 +708,7 @@ public function getLastRequest()
* @param boolean $flag
* @return \Zend\Soap\Server
*/
public function setReturnResponse($flag)
public function setReturnResponse($flag = true)
{
$this->_returnResponse = ($flag) ? true : false;
return $this;
Expand All @@ -726,7 +729,7 @@ public function getReturnResponse()
*
* @return string
*/
public function getLastResponse()
public function getResponse()
{
return $this->_response;
}
Expand Down Expand Up @@ -806,7 +809,7 @@ public function handle($request = null)
ob_start();
if($setRequestException instanceof \Exception) {
// Send SOAP fault message if we've catched exception
$soap->fault("Sender", $setRequestException->getMessage());
$soap->fault('Sender', $setRequestException->getMessage());
} else {
try {
$soap->handle($this->_request);
Expand Down Expand Up @@ -936,6 +939,6 @@ public function fault($fault = null, $code = "Receiver")
*/
public function handlePhpErrors($errno, $errstr, $errfile = null, $errline = null, array $errcontext = null)
{
throw $this->fault($errstr, "Receiver");
throw $this->fault($errstr, 'Receiver');
}
}
Loading

0 comments on commit 95c2a28

Please sign in to comment.