dmitry Wed Jun 18 07:24:14 2008 UTC
Modified files:
/php-src/ext/soap php_sdl.c
/php-src/ext/soap/tests/bugs multiport.phpt multiport.wsdl
bug29109.phpt
Log:
Fixed SOAP binding selection
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.112&r2=1.113&diff_format=u
Index: php-src/ext/soap/php_sdl.c
diff -u php-src/ext/soap/php_sdl.c:1.112 php-src/ext/soap/php_sdl.c:1.113
--- php-src/ext/soap/php_sdl.c:1.112 Wed May 7 15:45:02 2008
+++ php-src/ext/soap/php_sdl.c Wed Jun 18 07:24:14 2008
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_sdl.c,v 1.112 2008/05/07 15:45:02 davidc Exp $ */
+/* $Id: php_sdl.c,v 1.113 2008/06/18 07:24:14 dmitry Exp $ */
#include "php_soap.h"
#include "ext/libxml/php_libxml.h"
@@ -721,12 +721,12 @@
}
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>");
}
}
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/multiport.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/soap/tests/bugs/multiport.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/multiport.phpt:1.2
--- /dev/null Wed Jun 18 07:24:14 2008
+++ php-src/ext/soap/tests/bugs/multiport.phpt Wed Jun 18 07:24:14 2008
@@ -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>
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/multiport.wsdl?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/soap/tests/bugs/multiport.wsdl
diff -u /dev/null php-src/ext/soap/tests/bugs/multiport.wsdl:1.2
--- /dev/null Wed Jun 18 07:24:14 2008
+++ php-src/ext/soap/tests/bugs/multiport.wsdl Wed Jun 18 07:24:14 2008
@@ -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>
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug29109.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/soap/tests/bugs/bug29109.phpt
diff -u php-src/ext/soap/tests/bugs/bug29109.phpt:1.4
php-src/ext/soap/tests/bugs/bug29109.phpt:1.5
--- php-src/ext/soap/tests/bugs/bug29109.phpt:1.4 Tue May 27 03:22:42 2008
+++ php-src/ext/soap/tests/bugs/bug29109.phpt Wed Jun 18 07:24:14 2008
@@ -10,11 +10,7 @@
var_dump($client->__getFunctions());
?>
--EXPECT--
-array(3) {
+array(1) {
[0]=>
unicode(53) "HelloWorldResponse HelloWorld(HelloWorld $parameters)"
- [1]=>
- unicode(19) "string HelloWorld()"
- [2]=>
- unicode(19) "string HelloWorld()"
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php