summaryrefslogtreecommitdiff
path: root/ext/soap/tests
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
commit2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b (patch)
tree41ccc042009cba53e4ce43e727fcba4c1cfbf7f3 /ext/soap/tests
parentd29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (diff)
downloadphp-2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b.tar.gz
Imported Upstream version 5.2.2upstream/5.2.2
Diffstat (limited to 'ext/soap/tests')
-rwxr-xr-xext/soap/tests/bugs/bug34657.phpt35
-rwxr-xr-xext/soap/tests/bugs/bug36226-2.phpt121
-rwxr-xr-xext/soap/tests/bugs/bug36226-2.wsdl543
-rwxr-xr-xext/soap/tests/bugs/bug36999.phpt50
-rwxr-xr-xext/soap/tests/bugs/bug36999.wsdl48
-rwxr-xr-xext/soap/tests/bugs/bug37013.phpt58
-rwxr-xr-xext/soap/tests/bugs/bug37013.wsdl67
-rwxr-xr-xext/soap/tests/bugs/bug38536.phpt52
-rwxr-xr-xext/soap/tests/bugs/bug38536.wsdl57
-rwxr-xr-xext/soap/tests/bugs/bug39121.phpt73
-rwxr-xr-xext/soap/tests/bugs/bug39815.phpt47
-rwxr-xr-xext/soap/tests/bugs/bug39832.phpt29
-rwxr-xr-xext/soap/tests/bugs/bug39832.wsdl55
-rwxr-xr-xext/soap/tests/bugs/bug40609.phpt21
-rwxr-xr-xext/soap/tests/bugs/bug40609.wsdl26
-rwxr-xr-xext/soap/tests/bugs/bug41004.phpt36
-rwxr-xr-xext/soap/tests/bugs/bug41004.wsdl69
-rwxr-xr-xext/soap/tests/bugs/bug41097.phpt27
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt5
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt12
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt5
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt5
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt29
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt24
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt6
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt5
-rw-r--r--ext/soap/tests/schema/schema081.phpt29
-rwxr-xr-xext/soap/tests/schema/schema082.phpt31
-rwxr-xr-xext/soap/tests/schema/schema083.phpt30
-rwxr-xr-xext/soap/tests/schema/schema084.phpt31
-rwxr-xr-xext/soap/tests/schema/schema085.phpt45
-rw-r--r--ext/soap/tests/schema/test_schema.inc6
33 files changed, 1652 insertions, 27 deletions
diff --git a/ext/soap/tests/bugs/bug34657.phpt b/ext/soap/tests/bugs/bug34657.phpt
new file mode 100755
index 000000000..88f07738d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34657.phpt
@@ -0,0 +1,35 @@
+--TEST--
+Bug #34657 (If you get a communication problem when loading the WSDL, it fatal's)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+if (extension_loaded("openssl")) {
+ /*
+ when openssl loaded, tcp stream is less verbose, so some error messages are missing
+ so let's skip the test in this case
+ */
+ die("skip");
+}
+?>
+--FILE--
+<?php
+try {
+ $client = new SoapClient('http://i_dont_exist.com/some.wsdl');
+ echo "?\n";
+} catch (SoapFault $e) {
+ echo get_class($e)."\n";
+ echo $e->faultstring."\n";
+ echo "ok\n";
+} catch (Exception $e) {
+ echo get_class($e)."\n";
+}
+?>
+--EXPECTF--
+Warning: SoapClient::SoapClient(): %s %sbug34657.php on line 3
+
+Warning: SoapClient::SoapClient(http://i_dont_exist.com/some.wsdl): failed to open stream: %sbug34657.php on line 3
+
+Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "http://i_dont_exist.com/some.wsdl" in %sbug34657.php on line 3
+SoapFault
+SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://i_dont_exist.com/some.wsdl'
+ok
diff --git a/ext/soap/tests/bugs/bug36226-2.phpt b/ext/soap/tests/bugs/bug36226-2.phpt
new file mode 100755
index 000000000..5479ae9d1
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36226-2.phpt
@@ -0,0 +1,121 @@
+--TEST--
+Bug #36226 (Inconsistent handling when passing nillable arrays)
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$timestamp = "2005-11-08T11:22:07+03:00";
+$wsdl = dirname(__FILE__)."/bug36226-2.wsdl";
+
+function PostEvents($x) {
+ var_dump($x);
+ exit();
+ return $x;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('PostEvents');
+ }
+
+ function __doRequest($request, $location, $action, $version) {
+ echo "$request\n";
+ $this->server->handle($request);
+ return $response;
+ }
+}
+
+$soapClient = new TestSoapClient($wsdl,
+ array(
+ 'trace' => 1,
+ 'exceptions' => 0,
+ 'classmap' => array(
+ 'logOnEvent' => 'LogOnEvent',
+ 'logOffEvent' => 'LogOffEvent',
+ 'events' => 'IVREvents'
+ ),
+ 'features' => SOAP_SINGLE_ELEMENT_ARRAYS
+ ));
+
+$logOnEvent = null;
+//$logOnEvent = array();
+$logOffEvents[] = new LogOffEvent(34567, $timestamp, "Smoked");
+//$logOffEvents[] = new LogOffEvent(34568, $timestamp, "SmokeFree");
+$ivrEvents = new IVREvents("1.0", 101, 12345, 'IVR', $logOnEvent, $logOffEvents);
+$result = $soapClient->PostEvents($ivrEvents);
+
+class LogOffEvent {
+ public $audienceMemberId;
+ public $timestamp;
+ public $smokeStatus;
+ public $callInitiator;
+
+ function __construct($audienceMemberId, $timestamp, $smokeStatus) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ $this->smokeStatus = $smokeStatus;
+ $this->callInitiator = "IVR";
+ }
+}
+
+class LogOnEvent {
+ public $audienceMemberId;
+ public $timestamp;
+
+ function __construct($audienceMemberId, $timestamp) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ }
+}
+
+class IVREvents {
+ public $version;
+ public $activityId;
+ public $messageId;
+ public $source;
+ public $logOnEvent;
+ public $logOffEvent;
+
+ function __construct($version, $activityId, $messageId, $source, $logOnEvent=NULL, $logOffEvent=NULL) {
+ $this->version = $version;
+ $this->activityId = $activityId;
+ $this->messageId = $messageId;
+ $this->source = $source;
+ $this->logOnEvent = $logOnEvent;
+ $this->logOffEvent = $logOffEvent;
+ }
+
+}
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testurl/Message" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:ivrEvents version="1.0" activityId="101" messageId="12345" source="IVR"><ns1:logOffEvent audienceMemberId="34567" timestamp="2005-11-08T11:22:07+03:00" smokeStatus="Smoked" callInitiator="IVR"/><ns1:logOnEvent xsi:nil="true"/></ns1:ivrEvents></SOAP-ENV:Body></SOAP-ENV:Envelope>
+
+object(IVREvents)#5 (6) {
+ ["version"]=>
+ string(3) "1.0"
+ ["activityId"]=>
+ int(101)
+ ["messageId"]=>
+ int(12345)
+ ["source"]=>
+ string(3) "IVR"
+ ["logOnEvent"]=>
+ NULL
+ ["logOffEvent"]=>
+ array(1) {
+ [0]=>
+ object(LogOffEvent)#6 (4) {
+ ["audienceMemberId"]=>
+ int(34567)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ ["smokeStatus"]=>
+ string(6) "Smoked"
+ ["callInitiator"]=>
+ string(3) "IVR"
+ }
+ }
+}
diff --git a/ext/soap/tests/bugs/bug36226-2.wsdl b/ext/soap/tests/bugs/bug36226-2.wsdl
new file mode 100755
index 000000000..18c2ce3c0
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36226-2.wsdl
@@ -0,0 +1,543 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:s1="http://testurl/Events" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://testurl/Message" xmlns:s3="http://testurl/Smoker" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s4="http://testurl/AudienceMember" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://testurl/Actions" xmlns:tns="http://testurl/Service" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://testurl/Service" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Message">
+ <s:import namespace="http://testurl/Events" />
+ <s:import namespace="http://testurl/Actions" />
+ <s:element name="ivrActions" type="s0:actions" />
+ <s:complexType name="actions">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="pauseSmokerAction" type="s2:pauseSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateSmokerAction" type="s2:terminateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="activateSmokerAction" type="s2:activateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="addSmokerAction" type="s2:addSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="updateSmokerAction" type="s2:updateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="deleteSmokerAction" type="s2:deleteSmokerAction" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="Client" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractMessage" abstract="true">
+ <s:attribute default="1.0" name="version" type="s:string" />
+ <s:attribute name="activityId" type="s:unsignedLong" use="required" />
+ <s:attribute name="messageId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="events">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="authFailureEvent" type="s1:authFailureEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="logOffEvent" type="s1:logOffEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="cravingLineEvent" type="s1:cravingLineEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateEvent" type="s1:terminateEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="relapseWakeSmsReplaceEvent" type="s1:relapseWakeSmsReplaceEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="confessionLineEvent" type="s1:confessionLineEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="rfqRecordedEvent" type="s1:rfqRecordedEvent" />
+ <s:element nillable="true" minOccurs="0" maxOccurs="1" name="logOnEvent" type="s1:logOnEvent" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="ivrMessageSource">
+ <s:restriction base="s:string">
+ <s:enumeration value="IVR" />
+ <s:enumeration value="Client" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="actionResults">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="updateSmokerActionResult" type="s2:updateSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="activateSmokerActionResult" type="s2:activateSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="deleteSmokerActionResult" type="s2:deleteSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="addSmokerActionResult" type="s2:addSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="pauseSmokerActionResult" type="s2:pauseSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateSmokerActionResult" type="s2:terminateSmokerActionResult" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="eventResults">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="eventResult" type="s1:eventResult" />
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:element name="ivrActionResults" type="s0:actionResults" />
+ <s:element name="ivrEvents" type="s0:events" />
+ <s:element name="ivrEventResults" type="s0:eventResults" />
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Events">
+ <s:complexType name="authFailureEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="mobileNumber" type="s:string" />
+ <s:attribute name="line" type="s1:line" use="required" />
+ <s:attribute name="reason" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractEvent" abstract="true">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" />
+ <s:attribute name="timestamp" type="s:dateTime" use="required" />
+ </s:complexType>
+ <s:complexType name="logOnEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="cravingLineEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="selection" type="s1:cravingLineEventSelection" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="cravingLineEventSelection">
+ <s:attribute name="type" type="s1:cravingLineMessageType" use="required" />
+ <s:attribute name="msgNumber" type="s:positiveInteger" />
+ </s:complexType>
+ <s:simpleType name="cravingLineMessageType">
+ <s:restriction base="s:string">
+ <s:enumeration value="Motivational" />
+ <s:enumeration value="StressReval" />
+ <s:enumeration value="EffectReg" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="confessionLineEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="smokeStatus" type="s1:smokeStatus" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="smokeStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Smoked" />
+ <s:enumeration value="SmokeFree" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="rfqRecordedEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="logOffEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="smokeStatus" type="s1:smokeStatus" use="required" />
+ <s:attribute name="callInitiator" type="s1:callInitiator" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="callInitiator">
+ <s:restriction base="s:string">
+ <s:enumeration value="AudienceMember" />
+ <s:enumeration value="IVR" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="relapseWakeSmsReplaceEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="relapseCount" type="s:positiveInteger" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="line">
+ <s:restriction base="s:string">
+ <s:enumeration value="LogOnOffLine" />
+ <s:enumeration value="CravingLine" />
+ <s:enumeration value="ConfessionLine" />
+ <s:enumeration value="ReasonsForQuittingLine" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="eventResult">
+ <s:attribute name="success" type="s:boolean" use="required" />
+ </s:complexType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Actions">
+ <s:import namespace="http://testurl/Smoker" />
+ <s:complexType name="updateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:updateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractActionResult">
+ <s:attribute name="resultId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="pauseSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:pauseSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="pauseSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:pauseSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:pauseSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="pauseSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Paused" />
+ <s:enumeration value="NotPaused" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="pauseSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="addSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:addSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="addSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:addSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:addSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="addSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Added" />
+ <s:enumeration value="NotAdded" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="addSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="DuplicateID" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="deleteSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:deleteSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="deleteSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:deleteSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:deleteSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="deleteSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Deleted" />
+ <s:enumeration value="NotDeleted" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="deleteSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="activateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:activateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="activateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:activateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:activateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="activateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Activated" />
+ <s:enumeration value="NotActivated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="activateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="terminateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:terminateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:terminateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:terminateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="terminateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Terminated" />
+ <s:enumeration value="NotTerminated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="terminateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="updateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:updateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:updateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="updateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Updated" />
+ <s:enumeration value="NotUpdated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="updateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="pauseSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="audienceMemberID" type="s:unsignedLong" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractAction" abstract="true">
+ <s:attribute name="requestId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="addSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s3:smoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="updateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s3:smoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="deleteSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="audienceMemberID" type="s:unsignedLong" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="activateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Smoker">
+ <s:import namespace="http://testurl/AudienceMember" />
+ <s:complexType name="smoker">
+ <s:complexContent mixed="false">
+ <s:extension base="s4:ivrAudienceMember">
+ <s:attribute name="startDate" type="s:date" use="required" />
+ <s:attribute name="phase" type="s3:phase" use="required" />
+ <s:attribute name="day" type="s:positiveInteger" />
+ <s:attribute name="track" type="s3:track" use="required" />
+ <s:attribute name="status" type="s3:status" use="required" />
+ <s:attribute name="baseTime" type="s:string" />
+ <s:attribute name="sunWakeOffset" type="s:string" />
+ <s:attribute name="monWakeOffset" type="s:string" />
+ <s:attribute name="tueWakeOffset" type="s:string" />
+ <s:attribute name="wedWakeOffset" type="s:string" />
+ <s:attribute name="thuWakeOffset" type="s:string" />
+ <s:attribute name="friWakeOffset" type="s:string" />
+ <s:attribute name="satWakeOffset" type="s:string" />
+ <s:attribute name="sunSleepOffset" type="s:string" />
+ <s:attribute name="monSleepOffset" type="s:string" />
+ <s:attribute name="tueSleepOffset" type="s:string" />
+ <s:attribute name="wedSleepOffset" type="s:string" />
+ <s:attribute name="thuSleepOffset" type="s:string" />
+ <s:attribute name="friSleepOffset" type="s:string" />
+ <s:attribute name="satSleepOffset" type="s:string" />
+ <s:attribute name="sunLogOnWindowOffset" type="s:string" />
+ <s:attribute name="monLogOnWindowOffset" type="s:string" />
+ <s:attribute name="tueLogOnWindowOffset" type="s:string" />
+ <s:attribute name="wedLogOnWindowOffset" type="s:string" />
+ <s:attribute name="thuLogOnWindowOffset" type="s:string" />
+ <s:attribute name="friLogOnWindowOffset" type="s:string" />
+ <s:attribute name="satLogOnWindowOffset" type="s:string" />
+ <s:attribute name="sunLogOffWindowOffset" type="s:string" />
+ <s:attribute name="monLogOffWindowOffset" type="s:string" />
+ <s:attribute name="tueLogOffWindowOffset" type="s:string" />
+ <s:attribute name="wedLogOffWindowOffset" type="s:string" />
+ <s:attribute name="thuLogOffWindowOffset" type="s:string" />
+ <s:attribute name="friLogOffWindowOffset" type="s:string" />
+ <s:attribute name="satLogOffWindowOffset" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="phase">
+ <s:restriction base="s:string">
+ <s:enumeration value="Prep" />
+ <s:enumeration value="Quit" />
+ <s:enumeration value="Followup" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="track">
+ <s:restriction base="s:string">
+ <s:enumeration value="NRT" />
+ <s:enumeration value="NonNRT" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="status">
+ <s:restriction base="s:string">
+ <s:enumeration value="Pre-Start" />
+ <s:enumeration value="Completed" />
+ <s:enumeration value="Terminated" />
+ <s:enumeration value="Paused" />
+ <s:enumeration value="Active" />
+ </s:restriction>
+ </s:simpleType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/AudienceMember">
+ <s:import namespace="http://testurl/Smoker" />
+ <s:complexType name="ivrAudienceMember">
+ <s:attribute name="id" type="s:unsignedLong" use="required" />
+ <s:attribute name="mobileNumber" type="s:string" />
+ <s:attribute name="firstName" type="s:string" />
+ <s:attribute name="lastName" type="s:string" />
+ </s:complexType>
+ </s:schema>
+ </types>
+ <message name="PostActionsSoapIn">
+ <part name="ivrActions" element="s0:ivrActions" />
+ </message>
+ <message name="PostActionsSoapOut">
+ <part name="PostActionsResult" element="s0:ivrActionResults" />
+ </message>
+ <message name="PostEventsSoapIn">
+ <part name="ivrEvents" element="s0:ivrEvents" />
+ </message>
+ <message name="PostEventsSoapOut">
+ <part name="PostEventsResult" element="s0:ivrEventResults" />
+ </message>
+ <portType name="IVRServicePortSoap">
+ <operation name="PostActions">
+ <input message="tns:PostActionsSoapIn" />
+ <output message="tns:PostActionsSoapOut" />
+ </operation>
+ <operation name="PostEvents">
+ <input message="tns:PostEventsSoapIn" />
+ <output message="tns:PostEventsSoapOut" />
+ </operation>
+ </portType>
+ <binding name="IVRServicePortSoap" type="tns:IVRServicePortSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="PostActions">
+ <soap:operation soapAction="http://testurl/Service:postActionsIn" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="PostEvents">
+ <soap:operation soapAction="http://testurl/Service:postEventsIn" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="IVRServicePortSoap12" type="tns:IVRServicePortSoap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="PostActions">
+ <soap12:operation soapAction="http://testurl/Service:postActionsIn" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="PostEvents">
+ <soap12:operation soapAction="http://testurl/Service:postEventsIn" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="IVRServicePort">
+ <port name="IVRServicePortSoap" binding="tns:IVRServicePortSoap">
+ <soap:address location="test://" />
+ </port>
+ <port name="IVRServicePortSoap12" binding="tns:IVRServicePortSoap12">
+ <soap12:address location="test://" />
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug36999.phpt b/ext/soap/tests/bugs/bug36999.phpt
new file mode 100755
index 000000000..3ce8378b8
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36999.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Bug #36999 (xsd:long values clamped to LONG_MAX instead of using double)
+--SKIPIF--
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+
+function echoLong($num) {
+ return $num;
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl) {
+ parent::__construct($wsdl);
+ $this->server = new SoapServer($wsdl);
+ $this->server->addFunction('echoLong');
+ }
+
+ function __doRequest($request, $location, $action, $version) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$soap = new LocalSoapClient(dirname(__FILE__)."/bug36999.wsdl");
+
+function test($num) {
+ global $soap;
+ try {
+ printf("%s %0.0f\n", gettype($num), $num);
+ $ret = $soap->echoLong($num);
+ printf("%s %0.0f\n", gettype($ret), $ret);
+ } catch (SoapFault $ex) {
+ var_dump($ex);
+ }
+}
+test(3706790240);
+?>
+--EXPECTF--
+%s 3706790240
+%s 3706790240
diff --git a/ext/soap/tests/bugs/bug36999.wsdl b/ext/soap/tests/bugs/bug36999.wsdl
new file mode 100755
index 000000000..80d20b053
--- /dev/null
+++ b/ext/soap/tests/bugs/bug36999.wsdl
@@ -0,0 +1,48 @@
+<?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">
+
+ <message name="echoLongRequest">
+ <part name="x" type="xsd:long" />
+ </message>
+
+ <message name="echoLongResponse">
+ <part name="x" type="xsd:long" />
+ </message>
+
+ <portType name="TestServicePortType">
+ <operation name="echoLong">
+ <input message="tns:echoLongRequest" />
+ <output message="tns:echoLongResponse" />
+ </operation>
+ </portType>
+
+ <binding name="TestServiceBinding" type="tns:TestServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="echoLong">
+ <soap:operation 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="test://" />
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug37013.phpt b/ext/soap/tests/bugs/bug37013.phpt
new file mode 100755
index 000000000..956625030
--- /dev/null
+++ b/ext/soap/tests/bugs/bug37013.phpt
@@ -0,0 +1,58 @@
+--TEST--
+Bug #37013 (server hangs when returning circular object references)
+--SKIPIF--
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$request = <<<REQUEST
+<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
+xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+<soapenv:Body>
+<ns2:getThingWithParent
+ soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:ns2="urn:test.soapserver#"/>
+</soapenv:Body>
+
+</soapenv:Envelope>
+REQUEST;
+
+
+class ThingWithParent
+{
+ var $parent;
+ var $id;
+ var $children;
+ function __construct( $id, $parent ) {
+ $this->id = $id;
+ $this->parent = $parent;
+ }
+}
+
+
+class MultiRefTest {
+ public function getThingWithParent() {
+ $p = new ThingWithParent( 1, null );
+ $p2 = new ThingWithParent( 2, $p );
+ $p3 = new ThingWithParent( 3, $p );
+
+ $p->children = array( $p2, $p3 );
+
+ return $p2;
+ }
+}
+
+
+$server = new SoapServer(dirname(__FILE__)."/bug37013.wsdl");
+$server->setClass( "MultiRefTest");
+$server->handle( $request );
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test.soapserver#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getThingWithParentResponse><result id="ref1" xsi:type="SOAP-ENC:Struct"><parent id="ref2" xsi:type="SOAP-ENC:Struct"><parent xsi:nil="true"/><id xsi:type="xsd:int">1</id><children SOAP-ENC:arrayType="SOAP-ENC:Struct[2]" xsi:type="SOAP-ENC:Array"><item href="#ref1"/><item xsi:type="SOAP-ENC:Struct"><parent href="#ref2"/><id xsi:type="xsd:int">3</id><children xsi:nil="true"/></item></children></parent><id xsi:type="xsd:int">2</id><children xsi:nil="true"/></result></ns1:getThingWithParentResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug37013.wsdl b/ext/soap/tests/bugs/bug37013.wsdl
new file mode 100755
index 000000000..dbd77fd8d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug37013.wsdl
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="shoppingcart"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="urn:test.soapserver#"
+targetNamespace="urn:test.soapserver#"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:types="urn:test.soapserver.types#">
+
+ <!-- all datatypes will be imported to namespace types: -->
+ <types>
+ <xs:schema targetNamespace="urn:test.soapserver.types#">
+ <xs:complexType name="ThingWithParent">
+ <xs:all>
+ <xs:element name="id" type="xs:string"/>
+ <xs:element name="parent" type="types:ThingWithParent"/>
+ <xs:element name="children" type="types:ArrayOfThingWithParent"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ArrayOfThingWithParent">
+ <xs:complexContent>
+ <xs:restriction base="soapenc:Array">
+ <xs:attribute ref="soapenc:arrayType"
+ wsdl:arrayType="tns:ThingWithParent[]"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name="getThingWithParent-request"/>
+ <message name="getThingWithParent-response">
+ <part name="result" element="types:ThingWithParent"/>
+ </message>
+ <portType name="soapserver-porttype">
+ <operation name="getThingWithParent">
+ <input name="getThingWithParent-request" message="tns:getThingWithParent-request"/>
+ <output name="getThingWithParent-response" message="tns:getThingWithParent-response"/>
+ </operation>
+ </portType>
+ <binding name="soapserver-binding" type="tns:soapserver-porttype">
+ <soap:binding style="rpc"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="getThingWithParent">
+ <soap:operation soapAction="urn:test.soapserver.SoapServer#getThingWithParent"/>
+ <input>
+ <soap:body use="encoded"
+namespace="urn:test.soapserver#"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+namespace="urn:test.soapserver#"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="soapserver">
+ <!-- @binding doesn't like to be tns: -->
+ <port name="soapserver-port" binding="tns:soapserver-binding">
+ <soap:address location="xxxxxxxxxxxx"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/bugs/bug38536.phpt b/ext/soap/tests/bugs/bug38536.phpt
new file mode 100755
index 000000000..1dd84d601
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38536.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Bug #38536 (SOAP returns an array of values instead of an object)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class LocalSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ 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:ns1="http://www.grupos.com.br/ws/enturma/client">
+<SOAP-ENV:Body>
+<getClientInfoFromDomainResponse SOAP-ENC:root="1">
+ <xsd:Result xsi:type="ns1:ClientType">
+ <id xsi:type="xsd:int">2</id>
+ <address href="#i2"/>
+ </xsd:Result>
+</getClientInfoFromDomainResponse>
+<xsd:address id="i2" xsi:type="ns1:ClientAddressType" SOAP-ENC:root="0">
+ <idClient xsi:type="xsd:long">2</idClient>
+ <address href="#i3"/>
+</xsd:address>
+<address xsi:type="xsd:string" id="i3" SOAP-ENC:root="0">Test</address>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+ }
+}
+
+ini_set("soap.wsdl_cache_enabled", 0);
+$SOAPObject = new LocalSoapClient(dirname(__FILE__).'/bug38536.wsdl');
+print_r($SOAPObject->test());
+?>
+--EXPECT--
+stdClass Object
+(
+ [id] => 2
+ [address] => stdClass Object
+ (
+ [idClient] => 2
+ [address] => Test
+ )
+
+)
diff --git a/ext/soap/tests/bugs/bug38536.wsdl b/ext/soap/tests/bugs/bug38536.wsdl
new file mode 100755
index 000000000..0ef3fd43c
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38536.wsdl
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:enturma="http://www.grupos.com.br/ws/enturmaServices"
+ xmlns:clientTypes="http://www.grupos.com.br/ws/enturma/client"
+ targetNamespace="http://www.grupos.com.br/ws/enturmaServices"
+ elementFormDefault="qualified"
+ attributeFormDefault="qualified">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
+ targetNamespace="http://www.grupos.com.br/ws/enturma/client">
+ <complexType name="ClientType">
+ <sequence>
+ <element name="id" type="int"/>
+ <element name="address" type="clientTypes:ClientAddressType" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <complexType name="ClientAddressType">
+ <sequence>
+ <element name="idClient" type="int"/>
+ <element name="address" type="string" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </types>
+ <message name="testMessage" />
+ <message name="testResponse">
+ <part name="domain" type="clientTypes:ClientType"/>
+ </message>
+
+ <portType name="SessionImpl">
+ <operation name="test">
+ <input message="enturma:testMessage" />
+ <output message="enturma:testResponse" />
+ </operation>
+ </portType>
+ <binding name="SessionBind" type="enturma:SessionImpl">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="test">
+ <soap:operation soapAction="test://"/>
+ <input>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="test://"/>
+ </input>
+ <output>
+ <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="test://"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Session">
+ <port name="SessionImpl" binding="enturma:SessionBind">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug39121.phpt b/ext/soap/tests/bugs/bug39121.phpt
new file mode 100755
index 000000000..30d60fbfb
--- /dev/null
+++ b/ext/soap/tests/bugs/bug39121.phpt
@@ -0,0 +1,73 @@
+--TEST--
+Bug #39121 (Incorrect return array handling in non-wsdl soap client)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+class LocalSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <soap:Body>
+ <getDIDAreaResponse xmlns="http://didx.org/GetList">
+ <soapenc:Array soapenc:arrayType="xsd:string[2]" xsi:type="soapenc:Array">
+ <item xsi:type="xsd:string">StateCode</item>
+ <item xsi:type="xsd:string">description</item>
+ </soapenc:Array>
+ <soapenc:Array soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
+ <item xsi:type="xsd:int">241</item>
+ <item xsi:type="xsd:string">Carabobo</item>
+ </soapenc:Array>
+ <soapenc:Array soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
+ <item xsi:type="xsd:int">243</item>
+ <item xsi:type="xsd:string">Aragua and Carabobo</item>
+ </soapenc:Array>
+ <soapenc:Array soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
+ <item xsi:type="xsd:int">261</item>
+ <item xsi:type="xsd:string">Zulia</item>
+ </soapenc:Array>
+ </getDIDAreaResponse>
+ </soap:Body>
+</soap:Envelope>
+EOF;
+ }
+}
+
+$client = new LocalSoapClient(NULL, array('location'=>'test://','uri'=>'test://'));
+print_r($client->getDIDAreaResponse());
+?>
+--EXPECT--
+Array
+(
+ [Array] => Array
+ (
+ [0] => Array
+ (
+ [0] => StateCode
+ [1] => description
+ )
+
+ [1] => Array
+ (
+ [0] => 241
+ [1] => Carabobo
+ )
+
+ [2] => Array
+ (
+ [0] => 243
+ [1] => Aragua and Carabobo
+ )
+
+ [3] => Array
+ (
+ [0] => 261
+ [1] => Zulia
+ )
+
+ )
+
+)
diff --git a/ext/soap/tests/bugs/bug39815.phpt b/ext/soap/tests/bugs/bug39815.phpt
new file mode 100755
index 000000000..ced64cddf
--- /dev/null
+++ b/ext/soap/tests/bugs/bug39815.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #39815 (to_zval_double() in ext/soap/php_encoding.c is not locale-independent)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+if (!function_exists('setlocale')) die('skip setlocale() not available');
+if (!@setlocale(LC_ALL, 'sv_SE', 'sv_SE.ISO8859-1')) die('skip sv_SE locale not available');
+if (!@setlocale(LC_ALL, 'en_US', 'en_US.ISO8859-1')) die('skip en_US locale not available');
+?>
+--FILE--
+<?php
+function test(){
+ return 123.456;
+}
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('test');
+ }
+
+ function __doRequest($request, $location, $action, $version) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+$x = new LocalSoapClient(NULL,array('location'=>'test://',
+ 'uri'=>'http://testuri.org',
+ "trace"=>1));
+setlocale(LC_ALL,"sv_SE","sv_SE.ISO8859-1");
+var_dump($x->test());
+echo $x->__getLastResponse();
+setlocale(LC_ALL,"en_US","en_US.ISO8859-1");
+var_dump($x->test());
+echo $x->__getLastResponse();
+--EXPECT--
+float(123,456)
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" 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/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:float">123.456</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+float(123.456)
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" 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/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:float">123.456</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug39832.phpt b/ext/soap/tests/bugs/bug39832.phpt
new file mode 100755
index 000000000..b8510f32c
--- /dev/null
+++ b/ext/soap/tests/bugs/bug39832.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #39832 (SOAP Server: parameter not matching the WSDL specified type are set to 0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test.pl"><SOAP-ENV:Body>
+<SOAP-ENV:Test>
+<parameters priority="high">
+<ns1:NetworkErrorCode>1</ns1:NetworkErrorCode>
+</parameters>
+</SOAP-ENV:Test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+
+function Test($x) {
+ return $x->priority;
+}
+
+$x = new SoapServer(dirname(__FILE__)."/bug39832.wsdl");
+$x->addFunction("Test");
+$x->handle();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>SOAP-ERROR: Encoding: Violation of encoding rules</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug39832.wsdl b/ext/soap/tests/bugs/bug39832.wsdl
new file mode 100755
index 000000000..a71f581dd
--- /dev/null
+++ b/ext/soap/tests/bugs/bug39832.wsdl
@@ -0,0 +1,55 @@
+<?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="MessageInfoType">
+ <s:sequence>
+ <s:element name="NetworkErrorCode" type="s:integer" minOccurs="0"/>
+ </s:sequence>
+ <s:attribute name="priority" type="s0:PriorityType"/>
+ </s:complexType>
+ <s:simpleType name="PriorityType">
+ <s:restriction base="s:integer">
+ <s:minInclusive value="0"/>
+ <s:maxInclusive value="3"/>
+ </s:restriction>
+ </s:simpleType>
+ </s:schema>
+ </types>
+
+ <message name="TestSoapIn">
+ <part name="parameters" type="s0:MessageInfoType" />
+ </message>
+ <message name="TestSoapOut">
+ <part name="parameters" type="s:string" />
+ </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="rpc"/>
+ <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>
diff --git a/ext/soap/tests/bugs/bug40609.phpt b/ext/soap/tests/bugs/bug40609.phpt
new file mode 100755
index 000000000..2c96a8fa9
--- /dev/null
+++ b/ext/soap/tests/bugs/bug40609.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #40609 (Segfaults when using more than one SoapVar in a request)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled", 0);
+
+$c = new SoapClient(dirname(__FILE__)."/bug40609.wsdl", array('trace' => 1, 'exceptions' => 0));
+
+$c->update(array('symbol' => new SoapVar("<symbol>MSFT</symbol>", XSD_ANYXML),
+ 'price' => new SoapVar("<price>1000</price>", XSD_ANYXML)));
+echo $c->__getLastRequest();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://quickstart.samples/xsd"><SOAP-ENV:Body><ns1:update><symbol>MSFT</symbol><price>1000</price></ns1:update></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/bugs/bug40609.wsdl b/ext/soap/tests/bugs/bug40609.wsdl
new file mode 100755
index 000000000..0792e90b3
--- /dev/null
+++ b/ext/soap/tests/bugs/bug40609.wsdl
@@ -0,0 +1,26 @@
+<wsdl:definitions xmlns:axis2="http://quickstart.samples/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns="http://quickstart.samples/xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://quickstart.samples/"><wsdl:documentation>
+ Stock Quote Service
+ </wsdl:documentation><wsdl:types><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://quickstart.samples/xsd">
+<xs:element name="getPrice">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="symbol" nillable="true" type="xs:string" />
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="getPriceResponse">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="return" nillable="true" type="xs:double" />
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="update">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="symbol" nillable="true" type="xs:any" />
+<xs:element name="price" nillable="true" type="xs:any" />
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+</xs:schema></wsdl:types><wsdl:message name="updateMessage"><wsdl:part name="part1" element="ns:update" /></wsdl:message><wsdl:message name="getPriceMessage"><wsdl:part name="part1" element="ns:getPrice" /></wsdl:message><wsdl:message name="getPriceResponseMessage"><wsdl:part name="part1" element="ns:getPriceResponse" /></wsdl:message><wsdl:portType name="StockQuoteServicePortType"><wsdl:operation name="update"><wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:updateMessage" wsaw:Action="urn:update" /></wsdl:operation><wsdl:operation name="getPrice"><wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getPriceMessage" wsaw:Action="urn:getPrice" /><wsdl:output xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getPriceResponseMessage" wsaw:Action="http://quickstart.samples/StockQuoteServicePortType/getPriceResponse" /></wsdl:operation></wsdl:portType><wsdl:binding name="StockQuoteServiceSOAP11Binding" type="axis2:StockQuoteServicePortType"><soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /><wsdl:operation name="update"><soap:operation soapAction="urn:update" style="document" /><wsdl:input><soap:body use="literal" /></wsdl:input></wsdl:operation><wsdl:operation name="getPrice"><soap:operation soapAction="urn:getPrice" style="document" /><wsdl:input><soap:body use="literal" /></wsdl:input><wsdl:output><soap:body use="literal" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding name="StockQuoteServiceSOAP12Binding" type="axis2:StockQuoteServicePortType"><soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /><wsdl:operation name="update"><soap12:operation soapAction="urn:update" style="document" /><wsdl:input><soap12:body use="literal" /></wsdl:input></wsdl:operation><wsdl:operation name="getPrice"><soap12:operation soapAction="urn:getPrice" style="document" /><wsdl:input><soap12:body use="literal" /></wsdl:input><wsdl:output><soap12:body use="literal" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding name="StockQuoteServiceHttpBinding" type="axis2:StockQuoteServicePortType"><http:binding verb="POST" /><wsdl:operation name="update"><http:operation location="update" /><wsdl:input><mime:content type="text/xml" /></wsdl:input></wsdl:operation><wsdl:operation name="getPrice"><http:operation location="getPrice" /><wsdl:input><mime:content type="text/xml" /></wsdl:input><wsdl:output><mime:content type="text/xml" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="StockQuoteService"><wsdl:port name="StockQuoteServiceSOAP11port_http" binding="axis2:StockQuoteServiceSOAP11Binding"><soap:address location="test://" /></wsdl:port><wsdl:port name="StockQuoteServiceSOAP12port_http" binding="axis2:StockQuoteServiceSOAP12Binding"><soap12:address location="test://" /></wsdl:port><wsdl:port name="StockQuoteServiceHttpport1" binding="axis2:StockQuoteServiceHttpBinding"><http:address location="test://" /></wsdl:port></wsdl:service></wsdl:definitions> \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug41004.phpt b/ext/soap/tests/bugs/bug41004.phpt
new file mode 100755
index 000000000..7359ead38
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41004.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #41004 minOccurs="0" and null class member variable
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ini_set('soap.wsdl_cache_enabled', false);
+
+class EchoBean{
+ public $mandatoryElement;
+ public $optionalElement;
+
+}
+
+class EchoRequest{
+ public $in;
+}
+
+class EchoResponse{
+ public $out;
+}
+
+$wsdl = dirname(__FILE__)."/bug41004.wsdl";
+$classmap = array('EchoBean'=>'EchoBean','echo'=>'EchoRequest','echoResponse'=>'EchoResponse');
+$client = new SoapClient($wsdl, array('location'=>'test://',"classmap" => $classmap, 'exceptions'=>0, 'trace'=>1));
+$echo=new EchoRequest();
+$in=new EchoBean();
+$in->mandatoryElement="REV";
+$in->optionalElement=NULL;
+$echo->in=$in;
+$client->echo($echo);
+echo $client->__getLastRequest();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Formation"><SOAP-ENV:Body><ns1:echo><in><mandatoryElement>REV</mandatoryElement></in></ns1:echo></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug41004.wsdl b/ext/soap/tests/bugs/bug41004.wsdl
new file mode 100755
index 000000000..d683e5d4a
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41004.wsdl
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="urn:Formation" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Formation"
+ targetNamespace="urn:Formation">
+ <wsdl:types>
+ <xsd:schema targetNamespace="urn:Formation">
+ <xsd:element name="echo">
+ <xsd:complexType>
+ <xsd:sequence> <xsd:element name="in" type="tns:EchoBean"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="echoResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="tns:EchoBean"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:simpleType name="Product1Type">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="REV"></xsd:enumeration>
+ <xsd:enumeration value="CLA"></xsd:enumeration>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="EchoBean">
+ <xsd:sequence>
+ <xsd:element name="mandatoryElement"
+ type="tns:Product1Type">
+ </xsd:element>
+ <xsd:element name="optionalElement"
+ type="tns:Product1Type" maxOccurs="1" minOccurs="0">
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="echoRequest">
+ <wsdl:part name="parameters" element="tns:echo"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="echoResponse">
+ <wsdl:part name="parameters" element="tns:echoResponse"></wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="Formation">
+ <wsdl:operation name="echo">
+ <wsdl:input message="tns:echoRequest"></wsdl:input>
+ <wsdl:output message="tns:echoResponse"></wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="FormationServiceV1" type="tns:Formation"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="echo">
+ <soap:operation soapAction="urn:Formation/echo" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Formation">
+ <wsdl:port binding="tns:FormationServiceV1"
+ name="FormationSOAP">
+ <soap:address
+ location="http://localhost:8080/webapp/services/FormationServiceV1" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug41097.phpt b/ext/soap/tests/bugs/bug41097.phpt
new file mode 100755
index 000000000..a9cfd1414
--- /dev/null
+++ b/ext/soap/tests/bugs/bug41097.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #41097 (ext/soap returning associative array as indexed without using WSDL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test($soap, $array) {
+ $soap->test($array);
+ echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n";
+}
+
+
+$soap = new SoapClient(null, array('uri' => 'http://uri/', 'location' => 'test://', 'exceptions' => 0, 'trace' => 1));
+test($soap, array('Foo', 'Bar'));
+test($soap, array(5 => 'Foo', 10 => 'Bar'));
+test($soap, array('5' => 'Foo', '10' => 'Bar'));
+$soap->test(new SoapVar(array('Foo', 'Bar'), APACHE_MAP));
+echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n";
+$soap->test(new SoapVar(array('Foo', 'Bar'), SOAP_ENC_ARRAY));
+echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n";
+?>
+--EXPECT--
+Array
+Map
+Map
+Map
+Array
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt
index 3a2890c99..f1371511d 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt
@@ -14,7 +14,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt
index b88162cfe..702da37b9 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt
@@ -12,9 +12,10 @@ class SOAPStruct {
}
}
-$struct = new SOAPStruct('arg',34,325.325);
+$struct1 = new SOAPStruct('arg',34,325.325);
+$struct2 = new SOAPStruct('arg',34,325.325);
$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
-$client->__soapCall("echoStructArray", array(array($struct,$struct)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+$client->__soapCall("echoStructArray", array(array($struct1,$struct2)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
echo $client->__getlastrequest();
$HTTP_RAW_POST_DATA = $client->__getlastrequest();
include("round2_base.inc");
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt
index 424d7950d..dafb53065 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt
@@ -12,17 +12,21 @@ class SOAPStruct {
}
}
-$struct = new SoapVar(array(
+$struct1 = new SoapVar(array(
+ new SoapVar('arg', XSD_STRING, null, null, 'varString'),
+ new SoapVar('34', XSD_INT, null, null, 'varInt'),
+ new SoapVar('325.325', XSD_FLOAT, null, null, 'varFloat')
+ ),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
+$struct2 = new SoapVar(array(
new SoapVar('arg', XSD_STRING, null, null, 'varString'),
new SoapVar('34', XSD_INT, null, null, 'varInt'),
new SoapVar('325.325', XSD_FLOAT, null, null, 'varFloat')
),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
$param = new SoapParam(new SoapVar(array(
- $struct,
- $struct
+ $struct1,
+ $struct2
),SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd"), "inputStructArray");
-$struct = new SOAPStruct('arg',34,325.325);
$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
$client->__soapCall("echoStructArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
echo $client->__getlastrequest();
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt
index 31803f846..9ffd2e5e1 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt
@@ -12,9 +12,10 @@ class SOAPStruct {
}
}
-$struct = new SOAPStruct('arg',34,325.325);
+$struct1 = new SOAPStruct('arg',34,325.325);
+$struct2 = new SOAPStruct('arg',34,325.325);
$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
-$client->echoStructArray(array($struct,$struct));
+$client->echoStructArray(array($struct1,$struct2));
echo $client->__getlastrequest();
$HTTP_RAW_POST_DATA = $client->__getlastrequest();
include("round2_base.inc");
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt
index 9f9603607..1a670731a 100644
--- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt
@@ -11,9 +11,10 @@ class SOAPStruct {
$this->varFloat = $f;
}
}
-$struct = new SOAPStruct('arg',34,325.325);
+$struct1 = new SOAPStruct('arg',34,325.325);
+$struct2 = new SOAPStruct('arg',34,325.325);
$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import3.wsdl",array("trace"=>1,"exceptions"=>0));
-$client->echoStructArray(array($struct,$struct));
+$client->echoStructArray(array($struct1,$struct2));
echo $client->__getlastrequest();
$HTTP_RAW_POST_DATA = $client->__getlastrequest();
include("round3_groupD_import3.inc");
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt
index 224f44dc2..922d7ea2e 100644
--- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt
@@ -1,7 +1,7 @@
--TEST--
SOAP Interop Round3 GroupE List 005 (php/wsdl): echoLinkedList (cyclic)
--SKIPIF--
-<?php require_once('skipif.inc'); die('skip cyclic stuctures are not supported yet'); ?>
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
class SOAPList {
@@ -22,9 +22,9 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="1" xsi:type="ns2:List"/></child></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 id="ref1" xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child href="#ref1"/></child></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="1" xsi:type="ns2:List"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return id="ref1" xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child href="#ref1"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#7 (3) {
["varInt"]=>
int(1)
@@ -43,7 +43,28 @@ object(stdClass)#7 (3) {
["varString"]=>
string(4) "arg3"
["child"]=>
- NULL
+ object(stdClass)#7 (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ object(stdClass)#8 (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ object(stdClass)#9 (3) {
+ ["varInt"]=>
+ int(3)
+ ["varString"]=>
+ string(4) "arg3"
+ ["child"]=>
+ *RECURSION*
+ }
+ }
+ }
}
}
}
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt
index a786492df..f51c4afa1 100644
--- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt
@@ -1,7 +1,7 @@
--TEST--
SOAP Interop Round3 GroupE List 006 (php/wsdl): echoLinkedList (cyclic)
--SKIPIF--
-<?php require_once('skipif.inc'); die("skip cyclic stuctures are not supported yet"); ?>
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
class SOAPList {
@@ -22,16 +22,16 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="1" xsi:type="ns2:List"/></child></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child id="ref1" xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child href="#ref1"/></child></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="1" xsi:type="ns2:List"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child id="ref1" xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child href="#ref1"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#7 (3) {
["varInt"]=>
int(1)
["varString"]=>
string(4) "arg1"
["child"]=>
- object(stdClass)#8 (3) {
+ &object(stdClass)#8 (3) {
["varInt"]=>
int(2)
["varString"]=>
@@ -43,7 +43,21 @@ object(stdClass)#7 (3) {
["varString"]=>
string(4) "arg3"
["child"]=>
- NULL
+ object(stdClass)#8 (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ object(stdClass)#9 (3) {
+ ["varInt"]=>
+ int(3)
+ ["varString"]=>
+ string(4) "arg3"
+ ["child"]=>
+ *RECURSION*
+ }
+ }
}
}
}
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt
index eb6dd7af1..052333a27 100644
--- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt
@@ -11,9 +11,11 @@ class SOAPComplexType {
$this->varFloat = $f;
}
}
-$struct = new SOAPComplexType('arg',34,325.325);
+$struct1 = new SOAPComplexType('arg',34,325.325);
+$struct2 = new SOAPComplexType('arg',34,325.325);
+$struct3 = new SOAPComplexType('arg',34,325.325);
$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
-$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct,$struct,$struct)));
+$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct1,$struct2,$struct3)));
echo $client->__getlastrequest();
$HTTP_RAW_POST_DATA = $client->__getlastrequest();
include("round4_groupI_xsd.inc");
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt
index e0c705238..ac7de377b 100644
--- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt
@@ -11,9 +11,10 @@ class SOAPComplexType {
$this->varFloat = $f;
}
}
-$struct = new SOAPComplexType('arg',34,325.325);
+$struct1 = new SOAPComplexType('arg',34,325.325);
+$struct2 = new SOAPComplexType('arg',34,325.325);
$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
-$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct,null,$struct)));
+$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct1,null,$struct2)));
echo $client->__getlastrequest();
$HTTP_RAW_POST_DATA = $client->__getlastrequest();
include("round4_groupI_xsd.inc");
diff --git a/ext/soap/tests/schema/schema081.phpt b/ext/soap/tests/schema/schema081.phpt
new file mode 100644
index 000000000..337f08126
--- /dev/null
+++ b/ext/soap/tests/schema/schema081.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 81: SOAP 1.1 Array with SOAP_USE_XSI_ARRAY_TYPE
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),"rpc","encoded",'',SOAP_USE_XSI_ARRAY_TYPE);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema082.phpt b/ext/soap/tests/schema/schema082.phpt
new file mode 100755
index 000000000..34c4c76c2
--- /dev/null
+++ b/ext/soap/tests/schema/schema082.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 82: SOAP 1.1 Array with SOAP_USE_XSI_ARRAY_TYPE (second way)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),"rpc","encoded",'',SOAP_USE_XSI_ARRAY_TYPE);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema083.phpt b/ext/soap/tests/schema/schema083.phpt
new file mode 100755
index 000000000..854c4f9ff
--- /dev/null
+++ b/ext/soap/tests/schema/schema083.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP XML Schema 83: SOAP 1.2 Array with SOAP_USE_XSI_ARRAY_TYPE
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <attribute ref="enc12:itemType" wsdl:itemType="int"/>
+ <attribute ref="enc12:arraySize" wsdl:arraySize="*"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),"rpc","encoded",'',SOAP_USE_XSI_ARRAY_TYPE);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema084.phpt b/ext/soap/tests/schema/schema084.phpt
new file mode 100755
index 000000000..94a9551fa
--- /dev/null
+++ b/ext/soap/tests/schema/schema084.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP XML Schema 84: SOAP 1.2 Array with SOAP_USE_XSI_ARRAY_TYPE (second way)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType">
+ <complexContent>
+ <restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding">
+ <all>
+ <element name="x_item" type="int" maxOccurs="unbounded"/>
+ </all>
+ </restriction>
+ </complexContent>
+ </complexType>
+EOF;
+test_schema($schema,'type="tns:testType"',array(123,123.5),"rpc","encoded",'',SOAP_USE_XSI_ARRAY_TYPE);
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="SOAP-ENC:Array"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+array(2) {
+ [0]=>
+ int(123)
+ [1]=>
+ int(123)
+}
+ok
diff --git a/ext/soap/tests/schema/schema085.phpt b/ext/soap/tests/schema/schema085.phpt
new file mode 100755
index 000000000..9a93ac723
--- /dev/null
+++ b/ext/soap/tests/schema/schema085.phpt
@@ -0,0 +1,45 @@
+--TEST--
+SOAP XML Schema 85: Extension of complex type (elements order)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+ <complexType name="testType2">
+ <sequence>
+ <element name="int" type="int"/>
+ </sequence>
+ </complexType>
+ <complexType name="testType">
+ <complexContent>
+ <extension base="tns:testType2">
+ <sequence>
+ <element name="int2" type="int"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+EOF;
+class A {
+ public $int = 1;
+}
+
+class B extends A {
+ public $int2 = 2;
+}
+
+
+test_schema($schema,'type="tns:testType"',new B());
+echo "ok";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" 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/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">1</int><int2 xsi:type="xsd:int">2</int2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#5 (2) {
+ ["int"]=>
+ int(1)
+ ["int2"]=>
+ int(2)
+}
+ok
diff --git a/ext/soap/tests/schema/test_schema.inc b/ext/soap/tests/schema/test_schema.inc
index 23b6c8b8b..06e139b40 100644
--- a/ext/soap/tests/schema/test_schema.inc
+++ b/ext/soap/tests/schema/test_schema.inc
@@ -6,7 +6,7 @@ function test($input) {
$val = $input;
}
-function test_schema($schema,$type,$param,$style="rpc",$use="encoded", $attributeFormDefault='') {
+function test_schema($schema,$type,$param,$style="rpc",$use="encoded", $attributeFormDefault='',$features=0) {
global $HTTP_RAW_POST_DATA, $val;
$wsdl = <<<EOF
<definitions name="InteropTest"
@@ -55,8 +55,8 @@ EOF;
fwrite($f,$wsdl);
fclose($f);
ini_set("soap.wsdl_cache_enabled",0);
- $x = new SoapClient($fname, array("trace"=>1,"exceptions"=>0));
- $y = new SoapServer($fname);
+ $x = new SoapClient($fname, array("trace"=>1,"exceptions"=>0,"features"=>$features));
+ $y = new SoapServer($fname, array("features"=>$features));
$y->addfunction("test");
unlink($fname);