summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-06-18 07:23:42 +0000
committerDmitry Stogov <dmitry@php.net>2008-06-18 07:23:42 +0000
commitc55fc5cfa49c73a98714956c0dff170e504d1c34 (patch)
treec783138613232b398b2875ed45ba94ad5c0334c4 /ext
parentcf6ae88c42cfc50d27ad02ede7b8bb28e5b11cc3 (diff)
downloadphp-git-c55fc5cfa49c73a98714956c0dff170e504d1c34.tar.gz
Fixed SOAP binding selection
Diffstat (limited to 'ext')
-rw-r--r--ext/soap/php_sdl.c4
-rw-r--r--ext/soap/tests/bugs/bug29109.phpt6
-rw-r--r--ext/soap/tests/bugs/multiport.phpt16
-rw-r--r--ext/soap/tests/bugs/multiport.wsdl88
4 files changed, 107 insertions, 7 deletions
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 3d4c900d12..4750ebee50 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -721,12 +721,12 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
}
trav2 = trav2->next;
}
- if (!address) {
+ if (!address || tmpbinding->bindingType == BINDING_HTTP) {
if (has_soap_port || trav->next || i < n-1) {
efree(tmpbinding);
trav = trav->next;
continue;
- } else {
+ } else if (!address) {
soap_error0(E_ERROR, "Parsing WSDL: No address associated with <port>");
}
}
diff --git a/ext/soap/tests/bugs/bug29109.phpt b/ext/soap/tests/bugs/bug29109.phpt
index 8f028d71b7..3b13974d07 100644
--- a/ext/soap/tests/bugs/bug29109.phpt
+++ b/ext/soap/tests/bugs/bug29109.phpt
@@ -10,11 +10,7 @@ $client = new SoapClient(dirname(__FILE__)."/bug29109.wsdl");
var_dump($client->__getFunctions());
?>
--EXPECT--
-array(3) {
+array(1) {
[0]=>
string(53) "HelloWorldResponse HelloWorld(HelloWorld $parameters)"
- [1]=>
- string(19) "string HelloWorld()"
- [2]=>
- string(19) "string HelloWorld()"
} \ No newline at end of file
diff --git a/ext/soap/tests/bugs/multiport.phpt b/ext/soap/tests/bugs/multiport.phpt
new file mode 100644
index 0000000000..0b5e944514
--- /dev/null
+++ b/ext/soap/tests/bugs/multiport.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Proper binding selection
+--SKIPIF--
+<?php require_once 'skipif.inc'; ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__).'/multiport.wsdl',
+ array('trace' => true, 'exceptions' => false));
+$response = $client->GetSessionId(array('userId'=>'user', 'password'=>'password'));
+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="http://www.reuters.com/"><SOAP-ENV:Body><ns1:GetSessionId><ns1:userId>user</ns1:userId><ns1:password>password</ns1:password></ns1:GetSessionId></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/multiport.wsdl b/ext/soap/tests/bugs/multiport.wsdl
new file mode 100644
index 0000000000..604e963d81
--- /dev/null
+++ b/ext/soap/tests/bugs/multiport.wsdl
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://www.reuters.com/" xmlns:tns="http://www.reuters.com/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:s="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://www.reuters.com/">
+ <s:element name="GetSessionId">
+ <s:complexType>
+ <s:sequence>
+ <s:element maxOccurs="1" minOccurs="0" name="userId" type="s:string"/>
+ <s:element maxOccurs="1" minOccurs="0" name="password" type="s:string"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetSessionIdResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element maxOccurs="1" minOccurs="0" name="GetSessionIdResult" type="s:string"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="GetSessionIdHttpGetIn">
+ <wsdl:part name="userId" type="s:string">
+ </wsdl:part>
+ <wsdl:part name="password" type="s:string">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="GetSessionIdHttpGetOut">
+ <wsdl:part name="Body" element="tns:string">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="GetSessionIdSoapOut">
+ <wsdl:part name="parameters" element="tns:GetSessionIdResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="GetSessionIdSoapIn">
+ <wsdl:part name="parameters" element="tns:GetSessionId">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="StocksDataSecureHttpGet">
+ <wsdl:operation name="GetSessionId">
+ <wsdl:input message="tns:GetSessionIdHttpGetIn">
+ </wsdl:input>
+ <wsdl:output message="tns:GetSessionIdHttpGetOut">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="StocksDataSecureSoap">
+ <wsdl:operation name="GetSessionId">
+ <wsdl:input message="tns:GetSessionIdSoapIn">
+ </wsdl:input>
+ <wsdl:output message="tns:GetSessionIdSoapOut">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="StocksDataSecureHttpGet" type="tns:StocksDataSecureHttpGet">
+ <http:binding verb="GET"/>
+ <wsdl:operation name="GetSessionId">
+ <http:operation location="/GetSessionId"/>
+ <wsdl:input>
+ <http:urlEncoded/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:mimeXml part="Body"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="StocksDataSecureSoap" type="tns:StocksDataSecureSoap">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="GetSessionId">
+ <soap:operation soapAction="http://www.reuters.com/GetSessionId" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="StocksDataSecure">
+ <wsdl:port name="StocksDataSecureHttpGet" binding="tns:StocksDataSecureHttpGet">
+ <http:address location="test://"/>
+ </wsdl:port>
+ <wsdl:port name="StocksDataSecureSoap" binding="tns:StocksDataSecureSoap">
+ <soap:address location="test://"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>