summaryrefslogtreecommitdiff
path: root/ext/soap/tests
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-12-18 14:39:23 +0000
committerDmitry Stogov <dmitry@php.net>2006-12-18 14:39:23 +0000
commit6e0b78cd4c5735df1f0c4a17e29773a4aa685453 (patch)
tree048f47816d5a56d174aaed2d58d4bbf54a5169d4 /ext/soap/tests
parent908b1e562d5e2a586ca721e779afedb958d92067 (diff)
downloadphp-git-6e0b78cd4c5735df1f0c4a17e29773a4aa685453.tar.gz
Fixed bug #39832 (SOAP Server: parameter not matching the WSDL specified type are set to 0)
Diffstat (limited to 'ext/soap/tests')
-rwxr-xr-xext/soap/tests/bugs/bug39832.phpt29
-rwxr-xr-xext/soap/tests/bugs/bug39832.wsdl55
2 files changed, 84 insertions, 0 deletions
diff --git a/ext/soap/tests/bugs/bug39832.phpt b/ext/soap/tests/bugs/bug39832.phpt
new file mode 100755
index 0000000000..010b2e2689
--- /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 0000000000..a71f581dd5
--- /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>