dmitry Mon Jul 10 07:23:12 2006 UTC
Modified files:
/php-src/ext/soap php_encoding.c
/php-src/ext/soap/tests/bugs bug38004.phpt bug38004.wsdl
Log:
Fixed bug #38004 Parameters in SoapServer are decoded twice
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.129&r2=1.130&diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.129
php-src/ext/soap/php_encoding.c:1.130
--- php-src/ext/soap/php_encoding.c:1.129 Thu Jun 15 22:44:55 2006
+++ php-src/ext/soap/php_encoding.c Mon Jul 10 07:23:12 2006
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.c,v 1.129 2006/06/15 22:44:55 rasmus Exp $ */
+/* $Id: php_encoding.c,v 1.130 2006/07/10 07:23:12 dmitry Exp $ */
#include <time.h>
@@ -1356,11 +1356,12 @@
str_val = (*attr)->def;
}
if (str_val) {
+ zval zstr;
xmlNodePtr dummy;
zval *data;
- dummy = xmlNewNode(NULL,
"BOGUS");
- xmlNodeSetContent(dummy,
str_val);
+ ZVAL_STRING(&zstr, str_val, 0);
+ dummy =
master_to_xml(get_conversion(IS_STRING), &zstr, SOAP_LITERAL, NULL);
data =
master_to_zval((*attr)->encode, dummy);
xmlFreeNode(dummy);
set_zval_property(ret,
(*attr)->name, data TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug38004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/soap/tests/bugs/bug38004.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug38004.phpt:1.2
--- /dev/null Mon Jul 10 07:23:12 2006
+++ php-src/ext/soap/tests/bugs/bug38004.phpt Mon Jul 10 07:23:12 2006
@@ -0,0 +1,40 @@
+--TEST--
+Bug #37278 (SOAP not respecting uri in __soapCall)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Test($param) {
+ global $g;
+ $g = $param->strA."\n".$param->strB."\n";
+ return $g;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl) {
+ parent::__construct($wsdl);
+ $this->server = new SoapServer($wsdl);
+ $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;
+ }
+}
+
+$client = new TestSoapClient(dirname(__FILE__).'/bug38004.wsdl');
+$strA = 'test & test';
+$strB = 'test & test';
+$res = $client->Test(array('strA'=>$strA, 'strB'=>$strB));
+print_r($res);
+print_r($g);
+?>
+--EXPECT--
+test & test
+test & test
+test & test
+test & test
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug38004.wsdl?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/soap/tests/bugs/bug38004.wsdl
diff -u /dev/null php-src/ext/soap/tests/bugs/bug38004.wsdl:1.2
--- /dev/null Mon Jul 10 07:23:12 2006
+++ php-src/ext/soap/tests/bugs/bug38004.wsdl Mon Jul 10 07:23:12 2006
@@ -0,0 +1,51 @@
+<?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="Test">
+ <s:attribute use="required" name="strA"
type="s:string"/>
+ <s:attribute use="required" name="strB"
type="s:string"/>
+ </s:complexType>
+ <s:element type="s0:Test" name="Test"/>
+ <s:element type="s:string" name="Ret"/>
+ </s:schema>
+ </types>
+
+ <message name="TestSoapIn">
+ <part name="parameters" element="s0:Test"/>
+ </message>
+ <message name="TestSoapOut">
+ <part name="parameters" element="s0:Ret"/>
+ </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="document"/>
+ <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:8080/~dmitry/bug38004/server.php"/>
+ </port>
+ </service>
+</definitions>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php