diff options
author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:37 -0400 |
---|---|---|
committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:37 -0400 |
commit | 10f5b47dc7c1cf2b9a00991629f43652710322d3 (patch) | |
tree | 3b727a16f652b8042d573e90f003868ffb3b56c7 /ext/soap/tests/bugs | |
parent | 0e920280a2e04b110827bb766b9f29e3d581c4ee (diff) | |
download | php-10f5b47dc7c1cf2b9a00991629f43652710322d3.tar.gz |
Imported Upstream version 5.0.5upstream/5.0.5
Diffstat (limited to 'ext/soap/tests/bugs')
-rw-r--r-- | ext/soap/tests/bugs/bug29236.phpt | 4 | ||||
-rw-r--r-- | ext/soap/tests/bugs/bug32776.phpt | 47 | ||||
-rw-r--r-- | ext/soap/tests/bugs/bug32776.wsdl | 47 | ||||
-rwxr-xr-x | ext/soap/tests/bugs/bug32941.phpt | 41 | ||||
-rwxr-xr-x | ext/soap/tests/bugs/bug32941.wsdl | 141 |
5 files changed, 278 insertions, 2 deletions
diff --git a/ext/soap/tests/bugs/bug29236.phpt b/ext/soap/tests/bugs/bug29236.phpt index ffed483a8..674235f8e 100644 --- a/ext/soap/tests/bugs/bug29236.phpt +++ b/ext/soap/tests/bugs/bug29236.phpt @@ -3,7 +3,7 @@ Bug #29236 (memory error when wsdl-cache is enabled) --SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
-<?
+<?php
$client = new SoapClient(dirname(__FILE__)."/bug29236.wsdl");
var_dump($client->__getFunctions());
?>
@@ -17,4 +17,4 @@ array(4) { string(41) "LogoutResponse Logout(Logout $parameters)"
[3]=>
string(62) "GetSystemInfoResponse GetSystemInfo(GetSystemInfo $parameters)"
-}
\ No newline at end of file +}
diff --git a/ext/soap/tests/bugs/bug32776.phpt b/ext/soap/tests/bugs/bug32776.phpt new file mode 100644 index 000000000..fd6dcdf42 --- /dev/null +++ b/ext/soap/tests/bugs/bug32776.phpt @@ -0,0 +1,47 @@ +--TEST--
+Bug #32776 SOAP doesn't support one-way operations
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$d = null;
+
+function test($x) {
+ global $d;
+ $d = $x;
+}
+
+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(dirname(__FILE__)."/bug32776.wsdl",array("trace"=>true,"exceptions"=>false));
+var_dump($x->test("Hello"));
+var_dump($d);
+var_dump($x->__getLastRequest());
+var_dump($x->__getLastResponse());
+echo "ok\n";
+?>
+--EXPECT--
+NULL
+string(5) "Hello"
+string(459) "<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope 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/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:test><x xsi:type="xsd:string">Hello</x></SOAP-ENV:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+"
+string(0) ""
+ok
diff --git a/ext/soap/tests/bugs/bug32776.wsdl b/ext/soap/tests/bugs/bug32776.wsdl new file mode 100644 index 000000000..733901849 --- /dev/null +++ b/ext/soap/tests/bugs/bug32776.wsdl @@ -0,0 +1,47 @@ +<?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="TestRequest"> + <part name="x" type="xsd:string" /> + </message> + + <portType name="TestServicePortType"> + <operation name="test"> + <input message="tns:TestRequest" /> + </operation> + </portType> + + <binding name="TestServiceBinding" type="tns:TestServicePortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> + <operation name="test"> + <soap:operation soapAction="Add" style="rpc" /> + <input> + <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> + </input> + </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> diff --git a/ext/soap/tests/bugs/bug32941.phpt b/ext/soap/tests/bugs/bug32941.phpt new file mode 100755 index 000000000..5fd17df18 --- /dev/null +++ b/ext/soap/tests/bugs/bug32941.phpt @@ -0,0 +1,41 @@ +--TEST-- +Bug #32941 (Sending structured exception kills a php) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +class TestSoapClient extends SoapClient { + function __doRequest($request, $location, $action, $version) { + return <<<EOF +<?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> + <soapenv:Fault> + <faultcode>soapenv:Server.userException</faultcode> + <faultstring>service.EchoServiceException</faultstring> + <detail> + <service.EchoServiceException xsi:type="ns1:EchoServiceException" xmlns:ns1="urn:service.EchoService"> + <intParameter xsi:type="xsd:int">105</intParameter> + <parameter xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">string param</parameter> + </service.EchoServiceException> + <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">steckovic</ns2:hostname> + </detail> + </soapenv:Fault> + </soapenv:Body> +</soapenv:Envelope> +EOF; + } +} + +ini_set("soap.wsdl_cache_enabled", 1); +$client = new TestSoapClient(dirname(__FILE__).'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0)); +$ahoj = $client->echoString('exception'); +$client = new TestSoapClient(dirname(__FILE__).'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0)); +$ahoj = $client->echoString('exception'); +echo "ok\n"; +?> +--EXPECT-- +ok diff --git a/ext/soap/tests/bugs/bug32941.wsdl b/ext/soap/tests/bugs/bug32941.wsdl new file mode 100755 index 000000000..61fd13dcb --- /dev/null +++ b/ext/soap/tests/bugs/bug32941.wsdl @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://212.24.157.117:8080/axis/services/echo" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://212.24.157.117:8080/axis/services/echo" xmlns:intf="http://212.24.157.117:8080/axis/services/echo" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:service.EchoService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<!--WSDL created by Apache Axis version: 1.2RC3 +Built on Feb 28, 2005 (10:15:14 EST)-->
+ <wsdl:types>
+ <schema targetNamespace="urn:service.EchoService" xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="EchoServiceException">
+ <sequence>
+ <element name="intParameter" type="xsd:int"/>
+ <element name="parameter" nillable="true" type="soapenc:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="Person">
+ <sequence>
+ <element name="name" nillable="true" type="soapenc:string"/>
+ <element name="surname" nillable="true" type="soapenc:string"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </wsdl:types>
+ + <wsdl:message name="echoStringResponse">
+ + <wsdl:part name="echoStringReturn" type="soapenc:string"/>
+ + </wsdl:message>
+ + <wsdl:message name="EchoServiceException">
+ + <wsdl:part name="EchoServiceException" type="tns1:EchoServiceException"/>
+ + </wsdl:message>
+ + <wsdl:message name="echoStringRequest">
+ + <wsdl:part name="e" type="xsd:string"/>
+ + </wsdl:message>
+ + <wsdl:message name="echoPersonResponse">
+ + <wsdl:part name="echoPersonReturn" type="tns1:Person"/>
+ + </wsdl:message>
+ + <wsdl:message name="echoPersonRequest">
+ + <wsdl:part name="p" type="tns1:Person"/>
+ + </wsdl:message>
+ + <wsdl:portType name="EchoService">
+ + <wsdl:operation name="echoString" parameterOrder="e">
+ + <wsdl:input message="impl:echoStringRequest" name="echoStringRequest"/>
+ + <wsdl:output message="impl:echoStringResponse" name="echoStringResponse"/>
+ + <wsdl:fault message="impl:EchoServiceException" name="EchoServiceException"/>
+ + </wsdl:operation>
+ + <wsdl:operation name="echoPerson" parameterOrder="p">
+ + <wsdl:input message="impl:echoPersonRequest" name="echoPersonRequest"/>
+ + <wsdl:output message="impl:echoPersonResponse" name="echoPersonResponse"/>
+ + <wsdl:fault message="impl:EchoServiceException" name="EchoServiceException"/>
+ + </wsdl:operation>
+ + </wsdl:portType>
+ + <wsdl:binding name="echoSoapBinding" type="impl:EchoService">
+ + <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ + <wsdl:operation name="echoString">
+ + <wsdlsoap:operation soapAction=""/>
+ + <wsdl:input name="echoStringRequest">
+ + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:service.EchoService" use="encoded"/>
+ + </wsdl:input>
+ + <wsdl:output name="echoStringResponse">
+ + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
+ + </wsdl:output>
+ + <wsdl:fault name="EchoServiceException">
+ + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="EchoServiceException" namespace="urn:service.EchoService" use="encoded"/>
+ + </wsdl:fault>
+ + </wsdl:operation>
+ + <wsdl:operation name="echoPerson">
+ + <wsdlsoap:operation soapAction=""/>
+ + <wsdl:input name="echoPersonRequest">
+ + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://service" use="encoded"/>
+ + </wsdl:input>
+ + <wsdl:output name="echoPersonResponse">
+ + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
+ + </wsdl:output>
+ + <wsdl:fault name="EchoServiceException">
+ + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="EchoServiceException" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
+ + </wsdl:fault>
+ + </wsdl:operation>
+ + </wsdl:binding>
+ + <wsdl:service name="EchoServiceService">
+ + <wsdl:port binding="impl:echoSoapBinding" name="echo">
+ + <wsdlsoap:address location="http://212.24.157.117:8080/axis/services/echo"/>
+ + </wsdl:port>
+ + </wsdl:service>
+ +</wsdl:definitions>
|