sdl->types = malloc(sizeof(HashTable));
zend_hash_init(sdl->types, 0, NULL, delete_type, 1);
}
+ if (!sdl->elements) {
+ sdl->elements = malloc(sizeof(HashTable));
+ zend_hash_init(sdl->elements, 0, NULL, delete_type, 1);
+ }
tns = get_attribute(schema->properties, "targetNamespace");
newType->max_occurs = 1;
if (cur_type == NULL) {
- addHash = sdl->types;
+ addHash = sdl->elements;
smart_str_appends(&key, newType->namens);
smart_str_appendc(&key, ':');
smart_str_appends(&key, newType->name);
xmlNsPtr nsptr;
parse_namespace(curattr->children->content, &cptype, &str_ns);
-/*
- if (str_ns) {
-*/
- nsptr = xmlSearchNs(element->doc, element, str_ns);
-/*
- } else {
- nsptr = xmlSearchNsByHref(element->doc, element, ns->children->content);
+ nsptr = xmlSearchNs(element->doc, element, str_ns);
+ if (nsptr != NULL) {
+ cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, (char *)cptype);
}
-*/
-
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, (char *)cptype);
if (str_ns) {efree(str_ns);}
if (cptype) {efree(cptype);}
}
parse_namespace(newAttr->ref, &value, &prefix);
ns = xmlSearchNs(attrType->doc, attrType, prefix);
- smart_str_appends(&key, ns->href);
- smart_str_appendc(&key, ':');
+ if (ns != NULL) {
+ smart_str_appends(&key, ns->href);
+ smart_str_appendc(&key, ':');
+ }
smart_str_appends(&key, value);
if (value) {efree(value);}
if (prefix) {efree(prefix);}
} else {
ns = node_find_ns(attrType);
- smart_str_appends(&key, ns->href);
- smart_str_appendc(&key, ':');
+ if (ns != NULL) {
+ smart_str_appends(&key, ns->href);
+ smart_str_appendc(&key, ':');
+ }
smart_str_appends(&key, newAttr->name);
}
encodePtr enc = NULL;
TSRMLS_FETCH();
- if (sdl && sdl->types) {
+ if (sdl && sdl->elements) {
xmlNsPtr nsptr;
char *ns, *cptype;
sdlTypePtr *sdl_type;
smart_str_appends(&nscat, cptype);
smart_str_0(&nscat);
- if (zend_hash_find(sdl->types, nscat.c, nscat.len + 1, (void **)&sdl_type) == SUCCESS) {
+ if (zend_hash_find(sdl->elements, nscat.c, nscat.len + 1, (void **)&sdl_type) == SUCCESS) {
enc = (*sdl_type)->encode;
- } else if (zend_hash_find(sdl->types, (char*)type, strlen(type) + 1, (void **)&sdl_type) == SUCCESS) {
+ } else if (zend_hash_find(sdl->elements, (char*)type, strlen(type) + 1, (void **)&sdl_type) == SUCCESS) {
enc = (*sdl_type)->encode;
}
smart_str_free(&nscat);
} else {
- if (zend_hash_find(sdl->types, (char*)type, strlen(type) + 1, (void **)&sdl_type) == SUCCESS) {
+ if (zend_hash_find(sdl->elements, (char*)type, strlen(type) + 1, (void **)&sdl_type) == SUCCESS) {
enc = (*sdl_type)->encode;
}
}
zend_hash_destroy(tmp->types);
free(tmp->types);
}
+ if (tmp->elements) {
+ zend_hash_destroy(tmp->elements);
+ free(tmp->elements);
+ }
if (tmp->bindings) {
zend_hash_destroy(tmp->bindings);
free(tmp->bindings);
{
zval *fault;
MAKE_STD_ZVAL(fault);
-// set_soap_fault(fault, fault_string, fault_code, fault_actor, fault_detail TSRMLS_CC);
set_soap_fault(fault, fault_code, fault_string, fault_actor, fault_detail TSRMLS_CC);
+#ifdef ZEND_ENGINE_2
+ fault->refcount--; /*FIXME*/
+#endif
add_property_zval(obj, "__soap_fault", fault);
return fault;
}
xmlParam = seralize_zval(param_val, param, paramName, style TSRMLS_CC);
+ efree(paramName);
+
return xmlParam;
}