From e3d3eaddf1a2954881a00e19cb14f2366ed48be7 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Tue, 29 Mar 2005 13:14:59 +0000 Subject: [PATCH] MFH minor SOAP fix (no worries - it was a tiny bug, the reason a lot of tests are affected is that a lot of them made the same wrong assumption - it won't break real world code) --- ext/soap/php_encoding.c | 3 +++ ext/soap/php_sdl.c | 6 +++++- ext/soap/tests/schema/schema037.phpt | 2 +- ext/soap/tests/schema/schema038.phpt | 2 +- ext/soap/tests/schema/schema039.phpt | 2 +- ext/soap/tests/schema/schema040.phpt | 2 +- ext/soap/tests/schema/schema042.phpt | 2 +- ext/soap/tests/schema/schema043.phpt | 2 +- ext/soap/tests/schema/schema044.phpt | 2 +- ext/soap/tests/schema/schema045.phpt | 2 +- ext/soap/tests/schema/schema046.phpt | 2 +- ext/soap/tests/schema/schema047.phpt | 2 +- ext/soap/tests/schema/schema048.phpt | 2 +- ext/soap/tests/schema/schema062.phpt | 2 +- ext/soap/tests/schema/schema065.phpt | 2 +- ext/soap/tests/schema/schema066.phpt | 2 +- ext/soap/tests/schema/schema067.phpt | 2 +- ext/soap/tests/schema/schema069.phpt | 2 +- ext/soap/tests/schema/schema070.phpt | 2 +- 19 files changed, 25 insertions(+), 18 deletions(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index eda32813e3..e9efb553cd 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1479,8 +1479,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo if ((*attr)->fixed && strcmp((*attr)->fixed,dummy->children->content) != 0) { soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, dummy->children->content); } + if ((*attr)->namens) { +/* if ((*attr)->namens && (type->ns == NULL || strcmp((*attr)->namens, type->ns))) { +*/ xmlNsPtr nsp = encode_add_ns(xmlParam, (*attr)->namens); xmlSetNsProp(xmlParam, nsp, (*attr)->name, dummy->children->content); diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 731a3be8b3..70dd4705a1 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -423,6 +423,10 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml h->ns = estrdup(h->element->namens); } } + if (h->element->name) { + efree(h->name); + h->name = estrdup(h->element->name); + } } } if (!fault) { @@ -1061,7 +1065,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC) return ctx.sdl; } -#define WSDL_CACHE_VERSION 0x0b +#define WSDL_CACHE_VERSION 0x0c #define WSDL_CACHE_GET(ret,type,buf) memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type); #define WSDL_CACHE_GET_INT(ret,buf) ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]<<8)|((unsigned char)(*buf)[2]<<16)|((int)(*buf)[3]<<24); *buf += 4; diff --git a/ext/soap/tests/schema/schema037.phpt b/ext/soap/tests/schema/schema037.phpt index 4e59981fc9..75e1757554 100644 --- a/ext/soap/tests/schema/schema037.phpt +++ b/ext/soap/tests/schema/schema037.phpt @@ -18,7 +18,7 @@ echo "ok"; ?> --EXPECTF-- -str +str object(stdClass)#%d (2) { ["str"]=> string(3) "str" diff --git a/ext/soap/tests/schema/schema038.phpt b/ext/soap/tests/schema/schema038.phpt index 2d37e89e0b..ed7e3b4fc5 100644 --- a/ext/soap/tests/schema/schema038.phpt +++ b/ext/soap/tests/schema/schema038.phpt @@ -19,7 +19,7 @@ echo "ok"; ?> --EXPECTF-- -str +str object(stdClass)#%d (2) { ["str"]=> string(3) "str" diff --git a/ext/soap/tests/schema/schema039.phpt b/ext/soap/tests/schema/schema039.phpt index 0b7ef5afc4..67b1c2544a 100644 --- a/ext/soap/tests/schema/schema039.phpt +++ b/ext/soap/tests/schema/schema039.phpt @@ -21,7 +21,7 @@ echo "ok"; ?> --EXPECTF-- -str +str object(stdClass)#%d (2) { ["str"]=> string(3) "str" diff --git a/ext/soap/tests/schema/schema040.phpt b/ext/soap/tests/schema/schema040.phpt index f7ddc04546..29815fe1f5 100644 --- a/ext/soap/tests/schema/schema040.phpt +++ b/ext/soap/tests/schema/schema040.phpt @@ -22,7 +22,7 @@ echo "ok"; ?> --EXPECTF-- -str +str object(stdClass)#%d (2) { ["str"]=> string(3) "str" diff --git a/ext/soap/tests/schema/schema042.phpt b/ext/soap/tests/schema/schema042.phpt index a8aa8857d9..35a9e8ea02 100644 --- a/ext/soap/tests/schema/schema042.phpt +++ b/ext/soap/tests/schema/schema042.phpt @@ -19,7 +19,7 @@ echo "ok"; ?> --EXPECTF-- -123 +123 object(stdClass)#%d (2) { ["_"]=> int(123) diff --git a/ext/soap/tests/schema/schema043.phpt b/ext/soap/tests/schema/schema043.phpt index 08c2996363..db48582647 100644 --- a/ext/soap/tests/schema/schema043.phpt +++ b/ext/soap/tests/schema/schema043.phpt @@ -26,7 +26,7 @@ echo "ok"; ?> --EXPECTF-- -123 +123 object(stdClass)#%d (3) { ["_"]=> int(123) diff --git a/ext/soap/tests/schema/schema044.phpt b/ext/soap/tests/schema/schema044.phpt index 8fc0705518..e2b9fda77a 100644 --- a/ext/soap/tests/schema/schema044.phpt +++ b/ext/soap/tests/schema/schema044.phpt @@ -19,7 +19,7 @@ echo "ok"; ?> --EXPECTF-- -123 +123 object(stdClass)#%d (2) { ["_"]=> int(123) diff --git a/ext/soap/tests/schema/schema045.phpt b/ext/soap/tests/schema/schema045.phpt index 346a929d85..5f7e649f5a 100644 --- a/ext/soap/tests/schema/schema045.phpt +++ b/ext/soap/tests/schema/schema045.phpt @@ -26,7 +26,7 @@ echo "ok"; ?> --EXPECTF-- -123 +123 object(stdClass)#%d (2) { ["_"]=> int(123) diff --git a/ext/soap/tests/schema/schema046.phpt b/ext/soap/tests/schema/schema046.phpt index 3f9d03afad..3452c20b4e 100644 --- a/ext/soap/tests/schema/schema046.phpt +++ b/ext/soap/tests/schema/schema046.phpt @@ -26,7 +26,7 @@ echo "ok"; ?> --EXPECTF-- -123 +123 object(stdClass)#%d (3) { ["_"]=> int(123) diff --git a/ext/soap/tests/schema/schema047.phpt b/ext/soap/tests/schema/schema047.phpt index 1265cfd3a3..f49946ff4a 100644 --- a/ext/soap/tests/schema/schema047.phpt +++ b/ext/soap/tests/schema/schema047.phpt @@ -24,7 +24,7 @@ echo "ok"; ?> --EXPECTF-- -123 +123 object(stdClass)#%d (2) { ["int"]=> int(123) diff --git a/ext/soap/tests/schema/schema048.phpt b/ext/soap/tests/schema/schema048.phpt index 98d4d4be44..4f0cb7e20f 100644 --- a/ext/soap/tests/schema/schema048.phpt +++ b/ext/soap/tests/schema/schema048.phpt @@ -26,7 +26,7 @@ echo "ok"; ?> --EXPECTF-- -123 +123 object(stdClass)#%d (2) { ["_"]=> int(123) diff --git a/ext/soap/tests/schema/schema062.phpt b/ext/soap/tests/schema/schema062.phpt index d4efc9a599..e9e295a6a3 100644 --- a/ext/soap/tests/schema/schema062.phpt +++ b/ext/soap/tests/schema/schema062.phpt @@ -19,7 +19,7 @@ echo "ok"; ?> --EXPECTF-- - + object(stdClass)#%d (2) { ["_"]=> NULL diff --git a/ext/soap/tests/schema/schema065.phpt b/ext/soap/tests/schema/schema065.phpt index e3f0d646dc..abc6cf9268 100644 --- a/ext/soap/tests/schema/schema065.phpt +++ b/ext/soap/tests/schema/schema065.phpt @@ -16,7 +16,7 @@ echo "ok"; ?> --EXPECTF-- - + object(stdClass)#%d (2) { ["str"]=> string(3) "str" diff --git a/ext/soap/tests/schema/schema066.phpt b/ext/soap/tests/schema/schema066.phpt index b281271963..3991708ee8 100644 --- a/ext/soap/tests/schema/schema066.phpt +++ b/ext/soap/tests/schema/schema066.phpt @@ -16,7 +16,7 @@ echo "ok"; ?> --EXPECTF-- - + object(stdClass)#%d (2) { ["str"]=> string(3) "str" diff --git a/ext/soap/tests/schema/schema067.phpt b/ext/soap/tests/schema/schema067.phpt index 0e4000957a..34cb89c332 100644 --- a/ext/soap/tests/schema/schema067.phpt +++ b/ext/soap/tests/schema/schema067.phpt @@ -16,7 +16,7 @@ echo "ok"; ?> --EXPECTF-- - + object(stdClass)#%d (2) { ["str"]=> string(3) "str" diff --git a/ext/soap/tests/schema/schema069.phpt b/ext/soap/tests/schema/schema069.phpt index e4f733a1c0..8f21e8670d 100644 --- a/ext/soap/tests/schema/schema069.phpt +++ b/ext/soap/tests/schema/schema069.phpt @@ -17,7 +17,7 @@ echo "ok"; ?> --EXPECTF-- - + object(stdClass)#%d (2) { ["str"]=> string(3) "str" diff --git a/ext/soap/tests/schema/schema070.phpt b/ext/soap/tests/schema/schema070.phpt index af9abdc10f..e471ca88ff 100644 --- a/ext/soap/tests/schema/schema070.phpt +++ b/ext/soap/tests/schema/schema070.phpt @@ -19,7 +19,7 @@ echo "ok"; ?> --EXPECTF-- - + object(stdClass)#%d (2) { ["str"]=> string(3) "str" -- 2.40.0