summaryrefslogtreecommitdiff
path: root/ext/soap/php_encoding.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-06-21 06:24:55 +0000
committerDmitry Stogov <dmitry@php.net>2005-06-21 06:24:55 +0000
commit68289c47596719910ccc2728cd494ac751dbcfc9 (patch)
treef05c65532d640c187f6170a2e18e3924bbed81ed /ext/soap/php_encoding.c
parenteccfb9c20205ddde1fafc2e14c41adf572d35eb4 (diff)
downloadphp-git-68289c47596719910ccc2728cd494ac751dbcfc9.tar.gz
ext/soap should use type defined in SoapVar(), if wsdl defines another type
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r--ext/soap/php_encoding.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 813c54b70e..0f2e16b8a8 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -260,7 +260,7 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
soap_error0(E_ERROR, "Encoding: SoapVar hasn't 'enc_type' propery");
}
- if (SOAP_GLOBAL(sdl) && encode == NULL) {
+ if (SOAP_GLOBAL(sdl)) {
if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) {
if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS) {
enc = get_encoder(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zns), Z_STRVAL_PP(zstype));
@@ -272,6 +272,9 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
if (enc == NULL) {
enc = get_conversion(Z_LVAL_P(*ztype));
}
+ if (enc == NULL) {
+ enc = encode;
+ }
if (zend_hash_find(ht, "enc_value", sizeof("enc_value"), (void **)&zdata) == FAILURE) {
node = master_to_xml(enc, NULL, style, parent);
@@ -279,7 +282,7 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
node = master_to_xml(enc, *zdata, style, parent);
}
- if (style == SOAP_ENCODED || (SOAP_GLOBAL(sdl) && encode == NULL)) {
+ if (style == SOAP_ENCODED || (SOAP_GLOBAL(sdl) && encode != enc)) {
if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) {
if (style == SOAP_LITERAL) {
encode_add_ns(node, XSI_NAMESPACE);