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

Commit

Permalink
Merge commit 'refs/pull/2936/head' of github.com:zendframework/zf2 in…
Browse files Browse the repository at this point in the history
…to hotfix/ssl-case-sensitive
  • Loading branch information
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 42 deletions.
3 changes: 2 additions & 1 deletion src/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function getServiceName()


/**
* Set the location at which the WSDL file will be availabe.
* Set the location at which the WSDL file will be available.
*
* @param Uri\Uri|string $uri
* @return AutoDiscover
Expand Down Expand Up @@ -375,6 +375,7 @@ protected function _generateWsdl(array $reflectionMethods)
$uri = $this->getUri();

$serviceName = $this->getServiceName();
/** @var Wsdl $wsdl */
$wsdl = new $this->wsdlClass($serviceName, $uri, $this->strategy, $this->classMap);

// The wsdl:types element must precede all other elements (WS-I Basic Profile 1.1 R2023)
Expand Down
19 changes: 10 additions & 9 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public function getOptions()
*
* @param int $version One of the SOAP_1_1 or SOAP_1_2 constants
* @return Client
* @throws Exception\ExceptionInterface with invalid soap version argument
* @throws Exception\InvalidArgumentException with invalid soap version argument
*/
public function setSoapVersion($version)
{
Expand Down Expand Up @@ -347,7 +347,7 @@ public function getSoapVersion()
*
* @param array $classmap
* @return Client
* @throws Exception\ExceptionInterface for any invalid class in the class map
* @throws Exception\InvalidArgumentException for any invalid class in the class map
*/
public function setClassmap(array $classmap)
{
Expand Down Expand Up @@ -378,7 +378,7 @@ public function getClassmap()
*
* @param string $encoding
* @return Client
* @throws Exception\ExceptionInterface with invalid encoding argument
* @throws Exception\InvalidArgumentException with invalid encoding argument
*/
public function setEncoding($encoding)
{
Expand Down Expand Up @@ -408,7 +408,7 @@ public function getEncoding()
*
* @param string $urn
* @return boolean
* @throws Exception\ExceptionInterface on invalid URN
* @throws Exception\InvalidArgumentException on invalid URN
*/
public function validateUrn($urn)
{
Expand Down Expand Up @@ -484,7 +484,7 @@ public function getLocation()
*
* @param int $style One of the SOAP_RPC or SOAP_DOCUMENT constants
* @return Client
* @throws Exception\ExceptionInterface with invalid style argument
* @throws Exception\InvalidArgumentException with invalid style argument
*/
public function setStyle($style)
{
Expand Down Expand Up @@ -514,7 +514,7 @@ public function getStyle()
*
* @param int $use One of the SOAP_ENCODED or SOAP_LITERAL constants
* @return Client
* @throws Exception\ExceptionInterface with invalid message encoding method argument
* @throws Exception\InvalidArgumentException with invalid message encoding method argument
*/
public function setEncodingMethod($use)
{
Expand Down Expand Up @@ -684,7 +684,7 @@ public function setProxyPassword($proxyPassword)
*
* @param string $localCert local certificate path
* @return Client
* @throws Exception\ExceptionInterface with invalid local certificate path argument
* @throws Exception\InvalidArgumentException with invalid local certificate path argument
*/
public function setHttpsCertificate($localCert)
{
Expand Down Expand Up @@ -777,6 +777,7 @@ public function getProxyPassword()
*
* @param resource $context
* @return Client
* @throws Exception\InvalidArgumentException if $context is not a valid stream resource
*/
public function setStreamContext($context)
{
Expand Down Expand Up @@ -1108,7 +1109,7 @@ public function call($method, $params = array())
* Return a list of available functions
*
* @return array
* @throws Exception\ExceptionInterface
* @throws Exception\UnexpectedValueException
*/
public function getFunctions()
{
Expand All @@ -1131,7 +1132,7 @@ public function getFunctions()
* Return a list of SOAP types
*
* @return array
* @throws Exception\ExceptionInterface
* @throws Exception\UnexpectedValueException
*/
public function getTypes()
{
Expand Down
4 changes: 1 addition & 3 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ public function setOptions($options)
case 'wsdl':
$this->setWSDL($value);
break;
case 'featues':
trigger_error(__METHOD__ . ': the option "featues" is deprecated as of 1.10.x and will be removed with 2.0.0; use "features" instead', E_USER_NOTICE);
case 'features':
$this->setSoapFeatures($value);
break;
Expand Down Expand Up @@ -630,7 +628,7 @@ public function setPersistence($mode)
/**
* Get server persistence
*
* @return Server
* @return int
*/
public function getPersistence()
{
Expand Down
1 change: 1 addition & 0 deletions src/Server/DocumentLiteralWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function __call($method, $args)
protected function _parseArguments($method, $document)
{
$reflMethod = $this->reflection->getMethod($method);
/* @var \Zend\Server\Reflection\ReflectionParameter[] $params */
$params = array();
foreach ($reflMethod->getParameters() as $param) {
$params[$param->getName()] = $param;
Expand Down
36 changes: 19 additions & 17 deletions src/Wsdl.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Zend\Soap;

use DOMNode;
use DOMDocument;
use DOMElement;
use Zend\Soap\Wsdl\ComplexTypeStrategy\ComplexTypeStrategyInterface as ComplexTypeStrategy;
Expand All @@ -24,7 +25,7 @@
class Wsdl
{
/**
* @var object DomDocument Instance
* @var DOMDocument DOM document Instance
*/
private $dom;

Expand Down Expand Up @@ -81,7 +82,7 @@ public function __construct($name, $uri, ComplexTypeStrategy $strategy = null, a

/**
* @todo change DomDocument object creation from cparsing to constructing using API
* It also should authomatically escape $name and $uri values if necessary
* It also should automatically escape $name and $uri values if necessary
*/
$wsdl = "<?xml version='1.0' ?>
<definitions name='$name' targetNamespace='$uri'
Expand All @@ -94,7 +95,7 @@ public function __construct($name, $uri, ComplexTypeStrategy $strategy = null, a
libxml_disable_entity_loader(true);
$this->dom = new DOMDocument();
if (!$this->dom->loadXML($wsdl)) {
throw new Exception\RuntimeException('Unable to create DomDocument');
throw new Exception\RuntimeException('Unable to create DOMDocument');
} else {
foreach ($this->dom->childNodes as $child) {
if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {
Expand Down Expand Up @@ -235,7 +236,7 @@ public function addPortType($name)
* @param string $input Input Message
* @param string $output Output Message
* @param string $fault Fault Message
* @return object The new operation's XML_Tree_Node for use in {@link function addDocumentation}
* @return DOMElement The new operation's XML_Tree_Node for use in {@link function addDocumentation}
*/
public function addPortOperation($portType, $name, $input = false, $output = false, $fault = false)
{
Expand Down Expand Up @@ -288,7 +289,7 @@ public function addBinding($name, $portType)
* @param array $input An array of attributes for the input element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
* @param array $output An array of attributes for the output element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
* @param array $fault An array of attributes for the fault element, allowed keys are: 'name', 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
* @return object The new Operation's XML_Tree_Node for use with {@link function addSoapOperation} and {@link function addDocumentation}
* @return DOMElement The new Operation's XML_Tree_Node for use with {@link function addSoapOperation} and {@link function addDocumentation}
*/
public function addBindingOperation($binding, $name, $input = false, $output = false, $fault = false)
{
Expand Down Expand Up @@ -355,11 +356,11 @@ public function addSoapBinding($binding, $style = 'document', $transport = 'http
/**
* Add a {@link http://www.w3.org/TR/wsdl#_soap:operation SOAP operation} to an operation element
*
* @param object $operation An operation XML_Tree_Node returned by {@link function addBindingOperation}
* @param string $soap_action SOAP Action
* @param DOMElement $binding An operation XML_Tree_Node returned by {@link function addBindingOperation}
* @param string|Uri $soap_action SOAP Action
* @return boolean
*/
public function addSoapOperation($binding, $soap_action)
public function addSoapOperation(DOMElement $binding, $soap_action)
{
if ($soap_action instanceof Uri) {
$soap_action = $soap_action->toString();
Expand All @@ -379,7 +380,7 @@ public function addSoapOperation($binding, $soap_action)
* @param string $port_name Name of the port for the service
* @param string $binding Binding for the port
* @param string $location SOAP Address for the service
* @return object The new service's XML_Tree_Node for use with {@link function addDocumentation}
* @return DOMElement The new service's XML_Tree_Node for use with {@link function addDocumentation}
*/
public function addService($name, $port_name, $binding, $location)
{
Expand Down Expand Up @@ -439,14 +440,14 @@ public function addDocumentation($input_node, $documentation)
/**
* Add WSDL Types element
*
* @param object $types A DomDocument|DomNode|DomElement|DomDocumentFragment with all the XML Schema types defined in it
* @param DOMNode $types A DOM Node with all the XML Schema types defined in it
*/
public function addTypes($types)
public function addTypes(DOMNode $types)
{
if ($types instanceof \DomDocument) {
$dom = $this->dom->importNode($types->documentElement);
if ($types instanceof DOMDocument) {
$this->dom->importNode($types->documentElement);
$this->wsdl->appendChild($types->documentElement);
} elseif ($types instanceof \DomNode || $types instanceof \DomElement || $types instanceof \DomDocumentFragment ) {
} else {
$dom = $this->dom->importNode($types);
$this->wsdl->appendChild($dom);
}
Expand Down Expand Up @@ -504,16 +505,17 @@ public function toXML()
/**
* Return DOM Document
*
* @return object DomDocum ent
* @return DOMDocument
*/
public function toDomDocument()
{
return $this->dom;
}

/**
* Echo the WSDL as XML
* Echo the WSDL as XML to stdout or save the WSDL to a file
*
* @param string $filename Filename to save the output (Optional)
* @return boolean
*/
public function dump($filename = false)
Expand All @@ -522,7 +524,7 @@ public function dump($filename = false)
echo $this->toXML();
return true;
}
return file_put_contents($filename, $this->toXML());
return (bool) file_put_contents($filename, $this->toXML());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Wsdl/ComplexTypeStrategy/DefaultComplexType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class DefaultComplexType extends AbstractComplexTypeStrategy
{
/**
* Add a complex type by recursivly using all the class properties fetched via Reflection.
* Add a complex type by recursively using all the class properties fetched via Reflection.
*
* @param string $type Name of the class to be specified
* @throws Exception\InvalidArgumentException if class does not exist
Expand Down
4 changes: 2 additions & 2 deletions test/AutoDiscoverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ public function testNoReturnIsOneWayCallInSetClass()
$wsdl = $autodiscover->toXml();

$this->assertContains(
'<operation name="pushOneWay"><documentation>@param string $message</documentation><input message="tns:pushOneWayIn"/></operation>',
'<operation name="pushOneWay"><documentation>pushOneWay</documentation><input message="tns:pushOneWayIn"/></operation>',
$wsdl
);
}
Expand All @@ -701,7 +701,7 @@ public function testNoReturnIsOneWayCallInAddFunction()
$wsdl = $autodiscover->toXml();

$this->assertContains(
'<operation name="OneWay"><documentation>@param string $message</documentation><input message="tns:OneWayIn"/></operation>',
'<operation name="OneWay"><documentation>ZendTest\Soap\TestAsset\OneWay</documentation><input message="tns:OneWayIn"/></operation>',
$wsdl
);
}
Expand Down
9 changes: 0 additions & 9 deletions test/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,6 @@ public function testHandle()
$this->assertEquals($expectedResponse, $server1->handle($request));
}

/**
* @todo Implement testRegisterFaultException().
*/
public function testRegisterFaultException()
{
$server = new Server();
Expand All @@ -665,9 +662,6 @@ public function testRegisterFaultException()
), $server->getFaultExceptions());
}

/**
* @todo Implement testDeregisterFaultException().
*/
public function testDeregisterFaultException()
{
$server = new Server();
Expand All @@ -684,9 +678,6 @@ public function testDeregisterFaultException()
$this->assertFalse($ret);
}

/**
* @todo Implement testGetFaultExceptions().
*/
public function testGetFaultExceptions()
{
$server = new Server();
Expand Down

0 comments on commit 31e6b5a

Please sign in to comment.