Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Return varray / darray from ext_soap
Summary: `ext_soap` is a nest of PHP arrays and zend values: let's try to return `varray` and `darray` where we can. Reviewed By: jjgriego Differential Revision: D10446808 fbshipit-source-id: 09f5af8e7bc06b1d7b5273cdd1b5d7b9d6f28bc5
- Loading branch information
Showing
with
827 additions
and 29 deletions.
- +18 −20 hphp/runtime/ext/soap/ext_soap.cpp
- +69 −9 hphp/runtime/ext/soap/ext_soap.php
- +55 −0 hphp/test/slow/dv_array/ext_soap/1809.wsdl
- +33 −0 hphp/test/slow/dv_array/ext_soap/bug38055.php
- +13 −0 hphp/test/slow/dv_array/ext_soap/bug38055.php.expectf
- +49 −0 hphp/test/slow/dv_array/ext_soap/bug38055.wsdl
- +28 −0 hphp/test/slow/dv_array/ext_soap/config.ini
- +155 −0 hphp/test/slow/dv_array/ext_soap/ext_soap.php
- +8 −0 hphp/test/slow/dv_array/ext_soap/ext_soap.php.expect
- +8 −0 hphp/test/slow/dv_array/ext_soap/hphp_config.ini
- +15 −0 hphp/test/slow/dv_array/ext_soap/server008.php
- +7 −0 hphp/test/slow/dv_array/ext_soap/server008.php.expectf
- +55 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/1809.wsdl
- +33 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/bug38055.php
- +11 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/bug38055.php.expectf
- +49 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/bug38055.wsdl
- +29 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/config.ini
- +155 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/ext_soap.php
- +8 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/ext_soap.php.expect
- +9 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/hphp_config.ini
- +15 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/server008.php
- +5 −0 hphp/test/slow/dv_array_hack_arr/ext_soap/server008.php.expectf
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" ?> | ||
<definitions | ||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" | ||
xmlns:si="http://soapinterop.org/xsd" | ||
xmlns:tns="http://linuxsrv.home/~dmitry/soap/test.wsdl" | ||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | ||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" | ||
xmlns="http://schemas.xmlsoap.org/wsdl/" | ||
targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl"> | ||
|
||
<types> | ||
<xsd:schema targetNamespace="http://linuxsrv.home/~dmitry/soap/test.wsdl"> | ||
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> | ||
</xsd:schema> | ||
</types> | ||
|
||
<message name="AddRequest"> | ||
<part name="x" type="xsd:double" /> | ||
<part name="y" type="xsd:double" /> | ||
</message> | ||
<message name="AddResponse"> | ||
<part name="result" type="xsd:double" /> | ||
</message> | ||
|
||
<portType name="TestServicePortType"> | ||
<operation name="Add"> | ||
<input message="tns:AddRequest" /> | ||
<output message="tns:AddResponse" /> | ||
</operation> | ||
</portType> | ||
|
||
<binding name="TestServiceBinding" type="tns:TestServicePortType"> | ||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> | ||
<operation name="Add"> | ||
<soap:operation soapAction="Add" style="rpc" /> | ||
<input> | ||
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
</input> | ||
<output> | ||
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
</output> | ||
</operation> | ||
</binding> | ||
|
||
<service name="TestService"> | ||
<port name="TestServicePort" binding="tns:TestServiceBinding"> | ||
<soap:address location="http://linuxsrv.home/~dmitry/soap/soap_server.php" /> | ||
</port> | ||
</service> | ||
|
||
</definitions> |
@@ -0,0 +1,33 @@ | ||
<?hh | ||
|
||
function Test($param) { | ||
global $g1, $g2; | ||
$g1 = $param->boolA; | ||
$g2 = $param->boolB; | ||
return 1; | ||
} | ||
|
||
class TestSoapClient extends SoapClient { | ||
function __construct($wsdl) { | ||
parent::__construct($wsdl); | ||
$this->server = new SoapServer($wsdl); | ||
$this->server->addFunction('Test'); | ||
} | ||
|
||
function __doRequest($request, $location, $action, $version, $one_way = 0) { | ||
ob_start(); | ||
$this->server->handle($request); | ||
$response = ob_get_contents(); | ||
ob_end_clean(); | ||
return $response; | ||
} | ||
} | ||
|
||
$client = new TestSoapClient(dirname(__FILE__).'/bug38055.wsdl'); | ||
var_dump($client->__getfunctions()); | ||
var_dump($client->__gettypes()); | ||
$boolA = 1; | ||
$boolB = '1'; | ||
$res = $client->Test(darray['boolA'=>$boolA, 'boolB'=>$boolB]); | ||
var_dump($g1); | ||
var_dump($g2); |
@@ -0,0 +1,13 @@ | ||
array(1) { | ||
[0]=> | ||
string(26) "int Test(Test $parameters)" | ||
} | ||
array(1) { | ||
[0]=> | ||
string(47) "struct Test { | ||
boolean boolA; | ||
boolean boolB; | ||
}" | ||
} | ||
bool(true) | ||
bool(true) |
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<definitions | ||
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" | ||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | ||
xmlns:s="http://www.w3.org/2001/XMLSchema" | ||
xmlns:s0="http://test.pl" | ||
targetNamespace="http://test.pl" | ||
xmlns="http://schemas.xmlsoap.org/wsdl/"> | ||
<types> | ||
<s:schema elementFormDefault="qualified" targetNamespace="http://test.pl"> | ||
<s:complexType name="Test"> | ||
<s:attribute use="required" name="boolA" type="s:boolean"/> | ||
<s:attribute use="required" name="boolB" type="s:boolean"/> | ||
</s:complexType> | ||
<s:element type="s0:Test" name="Test"/> | ||
<s:element type="s:int" name="Ret"/> | ||
</s:schema> | ||
</types> | ||
|
||
<message name="TestSoapIn"> | ||
<part name="parameters" element="s0:Test"/> | ||
</message> | ||
<message name="TestSoapOut"> | ||
<part name="parameters" element="s0:Ret"/> | ||
</message> | ||
<portType name="TestSoap"> | ||
<operation name="Test"> | ||
<input message="s0:TestSoapIn"/> | ||
<output message="s0:TestSoapOut"/> | ||
</operation> | ||
</portType> | ||
<binding name="TestSoap" type="s0:TestSoap"> | ||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> | ||
<operation name="Test"> | ||
<soap:operation soapAction="http:/Test/Test" style="document"/> | ||
<input> | ||
<soap:body use="literal"/> | ||
</input> | ||
<output> | ||
<soap:body use="literal"/> | ||
</output> | ||
</operation> | ||
</binding> | ||
<service name="Test"> | ||
<port name="TestSoapPort" binding="s0:TestSoap"> | ||
<soap:address location="http://localhost/server.php"/> | ||
</port> | ||
</service> | ||
</definitions> |
@@ -0,0 +1,28 @@ | ||
hhvm.env_variables[HPHP_INTERPRETER] = 1 | ||
hhvm.error_handling.notice_frequency = 1 | ||
hhvm.error_handling.warning_frequency = 1 | ||
hhvm.allow_hhas = true | ||
hhvm.jit_a_size = 10485760 | ||
hhvm.jit_a_cold_size = 4194304 | ||
hhvm.jit_a_frozen_size = 6291456 | ||
hhvm.jit_a_prof_size = 6291456 | ||
hhvm.jit_global_data_size = 2097152 | ||
hhvm.thread_tc_main_buffer_size = 1048576 | ||
hhvm.thread_tc_cold_buffer_size = 1048576 | ||
hhvm.thread_tc_frozen_buffer_size = 1048576 | ||
hhvm.hack.lang.auto_typecheck = false | ||
hhvm.hack.lang.ints_overflow_to_ints = true | ||
hhvm.hack.lang.look_for_typechecker = false | ||
hhvm.http.slow_query_threshold = 0 | ||
hhvm.mysql.read_timeout = 5000 | ||
hhvm.mysql.slow_query_threshold = 0 | ||
hhvm.resource_limit.serialization_size_limit = 134217728 | ||
hhvm.server_variables[ALPHA_CONSOLE] = 1 | ||
hhvm.server_variables[TFBENV] = 16777216 | ||
hhvm.hack.lang.autoprime_generators = true | ||
hhvm.raise_missing_this = false | ||
hhvm.php7.all = false | ||
|
||
hhvm.force_hh = true | ||
hhvm.hack_arr_compat_type_hint_notices = 1 | ||
hhvm.hack_arr_compat_check_ref_bind = 1 |
Oops, something went wrong.