cvs: pecl /soap php_encoding.c php_encoding.h php_sdl.c
| From: | Dmitry Stogov | Date: | Thu, 08 Jan 2004 12:32:29 +0000 |
| Subject: | cvs: pecl /soap php_encoding.c php_encoding.h php_sdl.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-681@lists.php.net to get a copy of this message | ||
dmitry Thu Jan 8 07:32:29 2004 EDT
Modified files:
/pecl/soap php_encoding.c php_encoding.h php_sdl.c
Log:
Support for "xsd:anyType" was implemented
Index: pecl/soap/php_encoding.c
diff -u pecl/soap/php_encoding.c:1.12 pecl/soap/php_encoding.c:1.13
--- pecl/soap/php_encoding.c:1.12 Tue Jan 6 12:14:30 2004
+++ pecl/soap/php_encoding.c Thu Jan 8 07:32:28 2004
@@ -47,6 +47,8 @@
{{XSD_UNSIGNEDINT, XSD_UNSIGNEDINT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
{{XSD_UNSIGNEDLONG, XSD_UNSIGNEDLONG_STRING, XSD_NAMESPACE, NULL}, to_zval_ulong, to_xml_ulong},
+ {{XSD_ANYTYPE, XSD_ANYTYPE_STRING, XSD_NAMESPACE, NULL}, guess_zval_convert, guess_xml_convert},
+
{{APACHE_MAP, APACHE_MAP_STRING, APACHE_NAMESPACE, NULL}, to_zval_map, to_xml_map},
{{SOAP_ENC_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_ENC_NAMESPACE, NULL}, to_zval_object,
to_xml_object},
@@ -1281,7 +1283,7 @@
/* TSRMLS_FETCH();*/
if(!array || Z_TYPE_P(array) != IS_ARRAY)
- smart_str_appendl(type, "xsd:ur-type", 11);
+ smart_str_appendl(type, "xsd:anyType", 11);
different = FALSE;
cur_type = prev_type = 0;
@@ -1319,7 +1321,7 @@
}
if(different)
- smart_str_appendl(type, "xsd:ur-type", 11);
+ smart_str_appendl(type, "xsd:anyType", 11);
else
{
encodePtr enc;
Index: pecl/soap/php_encoding.h
diff -u pecl/soap/php_encoding.h:1.9 pecl/soap/php_encoding.h:1.10
--- pecl/soap/php_encoding.h:1.9 Tue Jan 6 12:14:30 2004
+++ pecl/soap/php_encoding.h Thu Jan 8 07:32:28 2004
@@ -5,6 +5,12 @@
#define XSD_1999_TIMEINSTANT 401
#define XSD_1999_TIMEINSTANT_STRING "timeInstant"
+#define SOAP_1_1_ENC "http://schemas.xmlsoap.org/soap/encoding/"
+#define SOAP_1_1_ENV "http://schemas.xmlsoap.org/soap/envelope/"
+
+#define SOAP_1_2_ENC "http://www.w3.org/2003/05/soap-encoding"
+#define SOAP_1_2_ENV "http://www.w3.org/2003/05/soap-envelope"
+
#define SCHEMA_NAMESPACE "http://www.w3.org/2001/XMLSchema"
#define XSD_NAMESPACE "http://www.w3.org/2001/XMLSchema"
#define XSD_NS_PREFIX "xsd"
@@ -97,6 +103,8 @@
#define XSD_UNSIGNEDBYTE_STRING "unsignedByte"
#define XSD_POSITIVEINTEGER 142
#define XSD_POSITIVEINTEGER_STRING "positiveInteger"
+#define XSD_ANYTYPE 143
+#define XSD_ANYTYPE_STRING "anyType"
#define APACHE_NAMESPACE "http://xml.apache.org/xml-soap"
#define APACHE_NS_PREFIX "apache"
Index: pecl/soap/php_sdl.c
diff -u pecl/soap/php_sdl.c:1.9 pecl/soap/php_sdl.c:1.10
--- pecl/soap/php_sdl.c:1.9 Tue Jan 6 12:14:30 2004
+++ pecl/soap/php_sdl.c Thu Jan 8 07:32:28 2004
@@ -298,8 +298,6 @@
zend_hash_find((*arrayType)->extraAttributes, WSDL_NAMESPACE":arrayType",
sizeof(WSDL_NAMESPACE":arrayType"), (void **)&wsdl) == SUCCESS) {
char *ns = NULL, *value, *end;
- smart_str *prefix = encode_new_ns();
- smart_str smart_ns = {0};
xmlNsPtr myNs;
zval** el;
@@ -319,6 +317,25 @@
}
if(myNs != NULL) {
enc = get_encoder(SOAP_GLOBAL(sdl), myNs->href, value);
+
+ if (strcmp(myNs->href,XSD_NAMESPACE) == 0) {
+ smart_str_appendl(&array_type_and_size, XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX) - 1);
+ smart_str_appendc(&array_type_and_size, ':');
+ } else {
+ smart_str *prefix = encode_new_ns();
+ smart_str smart_ns = {0};
+
+ smart_str_appendl(&smart_ns, "xmlns:", sizeof("xmlns:") - 1);
+ smart_str_appendl(&smart_ns, prefix->c, prefix->len);
+ smart_str_0(&smart_ns);
+ xmlSetProp(xmlParam, smart_ns.c, myNs->href);
+ smart_str_free(&smart_ns);
+
+ smart_str_appends(&array_type_and_size, prefix->c);
+ smart_str_appendc(&array_type_and_size, ':');
+ smart_str_free(prefix);
+ efree(prefix);
+ }
}
dims = emalloc(sizeof(int)*dimension);
@@ -335,14 +352,6 @@
}
}
- smart_str_appendl(&smart_ns, "xmlns:", sizeof("xmlns:") - 1);
- smart_str_appendl(&smart_ns, prefix->c, prefix->len);
- smart_str_0(&smart_ns);
- xmlSetProp(xmlParam, smart_ns.c, myNs->href);
- smart_str_free(&smart_ns);
-
- smart_str_appends(&array_type_and_size, prefix->c);
- smart_str_appendc(&array_type_and_size, ':');
smart_str_appends(&array_type_and_size, value);
smart_str_appendc(&array_type_and_size, '[');
smart_str_append_long(&array_type_and_size, dims[0]);
@@ -353,8 +362,6 @@
smart_str_appendc(&array_type_and_size, ']');
smart_str_0(&array_type_and_size);
- smart_str_free(prefix);
- efree(prefix);
efree(value);
if (ns) efree(ns);
} else {
@@ -379,8 +386,8 @@
efree(dims);
}
- if(style == SOAP_ENCODED)
- set_ns_and_type_ex(xmlParam, type->namens, type->name);
+// if(style == SOAP_ENCODED)
+// set_ns_and_type_ex(xmlParam, type->namens, type->name);
return xmlParam;
}