summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/soap/php_encoding.c35
-rw-r--r--ext/soap/php_encoding.h2
-rw-r--r--ext/soap/php_http.c15
-rw-r--r--ext/soap/php_schema.c127
-rw-r--r--ext/soap/php_schema.h6
-rw-r--r--ext/soap/php_sdl.c1110
-rw-r--r--ext/soap/php_sdl.h5
-rw-r--r--ext/soap/php_soap.h10
-rw-r--r--ext/soap/soap.c87
-rw-r--r--ext/soap/tests/bugs/bug30045.phpt2
-rwxr-xr-xext/soap/tests/bugs/bug36908.phpt46
-rwxr-xr-xext/soap/tests/bugs/bug36908.wsdl51
-rwxr-xr-xext/soap/tests/bugs/bug37083.phpt58
-rwxr-xr-xext/soap/tests/bugs/bug37083.wsdl99
14 files changed, 71 insertions, 1582 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 5c3c6db56f..f675fd949d 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -211,9 +211,6 @@ encode defaultEncoding[] = {
{{END_KNOWN_TYPES, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert}
};
-int numDefaultEncodings = sizeof(defaultEncoding)/sizeof(encode);
-
-
void whiteSpace_replace(char* str)
{
while (*str != '\0') {
@@ -1131,13 +1128,11 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
{
switch (model->kind) {
case XSD_CONTENT_ELEMENT:
- if (model->u.element->name) {
- xmlNodePtr node = get_node(data->children, model->u.element->name);
-
- if (node) {
- zval *val;
+ if (model->u.element->name) {
+ xmlNodePtr node = get_node(data->children, model->u.element->name);
+ if (node) {
+ zval *val;
- node = check_and_resolve_href(node);
if (node && node->children && node->children->content) {
if (model->u.element->fixed && strcmp(model->u.element->fixed,node->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content);
@@ -2883,11 +2878,11 @@ zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data)
}
if (type->restrictions->minLength &&
strlen(data->children->content) < type->restrictions->minLength->value) {
- soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length less then 'minLength'");
}
if (type->restrictions->maxLength &&
strlen(data->children->content) > type->restrictions->maxLength->value) {
- soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length greater then 'maxLength'");
}
if (type->restrictions->length &&
strlen(data->children->content) != type->restrictions->length->value) {
@@ -2946,11 +2941,11 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo
}
if (type->restrictions->minLength &&
Z_STRLEN_P(data) < type->restrictions->minLength->value) {
- soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length less then 'minLength'");
}
if (type->restrictions->maxLength &&
Z_STRLEN_P(data) > type->restrictions->maxLength->value) {
- soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length greater then 'maxLength'");
}
if (type->restrictions->length &&
Z_STRLEN_P(data) != type->restrictions->length->value) {
@@ -3305,17 +3300,3 @@ void delete_encoder(void *encode)
}
efree(t);
}
-
-void delete_encoder_persistent(void *encode)
-{
- encodePtr t = *((encodePtr*)encode);
- if (t->details.ns) {
- free(t->details.ns);
- }
- if (t->details.type_str) {
- free(t->details.type_str);
- }
- /* we should never have mapping in persistent encoder */
- assert(t->details.map == NULL);
- free(t);
-}
diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h
index 1a896d0336..e6638b41fd 100644
--- a/ext/soap/php_encoding.h
+++ b/ext/soap/php_encoding.h
@@ -219,9 +219,7 @@ xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns);
encodePtr get_conversion(int encode);
void delete_encoder(void *handle);
-void delete_encoder_persistent(void *handle);
extern encode defaultEncoding[];
-extern int numDefaultEncodings;
#endif
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index e70a006dcb..34e55b2bf3 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -416,22 +416,13 @@ try_again:
smart_str_appendc(&soap_headers, ':');
smart_str_append_unsigned(&soap_headers, phpurl->port);
}
- smart_str_append_const(&soap_headers, "\r\n"
- "Connection: Keep-Alive\r\n");
+ smart_str_append_const(&soap_headers, "\r\n"
+ "Connection: Keep-Alive\r\n"
/*
"Connection: close\r\n"
"Accept: text/html; text/xml; text/plain\r\n"
*/
- if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent"), (void **)&tmp) == SUCCESS &&
- Z_TYPE_PP(tmp) == IS_STRING) {
- if (Z_STRLEN_PP(tmp) > 0) {
- smart_str_append_const(&soap_headers, "User-Agent: ");
- smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
- smart_str_append_const(&soap_headers, "\r\n");
- }
- } else{
- smart_str_append_const(&soap_headers, "User-Agent: PHP-SOAP/"PHP_VERSION"\r\n");
- }
+ "User-Agent: PHP SOAP 0.1\r\n");
smart_str_append(&soap_headers, &soap_headers_z);
smart_str_free(&soap_headers_z);
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c
index c448cf5fb7..3753245bd5 100644
--- a/ext/soap/php_schema.c
+++ b/ext/soap/php_schema.c
@@ -2358,28 +2358,6 @@ void delete_model(void *handle)
efree(tmp);
}
-void delete_model_persistent(void *handle)
-{
- sdlContentModelPtr tmp = *((sdlContentModelPtr*)handle);
- switch (tmp->kind) {
- case XSD_CONTENT_ELEMENT:
- case XSD_CONTENT_GROUP:
- break;
- case XSD_CONTENT_SEQUENCE:
- case XSD_CONTENT_ALL:
- case XSD_CONTENT_CHOICE:
- zend_hash_destroy(tmp->u.content);
- free(tmp->u.content);
- break;
- case XSD_CONTENT_GROUP_REF:
- free(tmp->u.group_ref);
- break;
- default:
- break;
- }
- free(tmp);
-}
-
void delete_type(void *data)
{
sdlTypePtr type = *((sdlTypePtr*)data);
@@ -2427,53 +2405,6 @@ void delete_type(void *data)
efree(type);
}
-void delete_type_persistent(void *data)
-{
- sdlTypePtr type = *((sdlTypePtr*)data);
- if (type->name) {
- free(type->name);
- }
- if (type->namens) {
- free(type->namens);
- }
- if (type->def) {
- free(type->def);
- }
- if (type->fixed) {
- free(type->fixed);
- }
- if (type->elements) {
- zend_hash_destroy(type->elements);
- free(type->elements);
- }
- if (type->attributes) {
- zend_hash_destroy(type->attributes);
- free(type->attributes);
- }
- if (type->model) {
- delete_model_persistent((void**)&type->model);
- }
- if (type->restrictions) {
- delete_restriction_var_int_persistent(&type->restrictions->minExclusive);
- delete_restriction_var_int_persistent(&type->restrictions->minInclusive);
- delete_restriction_var_int_persistent(&type->restrictions->maxExclusive);
- delete_restriction_var_int_persistent(&type->restrictions->maxInclusive);
- delete_restriction_var_int_persistent(&type->restrictions->totalDigits);
- delete_restriction_var_int_persistent(&type->restrictions->fractionDigits);
- delete_restriction_var_int_persistent(&type->restrictions->length);
- delete_restriction_var_int_persistent(&type->restrictions->minLength);
- delete_restriction_var_int_persistent(&type->restrictions->maxLength);
- delete_restriction_var_char_persistent(&type->restrictions->whiteSpace);
- delete_restriction_var_char_persistent(&type->restrictions->pattern);
- if (type->restrictions->enumeration) {
- zend_hash_destroy(type->restrictions->enumeration);
- free(type->restrictions->enumeration);
- }
- free(type->restrictions);
- }
- free(type);
-}
-
void delete_extra_attribute(void *attribute)
{
sdlExtraAttributePtr attr = *((sdlExtraAttributePtr*)attribute);
@@ -2487,19 +2418,6 @@ void delete_extra_attribute(void *attribute)
efree(attr);
}
-void delete_extra_attribute_persistent(void *attribute)
-{
- sdlExtraAttributePtr attr = *((sdlExtraAttributePtr*)attribute);
-
- if (attr->ns) {
- free(attr->ns);
- }
- if (attr->val) {
- free(attr->val);
- }
- free(attr);
-}
-
void delete_attribute(void *attribute)
{
sdlAttributePtr attr = *((sdlAttributePtr*)attribute);
@@ -2526,32 +2444,6 @@ void delete_attribute(void *attribute)
efree(attr);
}
-void delete_attribute_persistent(void *attribute)
-{
- sdlAttributePtr attr = *((sdlAttributePtr*)attribute);
-
- if (attr->def) {
- free(attr->def);
- }
- if (attr->fixed) {
- free(attr->fixed);
- }
- if (attr->name) {
- free(attr->name);
- }
- if (attr->namens) {
- free(attr->namens);
- }
- if (attr->ref) {
- free(attr->ref);
- }
- if (attr->extraAttributes) {
- zend_hash_destroy(attr->extraAttributes);
- free(attr->extraAttributes);
- }
- free(attr);
-}
-
void delete_restriction_var_int(void *rvi)
{
sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi);
@@ -2560,14 +2452,6 @@ void delete_restriction_var_int(void *rvi)
}
}
-void delete_restriction_var_int_persistent(void *rvi)
-{
- sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi);
- if (ptr) {
- free(ptr);
- }
-}
-
void delete_restriction_var_char(void *srvc)
{
sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc);
@@ -2578,14 +2462,3 @@ void delete_restriction_var_char(void *srvc)
efree(ptr);
}
}
-
-void delete_restriction_var_char_persistent(void *srvc)
-{
- sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc);
- if (ptr) {
- if (ptr->value) {
- free(ptr->value);
- }
- free(ptr);
- }
-}
diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h
index fbc7372a10..e5a3934767 100644
--- a/ext/soap/php_schema.h
+++ b/ext/soap/php_schema.h
@@ -26,15 +26,9 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC);
void schema_pass2(sdlCtx *ctx);
void delete_model(void *handle);
-void delete_model_persistent(void *handle);
void delete_type(void *data);
-void delete_type_persistent(void *data);
void delete_extra_attribute(void *attribute);
-void delete_extra_attribute_persistent(void *attribute);
void delete_attribute(void *attribute);
-void delete_attribute_persistent(void *attribute);
void delete_restriction_var_int(void *rvi);
-void delete_restriction_var_int_persistent(void *rvi);
void delete_restriction_var_char(void *srvc);
-void delete_restriction_var_char_persistent(void *srvc);
#endif
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index e0f1a8dffa..e2698ebcab 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -35,15 +35,10 @@
#endif
static void delete_fault(void *fault);
-static void delete_fault_persistent(void *fault);
static void delete_binding(void *binding);
-static void delete_binding_persistent(void *binding);
static void delete_function(void *function);
-static void delete_function_persistent(void *function);
static void delete_parameter(void *paramater);
-static void delete_parameter_persistent(void *paramater);
static void delete_header(void *header);
-static void delete_header_persistent(void *header);
static void delete_document(void *doc_ptr);
encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr node, const char *type)
@@ -143,18 +138,13 @@ encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type)
enc = get_encoder_ex(NULL, enc_nscat, enc_len);
efree(enc_nscat);
if (enc && sdl) {
- encodePtr new_enc = pemalloc(sizeof(encode), sdl->is_persistent);
+ encodePtr new_enc = emalloc(sizeof(encode));
memcpy(new_enc, enc, sizeof(encode));
- if (sdl->is_persistent) {
- new_enc->details.ns = zend_strndup(ns, ns_len);
- new_enc->details.type_str = strdup(new_enc->details.type_str);
- } else {
- new_enc->details.ns = estrndup(ns, ns_len);
- new_enc->details.type_str = estrdup(new_enc->details.type_str);
- }
+ new_enc->details.ns = estrndup(ns, ns_len);
+ new_enc->details.type_str = estrdup(new_enc->details.type_str);
if (sdl->encoders == NULL) {
- sdl->encoders = pemalloc(sizeof(HashTable), sdl->is_persistent);
- zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, sdl->is_persistent);
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
}
zend_hash_update(sdl->encoders, nscat, len + 1, &new_enc, sizeof(encodePtr), NULL);
enc = new_enc;
@@ -1417,7 +1407,7 @@ static HashTable* sdl_deserialize_parameters(encodePtr *encoders, sdlTypePtr *ty
return ht;
}
-static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time_t *cached TSRMLS_DC)
+static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t)
{
sdlPtr sdl;
time_t old_t;
@@ -1461,7 +1451,6 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time
efree(buf);
return NULL;
}
- *cached = old_t;
WSDL_CACHE_GET_INT(i, &in);
if (i == 0 && strncmp(in, uri, i) != 0) {
@@ -1994,7 +1983,7 @@ static void sdl_serialize_soap_body(sdlSoapBindingFunctionBodyPtr body, HashTabl
}
}
-static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr sdl TSRMLS_DC)
+static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr sdl)
{
smart_str buf = {0};
smart_str *out = &buf;
@@ -2269,867 +2258,14 @@ static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr s
zend_hash_destroy(&tmp_types);
}
-
-static void make_persistent_restriction_int(void *data)
-{
- sdlRestrictionIntPtr *rest = (sdlRestrictionIntPtr *)data;
- sdlRestrictionIntPtr prest = NULL;
-
- prest = malloc(sizeof(sdlRestrictionInt));
- *prest = **rest;
- *rest = prest;
-}
-
-
-static void make_persistent_restriction_char(void *data)
-{
- sdlRestrictionCharPtr *rest = (sdlRestrictionCharPtr *)data;
- sdlRestrictionCharPtr prest = NULL;
-
- prest = malloc(sizeof(sdlRestrictionChar));
- memset(prest, 0, sizeof(sdlRestrictionChar));
- prest->value = strdup((*rest)->value);
- prest->fixed = (*rest)->fixed;
- *rest = prest;
-}
-
-
-static void make_persistent_sdl_type_ref(sdlTypePtr *type, HashTable *ptr_map, HashTable *bp_types)
-{
- sdlTypePtr *tmp;
-
- if (zend_hash_find(ptr_map, (char *)type, sizeof(sdlTypePtr), (void**)&tmp) == SUCCESS) {
- *type = *tmp;
- } else {
- zend_hash_next_index_insert(bp_types, (void*)&type, sizeof(sdlTypePtr*), NULL);
- }
-}
-
-
-static void make_persistent_sdl_encoder_ref(encodePtr *enc, HashTable *ptr_map, HashTable *bp_encoders)
-{
- encodePtr *tmp;
-
- /* do not process defaultEncoding's here */
- if ((*enc) >= defaultEncoding && (*enc) < defaultEncoding + numDefaultEncodings) {
- return;
- }
-
- if (zend_hash_find(ptr_map, (char *)enc, sizeof(encodePtr), (void**)&tmp) == SUCCESS) {
- *enc = *tmp;
- } else {
- zend_hash_next_index_insert(bp_encoders, (void*)&enc, sizeof(encodePtr*), NULL);
- }
-}
-
-
-static HashTable* make_persistent_sdl_function_headers(HashTable *headers, HashTable *ptr_map)
-{
- HashTable *pheaders;
- sdlSoapBindingFunctionHeaderPtr *tmp, pheader;
- encodePtr *penc;
- sdlTypePtr *ptype;
- ulong index;
- char *key;
- uint key_len;
-
- pheaders = malloc(sizeof(HashTable));
- zend_hash_init(pheaders, zend_hash_num_elements(headers), NULL, delete_header_persistent, 1);
-
- zend_hash_internal_pointer_reset(headers);
- while (zend_hash_get_current_data(headers, (void**)&tmp) == SUCCESS) {
- pheader = malloc(sizeof(sdlSoapBindingFunctionHeader));
- memset(pheader, 0, sizeof(sdlSoapBindingFunctionHeader));
- *pheader = **tmp;
-
- if (pheader->name) {
- pheader->name = strdup(pheader->name);
- }
- if (pheader->ns) {
- pheader->ns = strdup(pheader->ns);
- }
-
- if (pheader->encode->details.sdl_type) {
- if (zend_hash_find(ptr_map, (char*)&pheader->encode, sizeof(encodePtr), (void**)&penc) == FAILURE) {
- assert(0);
- }
- pheader->encode = *penc;
- }
- if (pheader->element) {
- if (zend_hash_find(ptr_map, (char*)&pheader->element, sizeof(sdlTypePtr), (void**)&ptype) == FAILURE) {
- assert(0);
- }
- pheader->element = *ptype;
- }
-
- if (pheader->headerfaults) {
- pheader->headerfaults = make_persistent_sdl_function_headers(pheader->headerfaults, ptr_map);
- }
-
- if (zend_hash_get_current_key_ex(headers, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(pheaders, key, key_len, (void*)&pheader, sizeof(sdlSoapBindingFunctionHeaderPtr), NULL);
- } else {
- zend_hash_next_index_insert(pheaders, (void*)&pheader, sizeof(sdlSoapBindingFunctionHeaderPtr), NULL);
- }
-
- zend_hash_move_forward(headers);
- }
-
- return pheaders;
-}
-
-
-static void make_persistent_sdl_soap_body(sdlSoapBindingFunctionBodyPtr body, HashTable *ptr_map)
-{
- if (body->ns) {
- body->ns = strdup(body->ns);
- }
-
- if (body->headers) {
- body->headers = make_persistent_sdl_function_headers(body->headers, ptr_map);
- }
-}
-
-
-static HashTable* make_persistent_sdl_parameters(HashTable *params, HashTable *ptr_map)
-{
- HashTable *pparams;
- sdlParamPtr *tmp, pparam;
- sdlTypePtr *ptype;
- encodePtr *penc;
- ulong index;
- char *key;
- uint key_len;
-
- pparams = malloc(sizeof(HashTable));
- zend_hash_init(pparams, zend_hash_num_elements(params), NULL, delete_parameter_persistent, 1);
-
- zend_hash_internal_pointer_reset(params);
- while (zend_hash_get_current_data(params, (void**)&tmp) == SUCCESS) {
- pparam = malloc(sizeof(sdlParam));
- memset(pparam, 0, sizeof(sdlParam));
- *pparam = **tmp;
-
- if (pparam->paramName) {
- pparam->paramName = strdup(pparam->paramName);
- }
-
- if (pparam->encode && pparam->encode->details.sdl_type) {
- if (zend_hash_find(ptr_map, (char*)&pparam->encode, sizeof(encodePtr), (void**)&penc) == FAILURE) {
- assert(0);
- }
- pparam->encode = *penc;
- }
- if (pparam->element) {
- if (zend_hash_find(ptr_map, (char*)&pparam->element, sizeof(sdlTypePtr), (void**)&ptype) == FAILURE) {
- assert(0);
- }
- pparam->element = *ptype;
- }
-
- if (zend_hash_get_current_key_ex(params, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(pparams, key, key_len, (void*)&pparam, sizeof(sdlParamPtr), NULL);
- } else {
- zend_hash_next_index_insert(pparams, (void*)&pparam, sizeof(sdlParamPtr), NULL);
- }
-
- zend_hash_move_forward(params);
- }
-
-
- return pparams;
-}
-
-static HashTable* make_persistent_sdl_function_faults(sdlFunctionPtr func, HashTable *faults, HashTable *ptr_map)
-{
- HashTable *pfaults;
- sdlFaultPtr *tmp, pfault;
- ulong index;
- char *key;
- uint key_len;
-
- pfaults = malloc(sizeof(HashTable));
- zend_hash_init(pfaults, zend_hash_num_elements(faults), NULL, delete_fault_persistent, 1);
-
- zend_hash_internal_pointer_reset(faults);
- while (zend_hash_get_current_data(faults, (void**)&tmp) == SUCCESS) {
- pfault = malloc(sizeof(sdlFault));
- memset(pfault, 0, sizeof(sdlFault));
- *pfault = **tmp;
-
- if (pfault->name) {
- pfault->name = strdup(pfault->name);
- }
- if (pfault->details) {
- pfault->details = make_persistent_sdl_parameters(pfault->details, ptr_map);
- }
-
- if (func->binding->bindingType == BINDING_SOAP && pfault->bindingAttributes) {
- sdlSoapBindingFunctionFaultPtr soap_binding;
-
- soap_binding = malloc(sizeof(sdlSoapBindingFunctionFault));
- memset(soap_binding, 0, sizeof(sdlSoapBindingFunctionFault));
- *soap_binding = *(sdlSoapBindingFunctionFaultPtr)pfault->bindingAttributes;
- if (soap_binding->ns) {
- soap_binding->ns = strdup(soap_binding->ns);
- }
- pfault->bindingAttributes = soap_binding;
- }
-
- if (zend_hash_get_current_key_ex(faults, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(pfaults, key, key_len, (void*)&pfault, sizeof(sdlParamPtr), NULL);
- } else {
- zend_hash_next_index_insert(pfaults, (void*)&pfault, sizeof(sdlParamPtr), NULL);
- }
-
- zend_hash_move_forward(faults);
- }
-
-
- return pfaults;
-}
-
-
-static sdlAttributePtr make_persistent_sdl_attribute(sdlAttributePtr attr, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders)
-{
- sdlAttributePtr pattr;
- ulong index;
- char *key;
- uint key_len;
-
- pattr = malloc(sizeof(sdlAttribute));
- memset(pattr, 0, sizeof(sdlAttribute));
-
- *pattr = *attr;
-
- if (pattr->name) {
- pattr->name = strdup(pattr->name);
- }
- if (pattr->namens) {
- pattr->namens = strdup(pattr->namens);
- }
- if (pattr->ref) {
- pattr->ref = strdup(pattr->ref);
- }
- if (pattr->def) {
- pattr->def = strdup(pattr->def);
- }
- if (pattr->fixed) {
- pattr->fixed = strdup(pattr->fixed);
- }
-
- /* we do not want to process defaultEncoding's here */
- if (pattr->encode) {
- make_persistent_sdl_encoder_ref(&pattr->encode, ptr_map, bp_encoders);
- }
-
- if (pattr->extraAttributes) {
- sdlExtraAttributePtr *tmp, pextra;
-
- pattr->extraAttributes = malloc(sizeof(HashTable));
- zend_hash_init(pattr->extraAttributes, zend_hash_num_elements(attr->extraAttributes), NULL, delete_extra_attribute_persistent, 1);
-
- zend_hash_internal_pointer_reset(pattr->extraAttributes);
- while (zend_hash_get_current_data(attr->extraAttributes, (void**)&tmp) == SUCCESS) {
- pextra = malloc(sizeof(sdlExtraAttribute));
- memset(pextra, 0, sizeof(sdlExtraAttribute));
- if ((*tmp)->ns) {
- pextra->ns = strdup((*tmp)->ns);
- }
- if ((*tmp)->val) {
- pextra->val = strdup((*tmp)->val);
- }
-
- if (zend_hash_get_current_key_ex(attr->extraAttributes, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(pattr->extraAttributes, key, key_len, (void*)&pextra, sizeof(sdlExtraAttributePtr), NULL);
- }
-
- zend_hash_move_forward(attr->extraAttributes);
- }
- }
-
- return pattr;
-}
-
-
-static sdlContentModelPtr make_persistent_sdl_model(sdlContentModelPtr model, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders)
-{
- sdlContentModelPtr pmodel;
- sdlContentModelPtr *tmp, pcontent;
-
- pmodel = malloc(sizeof(sdlContentModel));
- memset(pmodel, 0, sizeof(sdlContentModel));
- *pmodel = *model;
-
- switch (pmodel->kind) {
- case XSD_CONTENT_ELEMENT:
- if (pmodel->u.element) {
- make_persistent_sdl_type_ref(&pmodel->u.element, ptr_map, bp_types);
- }
- break;
-
- case XSD_CONTENT_SEQUENCE:
- case XSD_CONTENT_ALL:
- case XSD_CONTENT_CHOICE:
- pmodel->u.content = malloc(sizeof(HashTable));
- zend_hash_init(pmodel->u.content, zend_hash_num_elements(model->u.content), NULL, delete_model_persistent, 1);
-
- zend_hash_internal_pointer_reset(model->u.content);
- while (zend_hash_get_current_data(model->u.content, (void**)&tmp) == SUCCESS) {
- pcontent = make_persistent_sdl_model(*tmp, ptr_map, bp_types, bp_encoders);
- zend_hash_next_index_insert(pmodel->u.content, (void*)&pcontent, sizeof(sdlContentModelPtr), NULL);
- zend_hash_move_forward(model->u.content);
- }
- break;
-
- case XSD_CONTENT_GROUP_REF:
- if (pmodel->u.group_ref) {
- pmodel->u.group_ref = strdup(pmodel->u.group_ref);
- }
- break;
-
- case XSD_CONTENT_GROUP:
- if (pmodel->u.group) {
- make_persistent_sdl_type_ref(&pmodel->u.group, ptr_map, bp_types);
- }
- break;
-
- default:
- break;
- }
-
- return pmodel;
-}
-
-
-static sdlTypePtr make_persistent_sdl_type(sdlTypePtr type, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders)
+sdlPtr get_sdl(zval *this_ptr, char *uri TSRMLS_DC)
{
- ulong index;
- char *key;
- uint key_len;
- sdlTypePtr ptype = NULL;
-
- ptype = malloc(sizeof(sdlType));
- memset(ptype, 0, sizeof(sdlType));
-
- *ptype = *type;
-
- if (ptype->name) {
- ptype->name = strdup(ptype->name);
- }
- if (ptype->namens) {
- ptype->namens = strdup(ptype->namens);
- }
- if (ptype->def) {
- ptype->def = strdup(ptype->def);
- }
- if (ptype->fixed) {
- ptype->fixed = strdup(ptype->fixed);
- }
- if (ptype->ref) {
- ptype->ref = strdup(ptype->ref);
- }
-
- /* we do not want to process defaultEncoding's here */
- if (ptype->encode) {
- make_persistent_sdl_encoder_ref(&ptype->encode, ptr_map, bp_encoders);
- }
-
- if (ptype->restrictions) {
- ptype->restrictions = malloc(sizeof(sdlRestrictions));
- memset(ptype->restrictions, 0, sizeof(sdlRestrictions));
- *ptype->restrictions = *type->restrictions;
-
- if (ptype->restrictions->minExclusive) {
- make_persistent_restriction_int(&ptype->restrictions->minExclusive);
- }
- if (ptype->restrictions->maxExclusive) {
- make_persistent_restriction_int(&ptype->restrictions->maxExclusive);
- }
- if (ptype->restrictions->minInclusive) {
- make_persistent_restriction_int(&ptype->restrictions->minInclusive);
- }
- if (ptype->restrictions->maxInclusive) {
- make_persistent_restriction_int(&ptype->restrictions->maxInclusive);
- }
- if (ptype->restrictions->totalDigits) {
- make_persistent_restriction_int(&ptype->restrictions->totalDigits);
- }
- if (ptype->restrictions->fractionDigits) {
- make_persistent_restriction_int(&ptype->restrictions->fractionDigits);
- }
- if (ptype->restrictions->length) {
- make_persistent_restriction_int(&ptype->restrictions->length);
- }
- if (ptype->restrictions->minLength) {
- make_persistent_restriction_int(&ptype->restrictions->minLength);
- }
- if (ptype->restrictions->maxLength) {
- make_persistent_restriction_int(&ptype->restrictions->maxLength);
- }
- if (ptype->restrictions->whiteSpace) {
- make_persistent_restriction_char(&ptype->restrictions->whiteSpace);
- }
- if (ptype->restrictions->pattern) {
- make_persistent_restriction_char(&ptype->restrictions->pattern);
- }
-
- if (type->restrictions->enumeration) {
- sdlRestrictionCharPtr tmp;
-
- ptype->restrictions->enumeration = malloc(sizeof(HashTable));
- zend_hash_init(ptype->restrictions->enumeration, zend_hash_num_elements(type->restrictions->enumeration), NULL, delete_restriction_var_char_persistent, 1);
- zend_hash_copy(ptype->restrictions->enumeration, type->restrictions->enumeration, make_persistent_restriction_char, (void*)&tmp, sizeof(sdlRestrictionCharPtr));
- }
- }
-
- if (ptype->elements) {
- sdlTypePtr *tmp, pelem;
-
- ptype->elements = malloc(sizeof(HashTable));
- zend_hash_init(ptype->elements, zend_hash_num_elements(type->elements), NULL, delete_type_persistent, 1);
-
- zend_hash_internal_pointer_reset(type->elements);
- while (zend_hash_get_current_data(type->elements, (void **)&tmp) == SUCCESS) {
- pelem = make_persistent_sdl_type(*tmp, ptr_map, bp_types, bp_encoders);
- if (zend_hash_get_current_key_ex(type->elements, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(ptype->elements, key, key_len, (void*)&pelem, sizeof(sdlTypePtr), NULL);
- } else {
- zend_hash_next_index_insert(ptype->elements, (void*)&pelem, sizeof(sdlTypePtr), NULL);
- }
- zend_hash_add(ptr_map, (char*)tmp, sizeof(*tmp), (void*)&pelem, sizeof(sdlTypePtr), NULL);
- zend_hash_move_forward(type->elements);
- }
- }
-
- if (ptype->attributes) {
- sdlAttributePtr *tmp, pattr;
-
- ptype->attributes = malloc(sizeof(HashTable));
- zend_hash_init(ptype->attributes, zend_hash_num_elements(type->attributes), NULL, delete_attribute_persistent, 1);
-
- zend_hash_internal_pointer_reset(type->attributes);
- while (zend_hash_get_current_data(type->attributes, (void **)&tmp) == SUCCESS) {
- pattr = make_persistent_sdl_attribute(*tmp, ptr_map, bp_types, bp_encoders);
- if (zend_hash_get_current_key_ex(type->attributes, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(ptype->attributes, key, key_len, (void*)&pattr, sizeof(sdlAttributePtr), NULL);
- } else {
- zend_hash_next_index_insert(ptype->attributes, (void*)&pattr, sizeof(sdlAttributePtr), NULL);
- }
- zend_hash_move_forward(type->attributes);
- }
- }
-
- if (type->model) {
- ptype->model = make_persistent_sdl_model(ptype->model, ptr_map, bp_types, bp_encoders);
- }
-
- return ptype;
-}
-
-static encodePtr make_persistent_sdl_encoder(encodePtr enc, HashTable *ptr_map, HashTable *bp_types, HashTable *bp_encoders)
-{
- encodePtr penc = NULL;
-
- penc = malloc(sizeof(encode));
- memset(penc, 0, sizeof(encode));
-
- *penc = *enc;
-
- if (penc->details.type_str) {
- penc->details.type_str = strdup(penc->details.type_str);
- }
- if (penc->details.ns) {
- penc->details.ns = strdup(penc->details.ns);
- }
-
- if (penc->details.sdl_type) {
- make_persistent_sdl_type_ref(&penc->details.sdl_type, ptr_map, bp_types);
- }
-
- return penc;
-}
-
-static sdlBindingPtr make_persistent_sdl_binding(sdlBindingPtr bind, HashTable *ptr_map)
-{
- sdlBindingPtr pbind = NULL;
-
- pbind = malloc(sizeof(sdlBinding));
- memset(pbind, 0, sizeof(sdlBinding));
-
- *pbind = *bind;
-
- if (pbind->name) {
- pbind->name = strdup(pbind->name);
- }
- if (pbind->location) {
- pbind->location = strdup(pbind->location);
- }
-
- if (pbind->bindingType == BINDING_SOAP && pbind->bindingAttributes) {
- sdlSoapBindingPtr soap_binding;
-
- soap_binding = malloc(sizeof(sdlSoapBinding));
- memset(soap_binding, 0, sizeof(sdlSoapBinding));
- *soap_binding = *(sdlSoapBindingPtr)pbind->bindingAttributes;
- pbind->bindingAttributes = soap_binding;
- }
-
- return pbind;
-}
-
-static sdlFunctionPtr make_persistent_sdl_function(sdlFunctionPtr func, HashTable *ptr_map)
-{
- sdlFunctionPtr pfunc = NULL;
-
- pfunc = malloc(sizeof(sdlFunction));
- memset(pfunc, 0, sizeof(sdlFunction));
-
- *pfunc = *func;
-
- if (pfunc->functionName) {
- pfunc->functionName = strdup(pfunc->functionName);
- }
- if (pfunc->requestName) {
- pfunc->requestName = strdup(pfunc->requestName);
- }
- if (pfunc->responseName) {
- pfunc->responseName = strdup(pfunc->responseName);
- }
-
- if (pfunc->binding) {
- sdlBindingPtr *tmp;
-
- if (zend_hash_find(ptr_map, (char*)&pfunc->binding, sizeof(pfunc->binding), (void**)&tmp) == FAILURE) {
- assert(0);
- }
- pfunc->binding = *tmp;
-
- if (pfunc->binding->bindingType == BINDING_SOAP && pfunc->bindingAttributes) {
- sdlSoapBindingFunctionPtr soap_binding;
-
- soap_binding = malloc(sizeof(sdlSoapBindingFunction));
- memset(soap_binding, 0, sizeof(sdlSoapBindingFunction));
- *soap_binding = *(sdlSoapBindingFunctionPtr)pfunc->bindingAttributes;
- if (soap_binding->soapAction) {
- soap_binding->soapAction = strdup(soap_binding->soapAction);
- }
- make_persistent_sdl_soap_body(&soap_binding->input, ptr_map);
- make_persistent_sdl_soap_body(&soap_binding->output, ptr_map);
- pfunc->bindingAttributes = soap_binding;
- }
-
- if (pfunc->requestParameters) {
- pfunc->requestParameters = make_persistent_sdl_parameters(pfunc->requestParameters, ptr_map);
- }
- if (pfunc->responseParameters) {
- pfunc->responseParameters = make_persistent_sdl_parameters(pfunc->responseParameters, ptr_map);
- }
- if (pfunc->faults) {
- pfunc->faults = make_persistent_sdl_function_faults(pfunc, pfunc->faults, ptr_map);
- }
- }
-
- return pfunc;
-}
-
-static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
-{
- sdlPtr psdl = NULL;
- HashTable ptr_map;
- HashTable bp_types, bp_encoders;
- ulong index;
- char *key;
- uint key_len;
-
- zend_hash_init(&bp_types, 0, NULL, NULL, 0);
- zend_hash_init(&bp_encoders, 0, NULL, NULL, 0);
- zend_hash_init(&ptr_map, 0, NULL, NULL, 0);
-
- psdl = malloc(sizeof(*sdl));
- memset(psdl, 0, sizeof(*sdl));
-
- if (sdl->source) {
- psdl->source = strdup(sdl->source);
- }
- if (sdl->target_ns) {
- psdl->target_ns = strdup(sdl->target_ns);
- }
-
- if (sdl->groups) {
- sdlTypePtr *tmp;
- sdlTypePtr ptype;
-
- psdl->groups = malloc(sizeof(HashTable));
- zend_hash_init(psdl->groups, zend_hash_num_elements(sdl->groups), NULL, delete_type_persistent, 1);
-
- zend_hash_internal_pointer_reset(sdl->groups);
- while (zend_hash_get_current_data(sdl->groups, (void **)&tmp) == SUCCESS) {
- ptype = make_persistent_sdl_type(*tmp, &ptr_map, &bp_types, &bp_encoders);
- if (zend_hash_get_current_key_ex(sdl->groups, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(psdl->groups, key, key_len, (void*)&ptype, sizeof(sdlTypePtr), NULL);
- } else {
- zend_hash_next_index_insert(psdl->groups, (void*)&ptype, sizeof(sdlTypePtr), NULL);
- }
- zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&ptype, sizeof(sdlTypePtr), NULL);
- zend_hash_move_forward(sdl->groups);
- }
- }
-
- if (sdl->types) {
- sdlTypePtr *tmp;
- sdlTypePtr ptype;
-
- psdl->types = malloc(sizeof(HashTable));
- zend_hash_init(psdl->types, zend_hash_num_elements(sdl->types), NULL, delete_type_persistent, 1);
-
- zend_hash_internal_pointer_reset(sdl->types);
- while (zend_hash_get_current_data(sdl->types, (void **)&tmp) == SUCCESS) {
- ptype = make_persistent_sdl_type(*tmp, &ptr_map, &bp_types, &bp_encoders);
- if (zend_hash_get_current_key_ex(sdl->types, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(psdl->types, key, key_len, (void*)&ptype, sizeof(sdlTypePtr), NULL);
- } else {
- zend_hash_next_index_insert(psdl->types, (void*)&ptype, sizeof(sdlTypePtr), NULL);
- }
- zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&ptype, sizeof(sdlTypePtr), NULL);
- zend_hash_move_forward(sdl->types);
- }
- }
-
- if (sdl->elements) {
- sdlTypePtr *tmp;
- sdlTypePtr ptype;
-
- psdl->elements = malloc(sizeof(HashTable));
- zend_hash_init(psdl->elements, zend_hash_num_elements(sdl->elements), NULL, delete_type_persistent, 1);
-
- zend_hash_internal_pointer_reset(sdl->elements);
- while (zend_hash_get_current_data(sdl->elements, (void **)&tmp) == SUCCESS) {
- ptype = make_persistent_sdl_type(*tmp, &ptr_map, &bp_types, &bp_encoders);
- if (zend_hash_get_current_key_ex(sdl->elements, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(psdl->elements, key, key_len, (void*)&ptype, sizeof(sdlTypePtr), NULL);
- } else {
- zend_hash_next_index_insert(psdl->elements, (void*)&ptype, sizeof(sdlTypePtr), NULL);
- }
- zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&ptype, sizeof(sdlTypePtr), NULL);
- zend_hash_move_forward(sdl->elements);
- }
- }
-
- if (sdl->encoders) {
- encodePtr *tmp;
- encodePtr penc;
-
- psdl->encoders = malloc(sizeof(HashTable));
- zend_hash_init(psdl->encoders, zend_hash_num_elements(sdl->encoders), NULL, delete_encoder_persistent, 1);
-
- zend_hash_internal_pointer_reset(sdl->encoders);
- while (zend_hash_get_current_data(sdl->encoders, (void **)&tmp) == SUCCESS) {
- penc = make_persistent_sdl_encoder(*tmp, &ptr_map, &bp_types, &bp_encoders);
- if (zend_hash_get_current_key_ex(sdl->encoders, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(psdl->encoders, key, key_len, (void*)&penc, sizeof(encodePtr), NULL);
- } else {
- zend_hash_next_index_insert(psdl->encoders, (void*)&penc, sizeof(encodePtr), NULL);
- }
- zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&penc, sizeof(encodePtr), NULL);
- zend_hash_move_forward(sdl->encoders);
- }
- }
-
- /* do backpatching here */
- if (zend_hash_num_elements(&bp_types)) {
- sdlTypePtr **tmp, *ptype = NULL;
-
- zend_hash_internal_pointer_reset(&bp_types);
- while (zend_hash_get_current_data(&bp_types, (void**)&tmp) == SUCCESS) {
- if (zend_hash_find(&ptr_map, (char*)(*tmp), sizeof(**tmp), (void**)&ptype) == FAILURE) {
- assert(0);
- }
- **tmp = *ptype;
- zend_hash_move_forward(&bp_types);
- }
- }
- if (zend_hash_num_elements(&bp_encoders)) {
- encodePtr **tmp, *penc = NULL;
-
- zend_hash_internal_pointer_reset(&bp_encoders);
- while (zend_hash_get_current_data(&bp_encoders, (void**)&tmp) == SUCCESS) {
- if (zend_hash_find(&ptr_map, (char*)(*tmp), sizeof(**tmp), (void**)&penc) == FAILURE) {
- assert(0);
- }
- **tmp = *penc;
- zend_hash_move_forward(&bp_encoders);
- }
- }
-
-
- if (sdl->bindings) {
- sdlBindingPtr *tmp;
- sdlBindingPtr pbind;
-
- psdl->bindings = malloc(sizeof(HashTable));
- zend_hash_init(psdl->bindings, zend_hash_num_elements(sdl->bindings), NULL, delete_binding_persistent, 1);
-
- zend_hash_internal_pointer_reset(sdl->bindings);
- while (zend_hash_get_current_data(sdl->bindings, (void **)&tmp) == SUCCESS) {
- pbind = make_persistent_sdl_binding(*tmp, &ptr_map);
- if (zend_hash_get_current_key_ex(sdl->bindings, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(psdl->bindings, key, key_len, (void*)&pbind, sizeof(sdlBindingPtr), NULL);
- } else {
- zend_hash_next_index_insert(psdl->bindings, (void*)&pbind, sizeof(sdlBindingPtr), NULL);
- }
- zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&pbind, sizeof(sdlBindingPtr), NULL);
- zend_hash_move_forward(sdl->bindings);
- }
- }
-
- zend_hash_init(&psdl->functions, zend_hash_num_elements(&sdl->functions), NULL, delete_function_persistent, 1);
- if (zend_hash_num_elements(&sdl->functions)) {
- sdlFunctionPtr *tmp;
- sdlFunctionPtr pfunc;
-
- zend_hash_internal_pointer_reset(&sdl->functions);
- while (zend_hash_get_current_data(&sdl->functions, (void **)&tmp) == SUCCESS) {
- pfunc = make_persistent_sdl_function(*tmp, &ptr_map);
- if (zend_hash_get_current_key_ex(&sdl->functions, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(&psdl->functions, key, key_len, (void*)&pfunc, sizeof(sdlFunctionPtr), NULL);
- } else {
- zend_hash_next_index_insert(&psdl->functions, (void*)&pfunc, sizeof(sdlFunctionPtr), NULL);
- }
- zend_hash_add(&ptr_map, (char*)tmp, sizeof(*tmp), (void*)&pfunc, sizeof(sdlFunctionPtr), NULL);
- zend_hash_move_forward(&sdl->functions);
- }
- }
-
- if (sdl->requests) {
- sdlFunctionPtr *tmp;
- sdlFunctionPtr *preq;
-
- psdl->requests = malloc(sizeof(HashTable));
- zend_hash_init(psdl->requests, zend_hash_num_elements(sdl->requests), NULL, NULL, 1);
-
- zend_hash_internal_pointer_reset(sdl->requests);
- while (zend_hash_get_current_data(sdl->requests, (void **)&tmp) == SUCCESS) {
- if (zend_hash_find(&ptr_map, (char*)tmp, sizeof(*tmp), (void**)&preq) == FAILURE) {
- assert(0);
- }
- *tmp = *preq;
- if (zend_hash_get_current_key_ex(sdl->requests, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) {
- zend_hash_add(psdl->requests, key, key_len, (void*)&preq, sizeof(sdlFunctionPtr), NULL);
- }
- zend_hash_move_forward(sdl->requests);
- }
- }
-
- zend_hash_destroy(&ptr_map);
- zend_hash_destroy(&bp_encoders);
- zend_hash_destroy(&bp_types);
-
- return psdl;
-}
-
-typedef struct _sdl_cache_bucket {
- sdlPtr sdl;
- time_t time;
-} sdl_cache_bucket;
-
-static void delete_psdl(void *data)
-{
- sdl_cache_bucket *p = (sdl_cache_bucket*)data;
- sdlPtr tmp = p->sdl;
-
- zend_hash_destroy(&tmp->functions);
- if (tmp->source) {
- free(tmp->source);
- }
- if (tmp->target_ns) {
- free(tmp->target_ns);
- }
- if (tmp->elements) {
- zend_hash_destroy(tmp->elements);
- free(tmp->elements);
- }
- if (tmp->encoders) {
- zend_hash_destroy(tmp->encoders);
- free(tmp->encoders);
- }
- if (tmp->types) {
- zend_hash_destroy(tmp->types);
- free(tmp->types);
- }
- if (tmp->groups) {
- zend_hash_destroy(tmp->groups);
- free(tmp->groups);
- }
- if (tmp->bindings) {
- zend_hash_destroy(tmp->bindings);
- free(tmp->bindings);
- }
- if (tmp->requests) {
- zend_hash_destroy(tmp->requests);
- free(tmp->requests);
- }
- free(tmp);
-}
-
-sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
-{
- char fn[MAXPATHLEN];
sdlPtr sdl = NULL;
char* old_error_code = SOAP_GLOBAL(error_code);
- int uri_len = 0;
+ int uri_len;
php_stream_context *context=NULL;
zval **tmp, **proxy_host, **proxy_port, *orig_context = NULL, *new_context = NULL;
smart_str headers = {0};
- char* key = NULL;
- time_t t = time(0);
-
- if (strchr(uri,':') != NULL || IS_ABSOLUTE_PATH(uri, uri_len)) {
- uri_len = strlen(uri);
- } else if (VCWD_REALPATH(uri, fn) == NULL) {
- cache_wsdl = WSDL_CACHE_NONE;
- } else {
- uri = fn;
- uri_len = strlen(uri);
- }
-
- if ((cache_wsdl & WSDL_CACHE_MEMORY) && SOAP_GLOBAL(mem_cache)) {
- sdl_cache_bucket *p;
-
- if (SUCCESS == zend_hash_find(SOAP_GLOBAL(mem_cache), uri, uri_len+1, (void*)&p)) {
- if (p->time < t - SOAP_GLOBAL(cache_ttl)) {
- /* in-memory cache entry is expired */
- zend_hash_del(&EG(persistent_list), uri, uri_len+1);
- } else {
- return p->sdl;
- }
- }
- }
-
- if ((cache_wsdl & WSDL_CACHE_DISK) && (uri_len < MAXPATHLEN)) {
- time_t t = time(0);
- char md5str[33];
- PHP_MD5_CTX context;
- unsigned char digest[16];
- int len = strlen(SOAP_GLOBAL(cache_dir));
- time_t cached;
-
- md5str[0] = '\0';
- PHP_MD5Init(&context);
- PHP_MD5Update(&context, uri, uri_len);
- PHP_MD5Final(digest, &context);
- make_digest(md5str, digest);
- key = emalloc(len+sizeof("/wsdl-")-1+sizeof(md5str));
- memcpy(key,SOAP_GLOBAL(cache_dir),len);
- memcpy(key+len,"/wsdl-",sizeof("/wsdl-")-1);
- memcpy(key+len+sizeof("/wsdl-")-1,md5str,sizeof(md5str));
-
- if ((sdl = get_sdl_from_cache(key, uri, t-SOAP_GLOBAL(cache_ttl), &cached TSRMLS_CC)) != NULL) {
- t = cached;
- efree(key);
- goto cache_in_memory;
- }
- }
if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr),
"_stream_context", sizeof("_stream_context"), (void**)&tmp)) {
@@ -3194,9 +2330,42 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
SOAP_GLOBAL(error_code) = "WSDL";
- sdl = load_wsdl(this_ptr, uri TSRMLS_CC);
- if (sdl) {
- sdl->is_persistent = 0;
+ if (SOAP_GLOBAL(cache_enabled) && ((uri_len = strlen(uri)) < MAXPATHLEN)) {
+ char fn[MAXPATHLEN];
+
+ if (strchr(uri,':') != NULL || IS_ABSOLUTE_PATH(uri, uri_len)) {
+ strcpy(fn, uri);
+ } else if (VCWD_REALPATH(uri, fn) == NULL) {
+ sdl = load_wsdl(this_ptr, uri TSRMLS_CC);
+ }
+ if (sdl == NULL) {
+ char* key;
+ time_t t = time(0);
+ char md5str[33];
+ PHP_MD5_CTX context;
+ unsigned char digest[16];
+ int len = strlen(SOAP_GLOBAL(cache_dir));
+
+ md5str[0] = '\0';
+ PHP_MD5Init(&context);
+ PHP_MD5Update(&context, fn, strlen(fn));
+ PHP_MD5Final(digest, &context);
+ make_digest(md5str, digest);
+ key = emalloc(len+sizeof("/wsdl-")-1+sizeof(md5str));
+ memcpy(key,SOAP_GLOBAL(cache_dir),len);
+ memcpy(key+len,"/wsdl-",sizeof("/wsdl-")-1);
+ memcpy(key+len+sizeof("/wsdl-")-1,md5str,sizeof(md5str));
+
+ if ((sdl = get_sdl_from_cache(key, fn, t-SOAP_GLOBAL(cache_ttl))) == NULL) {
+ sdl = load_wsdl(this_ptr, fn TSRMLS_CC);
+ if (sdl != NULL) {
+ add_sdl_to_cache(key, fn, t, sdl);
+ }
+ }
+ efree(key);
+ }
+ } else {
+ sdl = load_wsdl(this_ptr, uri TSRMLS_CC);
}
SOAP_GLOBAL(error_code) = old_error_code;
@@ -3206,72 +2375,11 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
zval_ptr_dtor(&new_context);
}
- if ((cache_wsdl & WSDL_CACHE_DISK) && key) {
- if (sdl) {
- add_sdl_to_cache(key, uri, t, sdl TSRMLS_CC);
- }
- efree(key);
- }
-
-cache_in_memory:
- if (cache_wsdl & WSDL_CACHE_MEMORY) {
- if (sdl) {
- sdlPtr psdl;
- sdl_cache_bucket p;
-
- if (SOAP_GLOBAL(mem_cache) == NULL) {
- SOAP_GLOBAL(mem_cache) = malloc(sizeof(HashTable));
- zend_hash_init(SOAP_GLOBAL(mem_cache), 0, NULL, delete_psdl, 1);
- } else if (SOAP_GLOBAL(cache_limit) > 0 &&
- SOAP_GLOBAL(cache_limit) <= zend_hash_num_elements(SOAP_GLOBAL(mem_cache))) {
- /* in-memory cache overflow */
- sdl_cache_bucket *q;
- HashPosition pos;
- time_t latest = t;
- char *key = NULL;
- uint key_len;
- ulong idx;
-
- for (zend_hash_internal_pointer_reset_ex(SOAP_GLOBAL(mem_cache), &pos);
- zend_hash_get_current_data_ex(SOAP_GLOBAL(mem_cache), (void **) &q, &pos) == SUCCESS;
- zend_hash_move_forward_ex(SOAP_GLOBAL(mem_cache), &pos)) {
- if (q->time < latest) {
- latest = q->time;
- zend_hash_get_current_key_ex(SOAP_GLOBAL(mem_cache), &key, &key_len, &idx, 0, &pos);
- }
- }
- if (key) {
- zend_hash_del(SOAP_GLOBAL(mem_cache), key, key_len);
- } else {
- return sdl;
- }
- }
-
- psdl = make_persistent_sdl(sdl TSRMLS_CC);
- psdl->is_persistent = 1;
- p.time = t;
- p.sdl = psdl;
-
- if (SUCCESS == zend_hash_update(SOAP_GLOBAL(mem_cache), uri,
- uri_len+1, (void*)&p, sizeof(sdl_cache_bucket), NULL)) {
- /* remove non-persitent sdl structure */
- delete_sdl_impl(sdl);
- /* and replace it with persistent one */
- sdl = psdl;
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to register persistent entry");
- /* clean up persistent sdl */
- delete_psdl(&p);
- /* keep non-persistent sdl and return it */
- }
- }
- }
-
return sdl;
}
/* Deletes */
-void delete_sdl_impl(void *handle)
+void delete_sdl(void *handle)
{
sdlPtr tmp = (sdlPtr)handle;
@@ -3309,15 +2417,6 @@ void delete_sdl_impl(void *handle)
efree(tmp);
}
-void delete_sdl(void *handle)
-{
- sdlPtr tmp = (sdlPtr)handle;
-
- if (!tmp->is_persistent) {
- delete_sdl_impl(tmp);
- }
-}
-
static void delete_binding(void *data)
{
sdlBindingPtr binding = *((sdlBindingPtr*)data);
@@ -3338,26 +2437,6 @@ static void delete_binding(void *data)
efree(binding);
}
-static void delete_binding_persistent(void *data)
-{
- sdlBindingPtr binding = *((sdlBindingPtr*)data);
-
- if (binding->location) {
- free(binding->location);
- }
- if (binding->name) {
- free(binding->name);
- }
-
- if (binding->bindingType == BINDING_SOAP) {
- sdlSoapBindingPtr soapBind = binding->bindingAttributes;
- if (soapBind) {
- free(soapBind);
- }
- }
- free(binding);
-}
-
static void delete_sdl_soap_binding_function_body(sdlSoapBindingFunctionBody body)
{
if (body.ns) {
@@ -3369,17 +2448,6 @@ static void delete_sdl_soap_binding_function_body(sdlSoapBindingFunctionBody bod
}
}
-static void delete_sdl_soap_binding_function_body_persistent(sdlSoapBindingFunctionBody body)
-{
- if (body.ns) {
- free(body.ns);
- }
- if (body.headers) {
- zend_hash_destroy(body.headers);
- free(body.headers);
- }
-}
-
static void delete_function(void *data)
{
sdlFunctionPtr function = *((sdlFunctionPtr*)data);
@@ -3419,45 +2487,6 @@ static void delete_function(void *data)
efree(function);
}
-static void delete_function_persistent(void *data)
-{
- sdlFunctionPtr function = *((sdlFunctionPtr*)data);
-
- if (function->functionName) {
- free(function->functionName);
- }
- if (function->requestName) {
- free(function->requestName);
- }
- if (function->responseName) {
- free(function->responseName);
- }
- if (function->requestParameters) {
- zend_hash_destroy(function->requestParameters);
- free(function->requestParameters);
- }
- if (function->responseParameters) {
- zend_hash_destroy(function->responseParameters);
- free(function->responseParameters);
- }
- if (function->faults) {
- zend_hash_destroy(function->faults);
- free(function->faults);
- }
-
- if (function->bindingAttributes &&
- function->binding && function->binding->bindingType == BINDING_SOAP) {
- sdlSoapBindingFunctionPtr soapFunction = function->bindingAttributes;
- if (soapFunction->soapAction) {
- free(soapFunction->soapAction);
- }
- delete_sdl_soap_binding_function_body_persistent(soapFunction->input);
- delete_sdl_soap_binding_function_body_persistent(soapFunction->output);
- free(soapFunction);
- }
- free(function);
-}
-
static void delete_parameter(void *data)
{
sdlParamPtr param = *((sdlParamPtr*)data);
@@ -3467,15 +2496,6 @@ static void delete_parameter(void *data)
efree(param);
}
-static void delete_parameter_persistent(void *data)
-{
- sdlParamPtr param = *((sdlParamPtr*)data);
- if (param->paramName) {
- free(param->paramName);
- }
- free(param);
-}
-
static void delete_header(void *data)
{
sdlSoapBindingFunctionHeaderPtr hdr = *((sdlSoapBindingFunctionHeaderPtr*)data);
@@ -3492,22 +2512,6 @@ static void delete_header(void *data)
efree(hdr);
}
-static void delete_header_persistent(void *data)
-{
- sdlSoapBindingFunctionHeaderPtr hdr = *((sdlSoapBindingFunctionHeaderPtr*)data);
- if (hdr->name) {
- free(hdr->name);
- }
- if (hdr->ns) {
- free(hdr->ns);
- }
- if (hdr->headerfaults) {
- zend_hash_destroy(hdr->headerfaults);
- free(hdr->headerfaults);
- }
- free(hdr);
-}
-
static void delete_fault(void *data)
{
sdlFaultPtr fault = *((sdlFaultPtr*)data);
@@ -3529,30 +2533,8 @@ static void delete_fault(void *data)
efree(fault);
}
-static void delete_fault_persistent(void *data)
-{
- sdlFaultPtr fault = *((sdlFaultPtr*)data);
- if (fault->name) {
- free(fault->name);
- }
- if (fault->details) {
- zend_hash_destroy(fault->details);
- free(fault->details);
- }
- if (fault->bindingAttributes) {
- sdlSoapBindingFunctionFaultPtr binding = (sdlSoapBindingFunctionFaultPtr)fault->bindingAttributes;
-
- if (binding->ns) {
- free(binding->ns);
- }
- free(fault->bindingAttributes);
- }
- free(fault);
-}
-
static void delete_document(void *doc_ptr)
{
xmlDocPtr doc = *((xmlDocPtr*)doc_ptr);
xmlFreeDoc(doc);
}
-
diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h
index 7ac46e86f3..7b135c7f24 100644
--- a/ext/soap/php_sdl.h
+++ b/ext/soap/php_sdl.h
@@ -61,7 +61,6 @@ struct _sdl {
HashTable *groups; /* array of sdlTypesPtr */
char *target_ns;
char *source;
- zend_bool is_persistent;
};
typedef struct sdlCtx {
@@ -251,8 +250,7 @@ struct _sdlAttribute {
encodePtr encode;
};
-
-sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC);
+sdlPtr get_sdl(zval *this_ptr, char *uri TSRMLS_DC);
encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const char *type);
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
@@ -262,6 +260,5 @@ sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type);
sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
void delete_sdl(void *handle);
-void delete_sdl_impl(void *handle);
#endif
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index d6988cd0f0..ec193c0d83 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -158,11 +158,6 @@ struct _soapService {
#define SOAP_SINGLE_ELEMENT_ARRAYS (1<<0)
#define SOAP_WAIT_ONE_WAY_CALLS (2<<0)
-#define WSDL_CACHE_NONE 0x0
-#define WSDL_CACHE_DISK 0x1
-#define WSDL_CACHE_MEMORY 0x2
-#define WSDL_CACHE_BOTH 0x3
-
ZEND_BEGIN_MODULE_GLOBALS(soap)
HashTable defEncNs; /* mapping of default namespaces to prefixes */
HashTable defEnc;
@@ -174,15 +169,12 @@ ZEND_BEGIN_MODULE_GLOBALS(soap)
zend_bool use_soap_error_handler;
char* error_code;
zval* error_object;
- long cache;
+ zend_bool cache_enabled;
char* cache_dir;
long cache_ttl;
- long cache_limit;
- HashTable *mem_cache;
xmlCharEncodingHandlerPtr encoding;
HashTable *class_map;
int features;
- HashTable wsdl_cache;
ZEND_END_MODULE_GLOBALS(soap)
#ifdef PHP_WIN32
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 20d482ad9a..3e73031b47 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -391,49 +391,18 @@ zend_module_entry soap_module_entry = {
ZEND_GET_MODULE(soap)
#endif
-#ifndef ZEND_ENGINE_2
-# define OnUpdateLong OnUpdateInt
-#endif
-
-ZEND_INI_MH(OnUpdateCacheEnabled)
-{
- long *p;
-#ifndef ZTS
- char *base = (char *) mh_arg2;
-#else
- char *base;
-
- base = (char *) ts_resource(*((int *) mh_arg2));
-#endif
-
- p = (long*) (base+(size_t) mh_arg1);
-
- if (new_value_length==2 && strcasecmp("on", new_value)==0) {
- *p = 1;
- }
- else if (new_value_length==3 && strcasecmp("yes", new_value)==0) {
- *p = 1;
- }
- else if (new_value_length==4 && strcasecmp("true", new_value)==0) {
- *p = 1;
- }
- else {
- *p = (long) (atoi(new_value) != 0);
- }
- return SUCCESS;
-}
-
PHP_INI_BEGIN()
-STD_PHP_INI_ENTRY("soap.wsdl_cache_enabled", "1", PHP_INI_ALL, OnUpdateCacheEnabled,
- cache, zend_soap_globals, soap_globals)
+STD_PHP_INI_ENTRY("soap.wsdl_cache_enabled", "1", PHP_INI_ALL, OnUpdateBool,
+ cache_enabled, zend_soap_globals, soap_globals)
STD_PHP_INI_ENTRY("soap.wsdl_cache_dir", "/tmp", PHP_INI_ALL, OnUpdateString,
cache_dir, zend_soap_globals, soap_globals)
+#ifdef ZEND_ENGINE_2
STD_PHP_INI_ENTRY("soap.wsdl_cache_ttl", "86400", PHP_INI_ALL, OnUpdateLong,
cache_ttl, zend_soap_globals, soap_globals)
-STD_PHP_INI_ENTRY("soap.wsdl_cache", "1", PHP_INI_ALL, OnUpdateLong,
- cache, zend_soap_globals, soap_globals)
-STD_PHP_INI_ENTRY("soap.wsdl_cache_limit", "5", PHP_INI_ALL, OnUpdateLong,
- cache_limit, zend_soap_globals, soap_globals)
+#else
+STD_PHP_INI_ENTRY("soap.wsdl_cache_ttl", "86400", PHP_INI_ALL, OnUpdateInt,
+ cache_ttl, zend_soap_globals, soap_globals)
+#endif
PHP_INI_END()
static HashTable defEnc, defEncIndex, defEncNs;
@@ -490,7 +459,6 @@ static void php_soap_init_globals(zend_soap_globals *soap_globals TSRMLS_DC)
soap_globals->error_object = NULL;
soap_globals->sdl = NULL;
soap_globals->soap_version = SOAP_1_1;
- soap_globals->mem_cache = NULL;
}
PHP_MSHUTDOWN_FUNCTION(soap)
@@ -499,10 +467,6 @@ PHP_MSHUTDOWN_FUNCTION(soap)
zend_hash_destroy(&SOAP_GLOBAL(defEnc));
zend_hash_destroy(&SOAP_GLOBAL(defEncIndex));
zend_hash_destroy(&SOAP_GLOBAL(defEncNs));
- if (SOAP_GLOBAL(mem_cache)) {
- zend_hash_destroy(SOAP_GLOBAL(mem_cache));
- free(SOAP_GLOBAL(mem_cache));
- }
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
@@ -528,7 +492,7 @@ PHP_MINIT_FUNCTION(soap)
/* TODO: add ini entry for always use soap errors */
php_soap_prepare_globals();
ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL);
- REGISTER_INI_ENTRIES();
+ REGISTER_INI_ENTRIES();
#ifndef ZEND_ENGINE_2
/* Enable php stream/wrapper support for libxml */
@@ -675,11 +639,6 @@ PHP_MINIT_FUNCTION(soap)
REGISTER_LONG_CONSTANT("SOAP_SINGLE_ELEMENT_ARRAYS", SOAP_SINGLE_ELEMENT_ARRAYS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SOAP_WAIT_ONE_WAY_CALLS", SOAP_WAIT_ONE_WAY_CALLS, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("WSDL_CACHE_NONE", WSDL_CACHE_NONE, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("WSDL_CACHE_DISK", WSDL_CACHE_DISK, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("WSDL_CACHE_MEMORY", WSDL_CACHE_MEMORY, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("WSDL_CACHE_BOTH", WSDL_CACHE_BOTH, CONST_CS | CONST_PERSISTENT);
-
old_error_handler = zend_error_cb;
zend_error_cb = soap_error_handler;
@@ -946,7 +905,6 @@ PHP_METHOD(SoapServer, SoapServer)
zval *wsdl, *options = NULL;
int ret;
int version = SOAP_1_1;
- long cache_wsdl;
SOAP_SERVER_BEGIN_CODE();
@@ -964,8 +922,6 @@ PHP_METHOD(SoapServer, SoapServer)
service = emalloc(sizeof(soapService));
memset(service, 0, sizeof(soapService));
- cache_wsdl = SOAP_GLOBAL(cache);
-
if (options != NULL) {
HashTable *ht = Z_ARRVAL_P(options);
zval **tmp;
@@ -1016,11 +972,6 @@ PHP_METHOD(SoapServer, SoapServer)
service->features = Z_LVAL_PP(tmp);
}
- if (zend_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS &&
- Z_TYPE_PP(tmp) == IS_LONG) {
- cache_wsdl = Z_LVAL_PP(tmp);
- }
-
} else if (wsdl == NULL) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments. 'uri' option is required in nonWSDL mode.");
}
@@ -1032,7 +983,7 @@ PHP_METHOD(SoapServer, SoapServer)
zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0);
if (wsdl) {
- service->sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
+ service->sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl) TSRMLS_CC);
if (service->uri == NULL) {
if (service->sdl->target_ns) {
service->uri = estrdup(service->sdl->target_ns);
@@ -1702,9 +1653,7 @@ PHP_METHOD(SoapServer, handle)
}
fn_name = estrndup(Z_STRVAL(h->function_name),Z_STRLEN(h->function_name));
- if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRLEN(h->function_name)), Z_STRLEN(h->function_name) + 1) ||
- (service->type == SOAP_CLASS &&
- zend_hash_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) {
+ if (zend_hash_exists(function_table, php_strtolower(fn_name, Z_STRLEN(h->function_name)), Z_STRLEN(h->function_name) + 1)) {
if (service->type == SOAP_CLASS) {
call_status = call_user_function(NULL, &soap_obj, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC);
} else {
@@ -2151,7 +2100,6 @@ PHP_METHOD(SoapClient, SoapClient)
zval *options = NULL;
int soap_version = SOAP_1_1;
php_stream_context *context = NULL;
- long cache_wsdl;
SOAP_CLIENT_BEGIN_CODE();
@@ -2167,9 +2115,6 @@ PHP_METHOD(SoapClient, SoapClient)
} else {
wsdl = NULL;
}
-
- cache_wsdl = SOAP_GLOBAL(cache);
-
if (options != NULL) {
HashTable *ht = Z_ARRVAL_P(options);
zval **tmp;
@@ -2317,16 +2262,6 @@ PHP_METHOD(SoapClient, SoapClient)
add_property_resource(this_ptr, "_stream_context", context->rsrc_id);
}
- if (zend_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS &&
- Z_TYPE_PP(tmp) == IS_LONG) {
- cache_wsdl = Z_LVAL_PP(tmp);
- }
-
- if (zend_hash_find(ht, "user_agent", sizeof("user_agent"), (void**)&tmp) == SUCCESS &&
- Z_TYPE_PP(tmp) == IS_STRING) {
- add_property_stringl(this_ptr, "_user_agent", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
- }
-
} else if (wsdl == NULL) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' and 'uri' options are requred in nonWSDL mode");
return;
@@ -2341,7 +2276,7 @@ PHP_METHOD(SoapClient, SoapClient)
old_soap_version = SOAP_GLOBAL(soap_version);
SOAP_GLOBAL(soap_version) = soap_version;
- sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
+ sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl) TSRMLS_CC);
ret = zend_list_insert(sdl, le_sdl);
add_property_resource(this_ptr, "sdl", ret);
diff --git a/ext/soap/tests/bugs/bug30045.phpt b/ext/soap/tests/bugs/bug30045.phpt
index 02424713c5..753faf1755 100644
--- a/ext/soap/tests/bugs/bug30045.phpt
+++ b/ext/soap/tests/bugs/bug30045.phpt
@@ -42,7 +42,7 @@ function test($type, $num) {
try {
printf(" %0.0f\n ", $num);
$ret = $soap->foo($type, new SoapVar($num, $type));
- printf(" %0.0f\n", $ret);
+ printf(" %0.0f\n", $num, $ret);
} catch (SoapFault $ex) {
var_dump($ex);
}
diff --git a/ext/soap/tests/bugs/bug36908.phpt b/ext/soap/tests/bugs/bug36908.phpt
deleted file mode 100755
index cd0ea8b2e5..0000000000
--- a/ext/soap/tests/bugs/bug36908.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-Bug #36908 (wsdl default value overrides value in soap request)
---SKIPIF--
-<?php
- if (!extension_loaded('soap')) die('skip soap extension not available');
-?>
---INI--
-soap.wsdl_cache_enabled=0
---FILE--
-<?php
-class PublisherService {
- function add($publisher) {
- return $publisher->region_id;
- }
-}
-$input =
-'<?xml version="1.0" encoding="UTF-8"?>
-<soapenv:Envelope
-xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <ns1:add xmlns:ns1="urn:PublisherService" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <publisher href="#id0"/>
- </ns1:add>
- <multiRef xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
-xmlns:ns3="http://soap.dev/soap/types" id="id0" soapenc:root="0"
-soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
-xsi:type="ns3:publisher">
- <region_id href="#id5"/>
- </multiRef>
- <multiRef xmlns:ns5="http://soap.dev/soap/types"
-xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" id="id5"
-soapenc:root="0"
-soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
-xsi:type="xsd:long">9</multiRef>
- </soapenv:Body>
-</soapenv:Envelope>';
-ini_set('soap.wsdl_cache_enabled', false);
-$server = new SoapServer(dirname(__FILE__)."/bug36908.wsdl");
-$server->setClass("PublisherService");
-$server->handle($input);
-?>
---EXPECT--
-<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:PublisherService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:addResponse><out xsi:type="xsd:string">9</out></ns1:addResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug36908.wsdl b/ext/soap/tests/bugs/bug36908.wsdl
deleted file mode 100755
index f3be3f6304..0000000000
--- a/ext/soap/tests/bugs/bug36908.wsdl
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
-xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-xmlns:api="http://soap.dev/soap/PublisherService"
-xmlns:types="http://soap.dev/soap/types"
-targetNamespace="http://soap.dev/soap/PublisherService">
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
-xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-xmlns:types="http://soap.dev/soap/types"
-targetNamespace="http://soap.dev/soap/types">
- <xsd:complexType name="publisher">
- <xsd:all>
- <xsd:element name="region_id" type="xsd:long" default="52"/>
- </xsd:all>
- </xsd:complexType>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="addInput">
- <wsdl:part name="publisher" type="types:publisher"/>
- </wsdl:message>
- <wsdl:message name="addOutput">
- <wsdl:part name="out" type="xsd:string"/>
- </wsdl:message>
- <wsdl:portType name="PublisherServicePortType">
- <wsdl:operation name="add">
- <wsdl:input message="api:addInput"/>
- <wsdl:output message="api:addOutput"/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="PublisherServiceBinding" type="api:PublisherServicePortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="add">
- <soap:operation soapAction="urn:PublisherService#add" style="rpc"/>
- <wsdl:input>
- <soap:body use="encoded" namespace="urn:PublisherService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="encoded" namespace="urn:PublisherService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="PublisherService">
- <wsdl:port name="PublisherServicePort" binding="api:PublisherServiceBinding">
- <soap:address location="http://soap.dev/soap//publisher_test.php"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/ext/soap/tests/bugs/bug37083.phpt b/ext/soap/tests/bugs/bug37083.phpt
deleted file mode 100755
index 471b5e49ad..0000000000
--- a/ext/soap/tests/bugs/bug37083.phpt
+++ /dev/null
@@ -1,58 +0,0 @@
---TEST--
-Bug #37083 (Frequent crashs in SOAP extension with new WSDL caching code in multithread WS)
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---INI--
-soap.wsdl_cache_enabled=3
---FILE--
-<?php
-class TestSoapClient extends SoapClient {
- function __doRequest($request, $location, $action, $version) {
- return <<<EOF
-<?xml version="1.0" encoding="utf-8"?>
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<soapenv:Body>
-<ns1:searchResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:java:de.pangaea.metadataportal.search.SearchService">
-<searchReturn href="#id0"/>
-</ns1:searchResponse>
-<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:SearchResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:java:de.pangaea.metadataportal.search.SearchService"><offset xsi:type="xsd:int">0</offset><queryTime xsi:type="xsd:long">34</queryTime><results soapenc:arrayType="ns2:SearchResponseItem[10]" xsi:type="soapenc:Array"><results href="#id1"/><results href="#id2"/><results href="#id3"/><results href="#id4"/><results href="#id5"/><results href="#id6"/><results href="#id7"/><results href="#id8"/><results href="#id9"/><results href="#id10"/></results><totalCount xsi:type="xsd:int">3501</totalCount></multiRef>
-<multiRef id="id9" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:SearchResponseItem" xmlns:ns3="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id11"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900168</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml1</xml></multiRef>
-<multiRef id="id7" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:SearchResponseItem" xmlns:ns4="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id12"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900039</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml2</xml></multiRef>
-<multiRef id="id6" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:SearchResponseItem" xmlns:ns5="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id13"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900040</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml3</xml></multiRef>
-<multiRef id="id10" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns6:SearchResponseItem" xmlns:ns6="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id14"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:41534</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml4</xml></multiRef>
-<multiRef id="id8" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns7:SearchResponseItem" xmlns:ns7="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id15"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900038</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml5</xml></multiRef>
-<multiRef id="id4" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns8:SearchResponseItem" xmlns:ns8="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id16"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:2900229</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml6</xml></multiRef>
-<multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns9:SearchResponseItem" xmlns:ns9="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id17"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:2900228</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml7</xml></multiRef>
-<multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns10:SearchResponseItem" xmlns:ns10="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id18"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:2900230</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml8</xml></multiRef>
-<multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns11:SearchResponseItem" xmlns:ns11="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id19"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:2900235</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml9</xml></multiRef>
-<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns12:SearchResponseItem" xmlns:ns12="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><fields href="#id20"/><identifier xsi:type="xsd:string">oai:dlmd.ifremer.fr:5900196</identifier><score xsi:type="xsd:float">0.13684115</score><xml xsi:type="xsd:string">xml10</xml></multiRef>
-<multiRef id="id15" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns13:Map" xmlns:ns13="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-12-01T04:58:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">105.539</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">112.283</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-30.024</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-34.788</value></value></item></multiRef>
-<multiRef id="id20" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns14:Map" xmlns:ns14="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-06-07T17:41:44.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">129.882</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">133.635</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">39.529</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">36.419</value></value></item></multiRef>
-<multiRef id="id18" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns15:Map" xmlns:ns15="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-03-10T01:40:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">63.121</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">80.92</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">0.158</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-3.675</value></value></item></multiRef>
-<multiRef id="id14" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns16:Map" xmlns:ns16="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2003-01-12T05:15:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-42.88</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-20.85</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">61.41</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">43.2</value></value></item></multiRef>
-<multiRef id="id13" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns17:Map" xmlns:ns17="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-12-01T16:50:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">108.962</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">114.713</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-35.262</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-42.756</value></value></item></multiRef>
-<multiRef id="id17" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns18:Map" xmlns:ns18="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2003-10-10T11:52:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">68.14</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">95.987</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">3.97</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-1.242</value></value></item></multiRef>
-<multiRef id="id16" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns19:Map" xmlns:ns19="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-01-10T10:35:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">67.71</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">77.743</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">3.546</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-1.965</value></value></item></multiRef>
-<multiRef id="id19" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns20:Map" xmlns:ns20="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-04-09T23:00:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">59.116</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">69.206</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-2.274</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-4.093</value></value></item></multiRef>
-<multiRef id="id11" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns21:Map" xmlns:ns21="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2002-11-09T23:10:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">156.013</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">160.042</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">5.648</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">4.773</value></value></item></multiRef>
-<multiRef id="id12" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns22:Map" xmlns:ns22="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><item><key xsi:type="soapenc:string">maxDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2038-12-31T22:59:59.000Z</value></value></item><item><key xsi:type="soapenc:string">minDateTime</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="xsd:dateTime">2004-11-01T16:58:00.000Z</value></value></item><item><key xsi:type="soapenc:string">minLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">108.11</value></value></item><item><key xsi:type="soapenc:string">maxLongitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">113.383</value></value></item><item><key xsi:type="soapenc:string">maxLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-31.666</value></value></item><item><key xsi:type="soapenc:string">minLatitude</key><value soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"><value xsi:type="soapenc:double">-35.075</value></value></item></multiRef>
-</soapenv:Body></soapenv:Envelope>
-EOF;
- }
-}
-for ($i = 0; $i < 10; $i++) {
- $ws=new TestSoapClient(dirname(__FILE__).'/bug37083.wsdl',
- array('encoding'=>'ISO-8859-1',
- 'cache_wsdl'=>WSDL_CACHE_BOTH));
- $search=new stdClass();
- $search->queryString='argo';
- $search->ranges[]=$r=new stdClass();
- $r->field='maxDateTime';
- $r->min='2003-04-01';
- $search->index='all';
- $res=$ws->search($search,0,10);
-}
-echo "ok\n";
-?>
---EXPECT--
-ok
diff --git a/ext/soap/tests/bugs/bug37083.wsdl b/ext/soap/tests/bugs/bug37083.wsdl
deleted file mode 100755
index 2a3b379802..0000000000
--- a/ext/soap/tests/bugs/bug37083.wsdl
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions targetNamespace="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:intf="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <schema targetNamespace="urn:java:de.pangaea.metadataportal.search.SearchService" xmlns="http://www.w3.org/2001/XMLSchema">
- <import namespace="http://xml.apache.org/xml-soap"/>
- <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
- <complexType name="SearchRequestRange">
- <sequence>
- <element name="field" nillable="true" type="xsd:string"/>
- <element name="max" nillable="true" type="xsd:anyType"/>
- <element name="min" nillable="true" type="xsd:anyType"/>
- </sequence>
- </complexType>
- <complexType name="ArrayOfSearchRequestRange">
- <complexContent>
- <restriction base="soapenc:Array">
- <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:SearchRequestRange[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="SearchRequest">
- <sequence>
- <element name="index" nillable="true" type="xsd:string"/>
- <element name="queryString" nillable="true" type="xsd:string"/>
- <element name="ranges" nillable="true" type="impl:ArrayOfSearchRequestRange"/>
- </sequence>
- </complexType>
- <complexType name="SearchResponseItem">
- <sequence>
- <element name="fields" nillable="true" type="apachesoap:Map"/>
- <element name="identifier" nillable="true" type="xsd:string"/>
- <element name="score" type="xsd:float"/>
- <element name="xml" nillable="true" type="xsd:string"/>
- </sequence>
- </complexType>
- <complexType name="ArrayOfSearchResponseItem">
- <complexContent>
- <restriction base="soapenc:Array">
- <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:SearchResponseItem[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="SearchResponse">
- <sequence>
- <element name="offset" type="xsd:int"/>
- <element name="queryTime" type="xsd:long"/>
- <element name="results" nillable="true" type="impl:ArrayOfSearchResponseItem"/>
- <element name="totalCount" type="xsd:int"/>
- </sequence>
- </complexType>
- </schema>
- <schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
- <import namespace="urn:java:de.pangaea.metadataportal.search.SearchService"/>
- <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
- <complexType name="mapItem">
- <sequence>
- <element name="key" nillable="true" type="xsd:anyType"/>
- <element name="value" nillable="true" type="xsd:anyType"/>
- </sequence>
- </complexType>
- <complexType name="Map">
- <sequence>
- <element maxOccurs="unbounded" minOccurs="0" name="item" type="apachesoap:mapItem"/>
- </sequence>
- </complexType>
- </schema>
- </wsdl:types>
- <wsdl:message name="searchRequest">
- <wsdl:part name="in0" type="impl:SearchRequest"/>
- <wsdl:part name="in1" type="xsd:int"/>
- <wsdl:part name="in2" type="xsd:int"/>
- </wsdl:message>
- <wsdl:message name="searchResponse">
- <wsdl:part name="searchReturn" type="impl:SearchResponse"/>
- </wsdl:message>
- <wsdl:portType name="SearchServiceAxisImpl">
- <wsdl:operation name="search" parameterOrder="in0 in1 in2">
- <wsdl:input message="impl:searchRequest" name="searchRequest"/>
- <wsdl:output message="impl:searchResponse" name="searchResponse"/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="SearchSoapBinding" type="impl:SearchServiceAxisImpl">
- <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="search">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="searchRequest">
- <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:java:de.pangaea.metadataportal.search.SearchService" use="encoded"/>
- </wsdl:input>
- <wsdl:output name="searchResponse">
- <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:java:de.pangaea.metadataportal.search.SearchService" use="encoded"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="SearchServiceAxisImplService">
- <wsdl:port binding="impl:SearchSoapBinding" name="Search">
- <wsdlsoap:address location="test://"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>