- support for SOAP headers
- actor attribute
- mustUnderstend attribute
+- root attribute
- make sure soap 1.1 and 1.2 are supported fully
Encoding
- references to external resources
? support for "nillable" and "nil"
- default values
-- root attribute
? provide schema 1999/2001 support???
? make internal refrences for soap encoding (use seralization logic)???
? provide user space overriding of serialization certin objects and types???
- support for style "rpc"/"document" encoding (server part)
How to get function name from request? May be SoapAction HTTP header?
+ support for "encoded"/"literal" encoding
-? arrayType and "literal" encoding
++ arrayType and "literal" encoding
- function/method overloading/redeclaration (test(int); test(string))
- wsdl caching
- wsdl auto generation
static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style);
static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style);
+static zval *to_zval_object(encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data);
+
+static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style);
+static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style);
+
+/* Try and guess for non-wsdl clients and servers */
+static zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data);
+static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style);
+
static int is_map(zval *array);
static void get_array_type(xmlNodePtr node, zval *array, smart_str *out_type TSRMLS_DC);
static void get_type_str(xmlNodePtr node, const char* ns, const char* type, smart_str* ret);
static void set_ns_and_type_ex(xmlNodePtr node, char *ns, char *type);
+static void set_ns_and_type(xmlNodePtr node, encodeTypePtr type);
+
+#define FIND_XML_NULL(xml,zval) \
+ { \
+ xmlAttrPtr null; \
+ if (!xml) { \
+ ZVAL_NULL(zval); \
+ return zval; \
+ } \
+ if (xml->properties) { \
+ null = get_attribute(xml->properties, "nil"); \
+ if (null) { \
+ ZVAL_NULL(zval); \
+ return zval; \
+ } \
+ } \
+ }
+
+#define FIND_ZVAL_NULL(zval, xml, style) \
+{ \
+ if (!zval || Z_TYPE_P(zval) == IS_NULL) { \
+ if (style == SOAP_ENCODED) {\
+ xmlSetProp(xml, "xsi:nil", "1"); \
+ }\
+ return xml; \
+ } \
+}
+
encode defaultEncoding[] = {
{{UNKNOWN_TYPE, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert},
static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style)
{
- xmlNodePtr ret;
-
- ret = xmlNewNode(NULL, "BOGUS");
- FIND_ZVAL_NULL(data, ret, style);
+ xmlNodePtr ret = xmlNewNode(NULL, "BOGUS");
if (style == SOAP_ENCODED) {
xmlSetProp(ret, "xsi:nil", "1");
}
/* Struct encode/decode */
-zval *to_zval_object(encodeTypePtr type, xmlNodePtr data)
+static zval *to_zval_object(encodeTypePtr type, xmlNodePtr data)
{
zval *ret;
xmlNodePtr trav;
zval *base;
MAKE_STD_ZVAL(ret);
- FIND_XML_NULL(data, ret);
object_init(ret);
base = master_to_zval(enc, data);
zval *base;
MAKE_STD_ZVAL(ret);
- FIND_XML_NULL(data, ret);
object_init(ret);
base = master_to_zval(sdlType->encode, data);
return 1;
}
-xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style)
+static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style)
{
xmlNodePtr xmlParam;
HashTable *prop;
xmlAddChild(xmlParam, property);
zend_hash_move_forward(prop);
}
- if (style == SOAP_ENCODED) {
- set_ns_and_type(xmlParam, type);
- }
+ }
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(xmlParam, type);
}
}
return xmlParam;
return 0;
}
-xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style)
+static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style)
{
sdlTypePtr sdl_type = type->sdl_type;
smart_str array_type = {0}, array_size = {0};
add_xml_array_elements(xmlParam, sdl_type, enc, dimension, dims, data, style);
efree(dims);
- if (style == SOAP_ENCODED) {
- set_ns_and_type(xmlParam, type);
- }
+ }
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(xmlParam, type);
}
return xmlParam;
}
-zval *to_zval_array(encodeTypePtr type, xmlNodePtr data)
+static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data)
{
zval *ret;
xmlNodePtr trav;
if (Z_TYPE_P(data) == IS_ARRAY) {
i = zend_hash_num_elements(Z_ARRVAL_P(data));
/* TODO: Register namespace...??? */
- xmlSetProp(xmlParam, "xmlns:apache", "http://xml.apache.org/xml-soap");
+// xmlSetProp(xmlParam, APACHE_NS_PREFIX, APACHE_NAMESPACE);
zend_hash_internal_pointer_reset(data->value.ht);
for (;i > 0;i--) {
xmlNodePtr xparam, item;
}
zend_hash_move_forward(data->value.ht);
}
- if (style == SOAP_ENCODED) {
- set_ns_and_type(xmlParam, type);
- }
+ }
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(xmlParam, type);
}
return xmlParam;
} else {
php_error(E_ERROR, "Error encoding apache map, only Strings or Longs are allowd as keys");
}
+ zval_ptr_dtor(&key);
}
ENDFOREACH(trav);
} else {
}
/* Unknown encode/decode */
-xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style)
+static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style)
{
encodePtr enc;
TSRMLS_FETCH();
return master_to_xml(enc, data, style);
}
-zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data)
+static zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data)
{
encodePtr enc = NULL;
xmlAttrPtr tmpattr;
strcpy(buf, Z_STRVAL_P(data));
xmlNodeSetContentLen(xmlParam, buf, Z_STRLEN_P(data));
- } else {
- xmlSetProp(xmlParam, "xsi:nil", "1");
}
if (style == SOAP_ENCODED) {
return to_xml_datetime_ex(type, data, "--%m--", style);
}
-void set_ns_and_type(xmlNodePtr node, encodeTypePtr type)
+static zval* to_zval_list(encodeTypePtr enc, xmlNodePtr data) {
+ /*FIXME*/
+ return to_zval_stringc(enc, data);
+}
+
+static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style) {
+ xmlNodePtr ret;
+
+ ret = xmlNewNode(NULL, "BOGUS");
+ FIND_ZVAL_NULL(data, ret, style);
+ if (Z_TYPE_P(data) == IS_ARRAY) {
+ zval **tmp;
+ smart_str list = {0};
+ HashTable *ht = Z_ARRVAL_P(data);
+
+ zend_hash_internal_pointer_reset(ht);
+ while (zend_hash_get_current_data(ht, (void**)&tmp) == SUCCESS) {
+ if (list.len != 0) {
+ smart_str_appendc(&list, ' ');
+ }
+ if (Z_TYPE_PP(tmp) == IS_STRING) {
+ smart_str_appendl(&list, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ } else {
+ zval copy = **tmp;
+ zval_copy_ctor(©);
+ convert_to_string(©);
+ smart_str_appendl(&list, Z_STRVAL(copy), Z_STRLEN(copy));
+ zval_dtor(©);
+ }
+ zend_hash_move_forward(ht);
+ }
+ smart_str_0(&list);
+ xmlNodeSetContentLen(ret, list.c, list.len);
+ smart_str_free(&list);
+ } else if (Z_TYPE_P(data) == IS_STRING) {
+ xmlNodeSetContentLen(ret, Z_STRVAL_P(data), Z_STRLEN_P(data));
+ } else {
+ zval tmp = *data;
+
+ zval_copy_ctor(&tmp);
+ convert_to_string(&tmp);
+ xmlNodeSetContentLen(ret, Z_STRVAL(tmp), Z_STRLEN(tmp));
+ zval_dtor(&tmp);
+ }
+ return ret;
+}
+
+static zval* to_zval_union(encodeTypePtr enc, xmlNodePtr data) {
+ /*FIXME*/
+ return to_zval_list(enc, data);
+}
+
+static xmlNodePtr to_xml_union(encodeTypePtr enc, zval *data, int style) {
+ /*FIXME*/
+ return to_xml_list(enc,data,style);
+}
+
+zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data)
+{
+ sdlTypePtr type;
+
+ type = enc->sdl_type;
+
+ if (type && type->restrictions &&
+ data && data->children && data->children->content) {
+ if (type->restrictions->whiteSpace && type->restrictions->whiteSpace->value) {
+ if (strcmp(type->restrictions->whiteSpace->value,"replace") == 0) {
+ whiteSpace_replace(data->children->content);
+ } else if (strcmp(type->restrictions->whiteSpace->value,"collapse") == 0) {
+ whiteSpace_collapse(data->children->content);
+ }
+ }
+ if (type->restrictions->enumeration) {
+ if (!zend_hash_exists(type->restrictions->enumeration,data->children->content,strlen(data->children->content)+1)) {
+ php_error(E_WARNING,"Restriction: invalid enumeration value \"%s\"",data->children->content);
+ }
+ }
+ if (type->restrictions->minLength &&
+ strlen(data->children->content) < type->restrictions->minLength->value) {
+ php_error(E_WARNING,"Restriction: length less then 'minLength'");
+ }
+ if (type->restrictions->maxLength &&
+ strlen(data->children->content) > type->restrictions->maxLength->value) {
+ php_error(E_WARNING,"Restriction: length greater then 'maxLength'");
+ }
+ if (type->restrictions->length &&
+ strlen(data->children->content) != type->restrictions->length->value) {
+ php_error(E_WARNING,"Restriction: length is not equal to 'length'");
+ }
+ }
+ switch (type->kind) {
+ case XSD_TYPEKIND_SIMPLE:
+ if (type->encode && enc != &type->encode->details) {
+ return master_to_zval(type->encode, data);
+ }
+ break;
+ case XSD_TYPEKIND_LIST:
+ return to_zval_list(enc, data);
+ case XSD_TYPEKIND_UNION:
+ return to_zval_union(enc, data);
+ case XSD_TYPEKIND_COMPLEX:
+ case XSD_TYPEKIND_RESTRICTION:
+ case XSD_TYPEKIND_EXTENSION:
+ if (type->encode &&
+ (type->encode->details.type == IS_ARRAY ||
+ type->encode->details.type == SOAP_ENC_ARRAY)) {
+ return to_zval_array(enc, data);
+ }
+ return to_zval_object(enc, data);
+ default:
+ break;
+ }
+ return guess_zval_convert(enc, data);
+}
+
+xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style)
+{
+ sdlTypePtr type;
+ xmlNodePtr ret = NULL;
+
+ type = enc->sdl_type;
+
+ if (type) {
+ if (type->restrictions && Z_TYPE_P(data) == IS_STRING) {
+ if (type->restrictions->enumeration) {
+ if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRLEN_P(data)+1)) {
+ php_error(E_WARNING,"Restriction: invalid enumeration value \"%s\".",Z_STRVAL_P(data));
+ }
+ }
+ if (type->restrictions->minLength &&
+ Z_STRLEN_P(data) < type->restrictions->minLength->value) {
+ php_error(E_WARNING,"Restriction: length less then 'minLength'");
+ }
+ if (type->restrictions->maxLength &&
+ Z_STRLEN_P(data) > type->restrictions->maxLength->value) {
+ php_error(E_WARNING,"Restriction: length greater then 'maxLength'");
+ }
+ if (type->restrictions->length &&
+ Z_STRLEN_P(data) != type->restrictions->length->value) {
+ php_error(E_WARNING,"Restriction: length is not equal to 'length'");
+ }
+ }
+ }
+ switch(type->kind) {
+ case XSD_TYPEKIND_SIMPLE:
+ if (type->encode && enc != &type->encode->details) {
+ ret = master_to_xml(type->encode, data, style);
+ }
+ break;
+ case XSD_TYPEKIND_LIST:
+ ret = to_xml_list(enc, data, style);
+ break;
+ case XSD_TYPEKIND_UNION:
+ ret = to_xml_union(enc, data, style);
+ break;
+ case XSD_TYPEKIND_COMPLEX:
+ case XSD_TYPEKIND_RESTRICTION:
+ case XSD_TYPEKIND_EXTENSION:
+ if (type->encode &&
+ (type->encode->details.type == IS_ARRAY ||
+ type->encode->details.type == SOAP_ENC_ARRAY)) {
+ ret = to_xml_array(enc, data, style);
+ } else {
+ ret = to_xml_object(enc, data, style);
+ }
+ break;
+ default:
+ break;
+ }
+ if (ret == NULL) {
+ ret = guess_xml_convert(enc, data, style);
+ }
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, enc);
+ }
+ return ret;
+}
+
+static void set_ns_and_type(xmlNodePtr node, encodeTypePtr type)
{
set_ns_and_type_ex(node, type->ns, type->type_str);
}
return tmp;
}
+static void delete_mapping(void *data)
+{
+ soapMappingPtr map = (soapMappingPtr)data;
+
+ if (map->ns) {
+ efree(map->ns);
+ }
+ if (map->ctype) {
+ efree(map->ctype);
+ }
+
+ if (map->type == SOAP_MAP_FUNCTION) {
+ if (map->map_functions.to_xml_before) {
+ zval_ptr_dtor(&map->map_functions.to_xml_before);
+ }
+ if (map->map_functions.to_xml) {
+ zval_ptr_dtor(&map->map_functions.to_xml);
+ }
+ if (map->map_functions.to_xml_after) {
+ zval_ptr_dtor(&map->map_functions.to_xml_after);
+ }
+ if (map->map_functions.to_zval_before) {
+ zval_ptr_dtor(&map->map_functions.to_zval_before);
+ }
+ if (map->map_functions.to_zval) {
+ zval_ptr_dtor(&map->map_functions.to_zval);
+ }
+ if (map->map_functions.to_zval_after) {
+ zval_ptr_dtor(&map->map_functions.to_zval_after);
+ }
+ }
+ efree(map);
+}
+
void delete_encoder(void *encode)
{
encodePtr t = *((encodePtr*)encode);
#define XSD_NMTOKENS_STRING "NMTOKENS"
#define APACHE_NAMESPACE "http://xml.apache.org/xml-soap"
-#define APACHE_NS_PREFIX "apache"
#define APACHE_MAP 200
#define APACHE_MAP_STRING "Map"
void whiteSpace_replace(char* str);
void whiteSpace_collapse(char* str);
-zval *to_zval_object(encodeTypePtr type, xmlNodePtr data);
-zval *to_zval_array(encodeTypePtr type, xmlNodePtr data);
-
-xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style);
-xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style);
-
-/* Try and guess for non-wsdl clients and servers */
-zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data);
-xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style);
+xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style);
+zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data);
#define get_conversion(e) get_conversion_ex(SOAP_GLOBAL(defEncIndex), e)
#define get_conversion_from_type(n, t) get_conversion_from_type_ex(SOAP_GLOBAL(defEnc), n, t)
void encode_reset_ns();
smart_str *encode_new_ns();
-void set_ns_and_type(xmlNodePtr node, encodeTypePtr type);
encodePtr get_conversion_ex(HashTable *encoding, int encode);
encodePtr get_conversion_from_type_ex(HashTable *encoding, xmlNodePtr node, const char *type);
extern encode defaultEncoding[];
-#define FIND_XML_NULL(xml,zval) \
- { \
- xmlAttrPtr null; \
- if (!xml) { \
- ZVAL_NULL(zval); \
- return zval; \
- } \
- if (xml->properties) { \
- null = get_attribute(xml->properties, "nil"); \
- if (null) { \
- ZVAL_NULL(zval); \
- return zval; \
- } \
- } \
- }
-
-#define FIND_ZVAL_NULL(zval, xml, style) \
-{ \
- if (!zval || Z_TYPE_P(zval) == IS_NULL) { \
- if (style == SOAP_ENCODED) {\
- xmlSetProp(xml, "xsi:nil", "1"); \
- }\
- return xml; \
- } \
-}
-
-
#endif
tmp = get_node(fault->children,"detail");
if (tmp != NULL) {
- encodePtr enc;
- enc = get_conversion(UNKNOWN_TYPE);
- details = master_to_zval(enc, tmp);
+ details = master_to_zval(NULL, tmp);
}
add_soap_fault(this_ptr, faultcode, faultstring, faultactor, details TSRMLS_CC);
if (param != NULL) {
tmp = master_to_zval(param->encode, val);
} else {
- tmp = master_to_zval(get_conversion(UNKNOWN_TYPE), val);
+ tmp = master_to_zval(NULL, val);
}
}
add_assoc_zval(return_value, param->paramName, tmp);
val = val->next;
}
if (val != NULL) {
- encodePtr enc;
zval *tmp;
- enc = get_conversion(UNKNOWN_TYPE);
- tmp = master_to_zval(enc, val);
+ tmp = master_to_zval(NULL, val);
if (val->name) {
add_assoc_zval(return_value, (char*)val->name, tmp);
} else {
static void schema_type_fixup(sdlPtr sdl, sdlTypePtr type);
static void delete_model(void *handle);
+static void delete_type(void *data);
+static void delete_attribute(void *attribute);
+static void delete_restriction_var_int(void *rvi);
+static void delete_schema_restriction_var_char(void *srvc);
+
+static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type)
+{
+ smart_str nscat = {0};
+ encodePtr enc, *enc_ptr;
+
+ if (sdl->encoders == NULL) {
+ sdl->encoders = malloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 1);
+ }
+ smart_str_appends(&nscat, ns);
+ smart_str_appendc(&nscat, ':');
+ smart_str_appends(&nscat, type);
+ smart_str_0(&nscat);
+ if (zend_hash_find(sdl->encoders, nscat.c, nscat.len + 1, (void**)&enc_ptr) == SUCCESS) {
+ enc = *enc_ptr;
+ if (enc->details.ns) {
+ free(enc->details.ns);
+ }
+ if (enc->details.type_str) {
+ free(enc->details.type_str);
+ }
+ } else {
+ enc_ptr = NULL;
+ enc = malloc(sizeof(encode));
+ }
+ memset(enc, 0, sizeof(encode));
+
+ enc->details.ns = strdup(ns);
+ enc->details.type_str = strdup(type);
+ enc->details.sdl_type = cur_type;
+ enc->to_xml = sdl_guess_convert_xml;
+ enc->to_zval = sdl_guess_convert_zval;
+
+ if (enc_ptr == NULL) {
+ zend_hash_update(sdl->encoders, nscat.c, nscat.len + 1, &enc, sizeof(encodePtr), NULL);
+ }
+ smart_str_free(&nscat);
+ return enc;
+}
+
+static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type)
+{
+ encodePtr enc = NULL;
+ smart_str nscat = {0};
+ TSRMLS_FETCH();
+
+ smart_str_appends(&nscat, ns);
+ smart_str_appendc(&nscat, ':');
+ smart_str_appends(&nscat, type);
+ smart_str_0(&nscat);
+
+ enc = get_conversion_from_href_type(nscat.c);
+ if (enc == NULL) {
+ enc = get_conversion_from_href_type_ex(sdl->encoders, nscat.c, nscat.len);
+ }
+ if (enc == NULL) {
+ enc = create_encoder(sdl, cur_type, ns, type);
+ }
+
+ smart_str_free(&nscat);
+ return enc;
+}
static int is_blank(const char* str)
{
static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valptr)
{
- xmlAttrPtr fixed, value, id;
+ xmlAttrPtr fixed, value;
if ((*valptr) == NULL) {
(*valptr) = malloc(sizeof(sdlRestrictionInt));
(*valptr)->fixed = TRUE;
}
- id = get_attribute(val->properties, "id");
- if (id != NULL) {
- (*valptr)->id = strdup(id->children->content);
- }
-
value = get_attribute(val->properties, "value");
if (value == NULL) {
php_error(E_ERROR, "Error parsing wsdl (missing restriction value)");
static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *valptr)
{
- xmlAttrPtr fixed, value, id;
+ xmlAttrPtr fixed, value;
if ((*valptr) == NULL) {
(*valptr) = malloc(sizeof(sdlRestrictionChar));
}
}
- id = get_attribute(val->properties, "id");
- if (id != NULL) {
- (*valptr)->id = strdup(id->children->content);
- }
-
value = get_attribute(val->properties, "value");
if (value == NULL) {
php_error(E_ERROR, "Error parsing wsdl (missing restriction value)");
attrs = element->properties;
attr = get_attribute(attrs, "nillable");
if (attr) {
+ if (ref != NULL) {
+ php_error(E_ERROR, "Error parsing schema (element have both 'ref' and 'nillable' attributes)");
+ }
if (!stricmp(attr->children->content, "true") ||
!stricmp(attr->children->content, "1")) {
cur_type->nillable = TRUE;
cur_type->nillable = FALSE;
}
+ attr = get_attribute(attrs, "fixed");
+ if (attr) {
+ if (ref != NULL) {
+ php_error(E_ERROR, "Error parsing schema (element have both 'ref' and 'fixed' attributes)");
+ }
+ cur_type->fixed = strdup(attr->children->content);
+ }
+
+ attr = get_attribute(attrs, "default");
+ if (attr) {
+ if (ref != NULL) {
+ php_error(E_ERROR, "Error parsing schema (element have both 'ref' and 'fixed' attributes)");
+ } else if (ref != NULL) {
+ php_error(E_ERROR, "Error parsing schema (element have both 'default' and 'fixed' attributes)");
+ }
+ cur_type->def = strdup(attr->children->content);
+ }
+
/* type = QName */
type = get_attribute(attrs, "type");
if (type) {
} else if (attr_is_equal_ex(attr, "fixed", SCHEMA_NAMESPACE)) {
newAttr->fixed = strdup(attr->children->content);
} else if (attr_is_equal_ex(attr, "form", SCHEMA_NAMESPACE)) {
- newAttr->form = strdup(attr->children->content);
+ if (strcmp(attr->children->content,"qualified") == 0) {
+ newAttr->form = XSD_FORM_QUALIFIED;
+ } else if (strcmp(attr->children->content,"unqualified") == 0) {
+ newAttr->form = XSD_FORM_UNQUALIFIED;
+ } else {
+ newAttr->form = XSD_FORM_DEFAULT;
+ }
} else if (attr_is_equal_ex(attr, "id", SCHEMA_NAMESPACE)) {
- newAttr->id = strdup(attr->children->content);
+ /* skip */
} else if (attr_is_equal_ex(attr, "name", SCHEMA_NAMESPACE)) {
newAttr->name = strdup(attr->children->content);
} else if (attr_is_equal_ex(attr, "ref", SCHEMA_NAMESPACE)) {
} else if (attr_is_equal_ex(attr, "type", SCHEMA_NAMESPACE)) {
/* already processed */
} else if (attr_is_equal_ex(attr, "use", SCHEMA_NAMESPACE)) {
- newAttr->use = strdup(attr->children->content);
+ if (strcmp(attr->children->content,"prohibited") == 0) {
+ newAttr->use = XSD_USE_PROHIBITED;
+ } else if (strcmp(attr->children->content,"required") == 0) {
+ newAttr->use = XSD_USE_REQUIRED;
+ } else if (strcmp(attr->children->content,"optional") == 0) {
+ newAttr->use = XSD_USE_OPTIONAL;
+ } else {
+ newAttr->use = XSD_USE_DEFAULT;
+ }
} else {
xmlNsPtr nsPtr = attr_find_ns(attr);
if ((*tmp)->fixed != NULL && attr->fixed == NULL) {
attr->fixed = strdup((*tmp)->fixed);
}
- if ((*tmp)->form != NULL && attr->form == NULL) {
- attr->form = strdup((*tmp)->form);
+ if (attr->form == XSD_FORM_DEFAULT) {
+ attr->form = (*tmp)->form;
}
- if ((*tmp)->use != NULL && attr->use == NULL) {
- attr->use = strdup((*tmp)->use);
+ if (attr->use == XSD_USE_DEFAULT) {
+ attr->use = (*tmp)->use;
}
if ((*tmp)->extraAttributes != NULL) {
xmlNodePtr node;
memcpy(newAttr, *tmp_attr, sizeof(sdlAttribute));
if (newAttr->def) {newAttr->def = strdup(newAttr->def);}
if (newAttr->fixed) {newAttr->fixed = strdup(newAttr->fixed);}
- if (newAttr->form) {newAttr->form = strdup(newAttr->form);}
if (newAttr->name) {newAttr->name = strdup(newAttr->name);}
- if (newAttr->use) {newAttr->use = strdup(newAttr->use);}
if (newAttr->extraAttributes) {
xmlNodePtr node;
HashTable *ht = malloc(sizeof(HashTable));
}
free(tmp);
}
+
+static void delete_type(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->restrictions) {
+ delete_restriction_var_int(&type->restrictions->minExclusive);
+ delete_restriction_var_int(&type->restrictions->minInclusive);
+ delete_restriction_var_int(&type->restrictions->maxExclusive);
+ delete_restriction_var_int(&type->restrictions->maxInclusive);
+ delete_restriction_var_int(&type->restrictions->totalDigits);
+ delete_restriction_var_int(&type->restrictions->fractionDigits);
+ delete_restriction_var_int(&type->restrictions->length);
+ delete_restriction_var_int(&type->restrictions->minLength);
+ delete_restriction_var_int(&type->restrictions->maxLength);
+ delete_schema_restriction_var_char(&type->restrictions->whiteSpace);
+ delete_schema_restriction_var_char(&type->restrictions->pattern);
+ if (type->restrictions->enumeration) {
+ zend_hash_destroy(type->restrictions->enumeration);
+ free(type->restrictions->enumeration);
+ }
+ free(type->restrictions);
+ }
+ free(type);
+}
+
+static void delete_attribute(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->ref) {
+ free(attr->ref);
+ }
+ if (attr->extraAttributes) {
+ zend_hash_destroy(attr->extraAttributes);
+ free(attr->extraAttributes);
+ }
+}
+
+static void delete_restriction_var_int(void *rvi)
+{
+ sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi);
+ if (ptr) {
+ free(ptr);
+ }
+}
+
+static void delete_schema_restriction_var_char(void *srvc)
+{
+ sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc);
+ if (ptr) {
+ if (ptr->value) {
+ free(ptr->value);
+ }
+ free(ptr);
+ }
+}
+
return enc;
}
-encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type)
-{
- encodePtr enc = NULL;
- smart_str nscat = {0};
- TSRMLS_FETCH();
-
- smart_str_appends(&nscat, ns);
- smart_str_appendc(&nscat, ':');
- smart_str_appends(&nscat, type);
- smart_str_0(&nscat);
-
- enc = get_conversion_from_href_type(nscat.c);
- if (enc == NULL) {
- enc = get_conversion_from_href_type_ex(sdl->encoders, nscat.c, nscat.len);
- }
- if (enc == NULL) {
- enc = create_encoder(sdl, cur_type, ns, type);
- }
-
- smart_str_free(&nscat);
- return enc;
-}
-
-encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type)
-{
- smart_str nscat = {0};
- encodePtr enc, *enc_ptr;
-
- if (sdl->encoders == NULL) {
- sdl->encoders = malloc(sizeof(HashTable));
- zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 1);
- }
- smart_str_appends(&nscat, ns);
- smart_str_appendc(&nscat, ':');
- smart_str_appends(&nscat, type);
- smart_str_0(&nscat);
- if (zend_hash_find(sdl->encoders, nscat.c, nscat.len + 1, (void**)&enc_ptr) == SUCCESS) {
- enc = *enc_ptr;
- if (enc->details.ns) {
- free(enc->details.ns);
- }
- if (enc->details.type_str) {
- free(enc->details.type_str);
- }
- } else {
- enc_ptr = NULL;
- enc = malloc(sizeof(encode));
- }
- memset(enc, 0, sizeof(encode));
-
- enc->details.ns = strdup(ns);
- enc->details.type_str = strdup(type);
- enc->details.sdl_type = cur_type;
- enc->to_xml = sdl_guess_convert_xml;
- enc->to_zval = sdl_guess_convert_zval;
-
- if (enc_ptr == NULL) {
- zend_hash_update(sdl->encoders, nscat.c, nscat.len + 1, &enc, sizeof(encodePtr), NULL);
- }
- smart_str_free(&nscat);
- return enc;
-}
-
-static zval* to_zval_list(encodeTypePtr enc, xmlNodePtr data) {
- zval *ret;
- MAKE_STD_ZVAL(ret);
- FIND_XML_NULL(data, ret);
- if (data && data->children) {
- if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
- whiteSpace_collapse(data->children->content);
- ZVAL_STRING(ret, data->children->content, 1);
- } else {
- php_error(E_ERROR,"Violation of encoding rules");
- }
- } else {
- ZVAL_EMPTY_STRING(ret);
- }
- return ret;
-}
-
-static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style) {
- xmlNodePtr ret;
-
- ret = xmlNewNode(NULL, "BOGUS");
- FIND_ZVAL_NULL(data, ret, style);
- if (Z_TYPE_P(data) == IS_ARRAY) {
- zval **tmp;
- smart_str list = {0};
- HashTable *ht = Z_ARRVAL_P(data);
-
- zend_hash_internal_pointer_reset(ht);
- while (zend_hash_get_current_data(ht, (void**)&tmp) == SUCCESS) {
- if (list.len != 0) {
- smart_str_appendc(&list, ' ');
- }
- if (Z_TYPE_PP(tmp) == IS_STRING) {
- smart_str_appendl(&list, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
- } else {
- zval copy = **tmp;
- zval_copy_ctor(©);
- convert_to_string(©);
- smart_str_appendl(&list, Z_STRVAL(copy), Z_STRLEN(copy));
- zval_dtor(©);
- }
- zend_hash_move_forward(ht);
- }
- smart_str_0(&list);
- xmlNodeSetContentLen(ret, list.c, list.len);
- smart_str_free(&list);
- } else if (Z_TYPE_P(data) == IS_STRING) {
- xmlNodeSetContentLen(ret, Z_STRVAL_P(data), Z_STRLEN_P(data));
- } else {
- zval tmp = *data;
-
- zval_copy_ctor(&tmp);
- convert_to_string(&tmp);
- xmlNodeSetContentLen(ret, Z_STRVAL(tmp), Z_STRLEN(tmp));
- zval_dtor(&tmp);
- }
- return ret;
-}
-
-static zval* to_zval_union(encodeTypePtr enc, xmlNodePtr data) {
- /*FIXME*/
- return to_zval_list(enc, data);
-}
-
-static xmlNodePtr to_xml_union(encodeTypePtr enc, zval *data, int style) {
- /*FIXME*/
- return to_xml_list(enc,data,style);
-}
-
-zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data)
-{
- sdlTypePtr type;
-
- type = enc->sdl_type;
-
- if (type && type->restrictions &&
- data && data->children && data->children->content) {
- if (type->restrictions->whiteSpace && type->restrictions->whiteSpace->value) {
- if (strcmp(type->restrictions->whiteSpace->value,"replace") == 0) {
- whiteSpace_replace(data->children->content);
- } else if (strcmp(type->restrictions->whiteSpace->value,"collapse") == 0) {
- whiteSpace_collapse(data->children->content);
- }
- }
- if (type->restrictions->enumeration) {
- if (!zend_hash_exists(type->restrictions->enumeration,data->children->content,strlen(data->children->content)+1)) {
- php_error(E_WARNING,"Restriction: invalid enumeration value \"%s\"",data->children->content);
- }
- }
- if (type->restrictions->minLength &&
- strlen(data->children->content) < type->restrictions->minLength->value) {
- php_error(E_WARNING,"Restriction: length less then 'minLength'");
- }
- if (type->restrictions->maxLength &&
- strlen(data->children->content) > type->restrictions->maxLength->value) {
- php_error(E_WARNING,"Restriction: length greater then 'maxLength'");
- }
- if (type->restrictions->length &&
- strlen(data->children->content) != type->restrictions->length->value) {
- php_error(E_WARNING,"Restriction: length is not equal to 'length'");
- }
- }
- switch (type->kind) {
- case XSD_TYPEKIND_SIMPLE:
- if (type->encode && enc != &type->encode->details) {
- return master_to_zval(type->encode, data);
- }
- break;
- case XSD_TYPEKIND_LIST:
- return to_zval_list(enc, data);
- case XSD_TYPEKIND_UNION:
- return to_zval_union(enc, data);
- case XSD_TYPEKIND_COMPLEX:
- case XSD_TYPEKIND_RESTRICTION:
- case XSD_TYPEKIND_EXTENSION:
- if (type->encode &&
- (type->encode->details.type == IS_ARRAY ||
- type->encode->details.type == SOAP_ENC_ARRAY)) {
- return to_zval_array(enc, data);
- }
- return to_zval_object(enc, data);
- default:
- break;
- }
- return guess_zval_convert(enc, data);
-}
-
-xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style)
-{
- sdlTypePtr type;
- xmlNodePtr ret = NULL;
-
- type = enc->sdl_type;
-
- if (type) {
- if (type->restrictions && Z_TYPE_P(data) == IS_STRING) {
- if (type->restrictions->enumeration) {
- if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRLEN_P(data)+1)) {
- php_error(E_WARNING,"Restriction: invalid enumeration value \"%s\".",Z_STRVAL_P(data));
- }
- }
- if (type->restrictions->minLength &&
- Z_STRLEN_P(data) < type->restrictions->minLength->value) {
- php_error(E_WARNING,"Restriction: length less then 'minLength'");
- }
- if (type->restrictions->maxLength &&
- Z_STRLEN_P(data) > type->restrictions->maxLength->value) {
- php_error(E_WARNING,"Restriction: length greater then 'maxLength'");
- }
- if (type->restrictions->length &&
- Z_STRLEN_P(data) != type->restrictions->length->value) {
- php_error(E_WARNING,"Restriction: length is not equal to 'length'");
- }
- }
- }
- switch(type->kind) {
- case XSD_TYPEKIND_SIMPLE:
- if (type->encode && enc != &type->encode->details) {
- ret = master_to_xml(type->encode, data, style);
- }
- break;
- case XSD_TYPEKIND_LIST:
- ret = to_xml_list(enc, data, style);
- break;
- case XSD_TYPEKIND_UNION:
- ret = to_xml_union(enc, data, style);
- break;
- case XSD_TYPEKIND_COMPLEX:
- case XSD_TYPEKIND_RESTRICTION:
- case XSD_TYPEKIND_EXTENSION:
- if (type->encode &&
- (type->encode->details.type == IS_ARRAY ||
- type->encode->details.type == SOAP_ENC_ARRAY)) {
- ret = to_xml_array(enc, data, style);
- } else {
- ret = to_xml_object(enc, data, style);
- }
- break;
- default:
- break;
- }
- if (ret == NULL) {
- ret = guess_xml_convert(enc, data, style);
- }
- if (style == SOAP_ENCODED) {
- set_ns_and_type(ret, enc);
- }
- return ret;
-}
-
sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type)
{
sdlBindingPtr *binding;
free(param);
}
-void delete_mapping(void *data)
-{
- soapMappingPtr map = (soapMappingPtr)data;
-
- if (map->ns) {
- efree(map->ns);
- }
- if (map->ctype) {
- efree(map->ctype);
- }
-
- if (map->type == SOAP_MAP_FUNCTION) {
- if (map->map_functions.to_xml_before) {
- zval_ptr_dtor(&map->map_functions.to_xml_before);
- }
- if (map->map_functions.to_xml) {
- zval_ptr_dtor(&map->map_functions.to_xml);
- }
- if (map->map_functions.to_xml_after) {
- zval_ptr_dtor(&map->map_functions.to_xml_after);
- }
- if (map->map_functions.to_zval_before) {
- zval_ptr_dtor(&map->map_functions.to_zval_before);
- }
- if (map->map_functions.to_zval) {
- zval_ptr_dtor(&map->map_functions.to_zval);
- }
- if (map->map_functions.to_zval_after) {
- zval_ptr_dtor(&map->map_functions.to_zval_after);
- }
- }
- efree(map);
-}
-
-void delete_type(void *data)
-{
- sdlTypePtr type = *((sdlTypePtr*)data);
- if (type->name) {
- free(type->name);
- }
- if (type->namens) {
- free(type->namens);
- }
- if (type->elements) {
- zend_hash_destroy(type->elements);
- free(type->elements);
- }
- if (type->attributes) {
- zend_hash_destroy(type->attributes);
- free(type->attributes);
- }
- if (type->restrictions) {
- delete_restriction_var_int(&type->restrictions->minExclusive);
- delete_restriction_var_int(&type->restrictions->minInclusive);
- delete_restriction_var_int(&type->restrictions->maxExclusive);
- delete_restriction_var_int(&type->restrictions->maxInclusive);
- delete_restriction_var_int(&type->restrictions->totalDigits);
- delete_restriction_var_int(&type->restrictions->fractionDigits);
- delete_restriction_var_int(&type->restrictions->length);
- delete_restriction_var_int(&type->restrictions->minLength);
- delete_restriction_var_int(&type->restrictions->maxLength);
- delete_schema_restriction_var_char(&type->restrictions->whiteSpace);
- delete_schema_restriction_var_char(&type->restrictions->pattern);
- if (type->restrictions->enumeration) {
- zend_hash_destroy(type->restrictions->enumeration);
- free(type->restrictions->enumeration);
- }
- free(type->restrictions);
- }
- free(type);
-}
-
-void delete_attribute(void *attribute)
-{
- sdlAttributePtr attr = *((sdlAttributePtr*)attribute);
-
- if (attr->def) {
- free(attr->def);
- }
- if (attr->fixed) {
- free(attr->fixed);
- }
- if (attr->form) {
- free(attr->form);
- }
- if (attr->id) {
- free(attr->id);
- }
- if (attr->name) {
- free(attr->name);
- }
- if (attr->ref) {
- free(attr->ref);
- }
- if (attr->use) {
- free(attr->use);
- }
- if (attr->extraAttributes) {
- zend_hash_destroy(attr->extraAttributes);
- free(attr->extraAttributes);
- }
-}
-
-void delete_restriction_var_int(void *rvi)
-{
- sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi);
- if (ptr) {
- if (ptr->id) {
- free(ptr->id);
- }
- free(ptr);
- }
-}
-
-void delete_schema_restriction_var_char(void *srvc)
-{
- sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc);
- if (ptr) {
- if (ptr->id) {
- free(ptr->id);
- }
- if (ptr->value) {
- free(ptr->value);
- }
- free(ptr);
- }
-}
-
static void delete_document(void *doc_ptr)
{
xmlDocPtr doc = *((xmlDocPtr*)doc_ptr);
#define SOAP_LITERAL 2
struct _sdl {
- HashTable docs; /* pointer to the parsed xml file */
- HashTable functions; /* array of sdlFunction */
+ HashTable docs; /* pointer to the parsed xml file */
+ HashTable functions; /* array of sdlFunction */
HashTable *types; /* array of sdlTypesPtr */
HashTable *elements; /* array of sdlTypesPtr */
HashTable *encoders; /* array of encodePtr */
HashTable *attributes; /* array of sdlAttributePtr */
HashTable *attributeGroups; /* array of sdlTypesPtr */
HashTable *groups; /* array of sdlTypesPtr */
- char *target_ns;
- char *source;
+ char *target_ns;
+ char *source;
};
struct _sdlBinding {
char *name;
char *location;
- int bindingType;
+ int bindingType;
void *bindingAttributes; /* sdlSoapBindingPtr */
};
/* Soap Binding Specfic stuff */
struct _sdlSoapBinding {
char *transport;
- int style;
+ int style;
};
struct _sdlSoapBindingFunctionBody {
char *ns;
- int use;
+ int use;
char *parts; /* not implemented yet */
char *encodingStyle; /* not implemented yet */
};
struct _sdlSoapBindingFunction {
char *soapAction;
- int style;
+ int style;
sdlSoapBindingFunctionBody input;
sdlSoapBindingFunctionBody output;
};
struct _sdlRestrictionInt {
- int value;
- char fixed;
- char *id;
+ int value;
+ char fixed;
};
struct _sdlRestrictionChar {
char *value;
- char fixed;
- char *id;
+ char fixed;
};
struct _sdlRestrictions {
} sdlTypeKind;
struct _sdlType {
- sdlTypeKind kind;
- char *name;
- char *namens;
- int nillable;
- HashTable *elements; /* array of sdlTypePtr */
- HashTable *attributes; /* array of sdlAttributePtr */
- sdlRestrictionsPtr restrictions;
- encodePtr encode;
- char *ref;
- sdlContentModelPtr model;
+ sdlTypeKind kind;
+ char *name;
+ char *namens;
+ int nillable;
+ HashTable *elements; /* array of sdlTypePtr */
+ HashTable *attributes; /* array of sdlAttributePtr */
+ sdlRestrictionsPtr restrictions;
+ encodePtr encode;
+ sdlContentModelPtr model;
+ char *def;
+ char *fixed;
+ char *ref;
};
struct _sdlParam {
- int order;
- encodePtr encode;
- char *paramName;
+ int order;
+ encodePtr encode;
+ char *paramName;
};
struct _sdlFunction {
- char *functionName;
- char *requestName;
- char *responseName;
- HashTable *requestParameters; /* array of sdlParamPtr */
- HashTable *responseParameters; /* array of sdlParamPtr (this should only be one) */
- struct _sdlBinding* binding;
- void* bindingAttributes; /* sdlSoapBindingFunctionPtr */
+ char *functionName;
+ char *requestName;
+ char *responseName;
+ HashTable *requestParameters; /* array of sdlParamPtr */
+ HashTable *responseParameters; /* array of sdlParamPtr (this should only be one) */
+ struct _sdlBinding *binding;
+ void *bindingAttributes; /* sdlSoapBindingFunctionPtr */
};
+typedef enum _sdlUse {
+ XSD_USE_DEFAULT,
+ XSD_USE_OPTIONAL,
+ XSD_USE_PROHIBITED,
+ XSD_USE_REQUIRED
+} sdlUse;
+
+typedef enum _sdlForm {
+ XSD_FORM_DEFAULT,
+ XSD_FORM_QUALIFIED,
+ XSD_FORM_UNQUALIFIED
+} sdlForm;
+
+
struct _sdlAttribute {
- char *def;
- char *fixed;
- char *form;
- char *id;
- char *name;
- char *ref;
- char *use;
+ char *name;
+ char *ref;
+ char *def;
+ char *fixed;
+ sdlForm form;
+ sdlUse use;
HashTable *extraAttributes; /* array of xmlNodePtr */
- encodePtr encode;
+ encodePtr encode;
};
sdlPtr get_sdl(char *uri);
encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const char *type);
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat);
-encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type);
-encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type);
sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type);
sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
-xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style);
-zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data);
-
void delete_sdl(void *handle);
-void delete_type(void *type);
-void delete_attribute(void *attribute);
-void delete_mapping(void *data);
-void delete_restriction_var_int(void *rvi);
-void delete_schema_restriction_var_char(void *srvc);
#endif
HashTable *defEnc;
HashTable *defEncIndex;
HashTable *sdls;
- HashTable *services;
HashTable *overrides;
- int cur_uniq_ns;
- int soap_version;
- sdlPtr sdl;
- zend_bool use_soap_error_handler;
+ int cur_uniq_ns;
+ int soap_version;
+ sdlPtr sdl;
+ zend_bool use_soap_error_handler;
ZEND_END_MODULE_GLOBALS(soap)
#ifdef PHP_WIN32
soap_globals->sdls = malloc(sizeof(HashTable));
zend_hash_init(soap_globals->sdls, 0, NULL, delete_sdl, 1);
- soap_globals->services = malloc(sizeof(HashTable));
- zend_hash_init(soap_globals->services, 0, NULL, delete_service, 1);
-
soap_globals->defEnc = malloc(sizeof(HashTable));
zend_hash_init(soap_globals->defEnc, 0, NULL, NULL, 1);
/* hash by namespace */
zend_hash_add(soap_globals->defEncNs, XSD_1999_NAMESPACE, sizeof(XSD_1999_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
zend_hash_add(soap_globals->defEncNs, XSD_NAMESPACE, sizeof(XSD_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
- zend_hash_add(soap_globals->defEncNs, APACHE_NAMESPACE, sizeof(APACHE_NAMESPACE), APACHE_NS_PREFIX, sizeof(APACHE_NS_PREFIX), NULL);
zend_hash_add(soap_globals->defEncNs, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE), SOAP_1_1_ENC_NS_PREFIX, sizeof(SOAP_1_1_ENC_NS_PREFIX), NULL);
zend_hash_add(soap_globals->defEncNs, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE), SOAP_1_2_ENC_NS_PREFIX, sizeof(SOAP_1_2_ENC_NS_PREFIX), NULL);
/* and by prefix */
zend_hash_add(soap_globals->defEncPrefix, XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), XSD_NAMESPACE, sizeof(XSD_NAMESPACE), NULL);
- zend_hash_add(soap_globals->defEncPrefix, APACHE_NS_PREFIX, sizeof(APACHE_NS_PREFIX), APACHE_NAMESPACE, sizeof(APACHE_NAMESPACE), NULL);
zend_hash_add(soap_globals->defEncPrefix, SOAP_1_1_ENC_NS_PREFIX, sizeof(SOAP_1_1_ENC_NS_PREFIX), SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE), NULL);
zend_hash_add(soap_globals->defEncPrefix, SOAP_1_2_ENC_NS_PREFIX, sizeof(SOAP_1_2_ENC_NS_PREFIX), SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE), NULL);
{
zend_error_cb = old_error_handler;
zend_hash_destroy(SOAP_GLOBAL(sdls));
- zend_hash_destroy(SOAP_GLOBAL(services));
zend_hash_destroy(SOAP_GLOBAL(defEnc));
zend_hash_destroy(SOAP_GLOBAL(defEncIndex));
zend_hash_destroy(SOAP_GLOBAL(defEncNs));
}
node = (xmlNodePtr)Z_LVAL_PP(addr);
- ret = master_to_zval(get_conversion(UNKNOWN_TYPE), node);
+ ret = master_to_zval(NULL, node);
*return_value = *ret;
}
#endif
php_error(E_ERROR, "Error cannot find parameter");
}
if (param == NULL) {
- enc = get_conversion(UNKNOWN_TYPE);
+ enc = NULL;
} else {
enc = (*param)->encode;
}
if (use == SOAP_ENCODED) {
xmlSetProp(envelope, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
xmlSetProp(envelope, "xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
- xmlSetProp(envelope, "xmlns:" APACHE_NS_PREFIX , APACHE_NAMESPACE);
if (version == SOAP_1_1) {
xmlSetProp(envelope, "xmlns:"SOAP_1_1_ENC_NS_PREFIX, SOAP_1_1_ENC_NAMESPACE);
xmlSetProp(envelope, SOAP_1_1_ENV_NS_PREFIX":encodingStyle", SOAP_1_1_ENC_NAMESPACE);
if (use == SOAP_ENCODED) {
xmlSetProp(envelope, "xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
xmlSetProp(envelope, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
- xmlSetProp(envelope, "xmlns:" APACHE_NS_PREFIX , APACHE_NAMESPACE);
if (version == SOAP_1_1) {
xmlSetProp(envelope, "xmlns:"SOAP_1_1_ENC_NS_PREFIX, SOAP_1_1_ENC_NAMESPACE);
xmlSetProp(envelope, SOAP_1_1_ENV_NS_PREFIX":encodingStyle", SOAP_1_1_ENC_NAMESPACE);