]> granicus.if.org Git - php/commitdiff
fix: Using proper namespace for <soap:header> if it is not specified.
authorDmitry Stogov <dmitry@php.net>
Tue, 17 Feb 2004 09:23:28 +0000 (09:23 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 17 Feb 2004 09:23:28 +0000 (09:23 +0000)
ext/soap/php_sdl.c

index 2a74869e263e8619af277b6c832f03a7c0844854..e9d7246f3372eaff806625b36a21d7e5ada0a2c1 100644 (file)
@@ -390,19 +390,6 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap
                        memset(h, 0, sizeof(sdlSoapBindingFunctionHeader));
                        h->name = estrdup(tmp->children->content);
 
-                       tmp = get_attribute(part->properties, "type");
-                       if (tmp != NULL) {
-                               h->encode = get_encoder_from_prefix(ctx->sdl, part, tmp->children->content);
-                       } else {
-                               tmp = get_attribute(part->properties, "element");
-                               if (tmp != NULL) {
-                                       h->element = get_element(ctx->sdl, part, tmp->children->content);
-                                       if (h->element) {
-                                               h->encode = h->element->encode;
-                                       }
-                               }
-                       }
-
                        tmp = get_attribute(header->properties, "use");
                        if (tmp && !strncmp(tmp->children->content, "encoded", sizeof("encoded"))) {
                                h->use = SOAP_ENCODED;
@@ -428,6 +415,22 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap
                                }
                        }
 
+                       tmp = get_attribute(part->properties, "type");
+                       if (tmp != NULL) {
+                               h->encode = get_encoder_from_prefix(ctx->sdl, part, tmp->children->content);
+                       } else {
+                               tmp = get_attribute(part->properties, "element");
+                               if (tmp != NULL) {
+                                       h->element = get_element(ctx->sdl, part, tmp->children->content);
+                                       if (h->element) {
+                                               h->encode = h->element->encode;
+                                               if (!h->ns && h->element->namens) {
+                                                       h->ns = estrdup(h->element->namens);
+                                               }
+                                       }
+                               }
+                       }
+
                        if (binding->headers == NULL) {
                                binding->headers = emalloc(sizeof(HashTable));
                                zend_hash_init(binding->headers, 0, NULL, delete_header, 0);
@@ -874,7 +877,7 @@ static sdlPtr load_wsdl(char *struri)
        return ctx.sdl;
 }
 
-#define WSDL_CACHE_VERSION 01
+#define WSDL_CACHE_VERSION 02
 
 #define WSDL_CACHE_GET(ret,type,buf)   memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type);
 #define WSDL_CACHE_GET_INT(ret,buf)    ret = ((int)(*buf)[0])|((int)(*buf)[1]<<8)|((int)(*buf)[2]<<16)|((int)(*buf)[3]<<24); *buf += 4;