3 changed files with 100 additions and 0 deletions
@ -0,0 +1,46 @@ |
|||
--TEST-- |
|||
Bug #34643 (wsdl default value) |
|||
--SKIPIF-- |
|||
<?php require_once('skipif.inc'); ?> |
|||
--INI-- |
|||
soap.wsdl_cache_enabled=0 |
|||
--FILE-- |
|||
<?php |
|||
ini_set("soap.wsdl_cache_enabled", 0); |
|||
|
|||
class fp { |
|||
public function get_it($opt="zzz") { |
|||
return $opt; |
|||
} |
|||
} |
|||
|
|||
class LocalSoapClient extends SoapClient { |
|||
|
|||
function __construct($wsdl, $options) { |
|||
parent::__construct($wsdl, $options); |
|||
$this->server = new SoapServer($wsdl, $options); |
|||
$this->server->setClass('fp'); |
|||
} |
|||
|
|||
function __doRequest($request, $location, $action, $version) { |
|||
ob_start(); |
|||
$this->server->handle($request); |
|||
$response = ob_get_contents(); |
|||
ob_end_clean(); |
|||
return $response; |
|||
} |
|||
|
|||
} |
|||
|
|||
$cl = new LocalSoapClient(dirname(__FILE__).'/bug34643.wsdl', array("trace"=>1)); |
|||
print_r($cl->__getFunctions()); |
|||
echo $cl->get_it("aaa")."\n"; |
|||
echo $cl->get_it()."\n"; |
|||
?> |
|||
--EXPECT-- |
|||
Array |
|||
( |
|||
[0] => string get_it(string $opt) |
|||
) |
|||
aaa |
|||
zzz |
|||
@ -0,0 +1,42 @@ |
|||
<?xml version='1.0' encoding='UTF-8'?> |
|||
<definitions name="wsdl" targetNamespace="urn:wsdl" |
|||
xmlns:typens="urn:wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
|||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" |
|||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" |
|||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" |
|||
xmlns="http://schemas.xmlsoap.org/wsdl/"> |
|||
<types> |
|||
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:wsdl"> |
|||
<xsd:element name="opt" type="xsd:string" default="zzz" /> |
|||
</xsd:schema> |
|||
</types> |
|||
<message name="get_it"> |
|||
<part name="opt" element="typens:opt"/> |
|||
</message> |
|||
<message name="get_itResponse"> |
|||
<part name="return" type="xsd:string"/> |
|||
</message> |
|||
<portType name="fpPortType"> |
|||
<operation name="get_it"> |
|||
<input message="typens:get_it"/> |
|||
<output message="typens:get_itResponse"/> |
|||
</operation> |
|||
</portType> |
|||
<binding name="fpBinding" type="typens:fpPortType"> |
|||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> |
|||
<operation name="get_it"> |
|||
<soap:operation soapAction="urn:fpAction"/> |
|||
<input> |
|||
<soap:body namespace="urn:wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> |
|||
</input> |
|||
<output> |
|||
<soap:body namespace="urn:wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> |
|||
</output> |
|||
</operation> |
|||
</binding> |
|||
<service name="wsdlService"> |
|||
<port name="fpPort" binding="typens:fpBinding"> |
|||
<soap:address location="**********"/> |
|||
</port> |
|||
</service> |
|||
</definitions> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue