diff options
author | Dmitry Stogov <dmitry@php.net> | 2004-01-08 12:32:28 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2004-01-08 12:32:28 +0000 |
commit | 2cf3cb6407aa108f21149782245c61e7e393ec59 (patch) | |
tree | dbd1327086c0db9ad851a0f41496610e34ebb389 /ext | |
parent | 611c69b8169e425974da2d826a97d514c95a6c0d (diff) | |
download | php-git-2cf3cb6407aa108f21149782245c61e7e393ec59.tar.gz |
Support for "xsd:anyType" was implemented
Diffstat (limited to 'ext')
-rw-r--r-- | ext/soap/php_encoding.c | 6 | ||||
-rw-r--r-- | ext/soap/php_encoding.h | 8 | ||||
-rw-r--r-- | ext/soap/php_sdl.c | 35 |
3 files changed, 33 insertions, 16 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index f3446864c0..cd7cd0e6eb 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -47,6 +47,8 @@ encode defaultEncoding[] = { {{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 @@ void get_array_type(zval *array, smart_str *type TSRMLS_DC) /* 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 @@ void get_array_type(zval *array, smart_str *type TSRMLS_DC) } if(different) - smart_str_appendl(type, "xsd:ur-type", 11); + smart_str_appendl(type, "xsd:anyType", 11); else { encodePtr enc; diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h index b6722a3245..1d7a16b8a6 100644 --- a/ext/soap/php_encoding.h +++ b/ext/soap/php_encoding.h @@ -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" diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 82dd1a75b6..157e781d75 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -298,8 +298,6 @@ xmlNodePtr sdl_to_xml_array(sdlTypePtr type, zval *data, int style) 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 @@ xmlNodePtr sdl_to_xml_array(sdlTypePtr type, zval *data, int style) } 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 @@ xmlNodePtr sdl_to_xml_array(sdlTypePtr type, zval *data, int style) } } - 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 @@ xmlNodePtr sdl_to_xml_array(sdlTypePtr type, zval *data, int style) 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 @@ xmlNodePtr sdl_to_xml_array(sdlTypePtr type, zval *data, int style) 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; } |