cvs: php-src /ext/soap php_encoding.c php_schema.c php_sdl.c php_sdl.h /ext/soap/tests/interop/Round3/GroupD round3_groupD_doclitparams.wsdl
round3_groupD_rpcenc.wsdl /ext/soap/tests/interop/Round4/GroupH round4_groupH_complex_doclit.wsdl round4_groupH_complex_rpcenc.wsdl
round4_groupH_simple_doclit.wsdl round4_groupH_simple_rpcenc.wsdl /ext/soap/tests/schema schema075.phpt schema076.phpt schema077.phpt schema078.phpt
schema079.phpt schema080.phpt
| From: | Dmitry Stogov | Date: | Wed, 20 Apr 2005 08:30:44 +0000 |
| Subject: | cvs: php-src /ext/soap php_encoding.c php_schema.c php_sdl.c php_sdl.h /ext/soap/tests/interop/Round3/GroupD round3_groupD_doclitparams.wsdl round3_groupD_rpcenc.wsdl /ext/soap/tests/interop/Round4/GroupH round4_groupH_complex_doclit.wsdl round4_groupH_complex_rpcenc.wsdl round4_groupH_simple_doclit.wsdl round4_groupH_simple_rpcenc.wsdl /ext/soap/tests/schema schema075.phpt schema076.phpt schema077.phpt schema078.phpt schema079.phpt schema080.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-31499@lists.php.net to get a copy of this message | ||
dmitry Wed Apr 20 04:30:44 2005 EDT
Added files:
/php-src/ext/soap/tests/schema schema075.phpt schema076.phpt
schema077.phpt schema078.phpt
schema079.phpt schema080.phpt
Modified files:
/php-src/ext/soap php_encoding.c php_schema.c php_sdl.c php_sdl.h
/php-src/ext/soap/tests/interop/Round3/GroupD
round3_groupD_doclitparams.wsdl
round3_groupD_rpcenc.wsdl
/php-src/ext/soap/tests/interop/Round4/GroupH
round4_groupH_complex_doclit.wsdl
round4_groupH_complex_rpcenc.wsdl
round4_groupH_simple_doclit.wsdl
round4_groupH_simple_rpcenc.wsdl
Log:
Support for element's form and schema's elementFormDefault attributes
(qualified/unqualified)
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.93&r2=1.94&ty=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.93 php-src/ext/soap/php_encoding.c:1.94 --- php-src/ext/soap/php_encoding.c:1.93 Tue Apr 12 12:41:41 2005 +++ php-src/ext/soap/php_encoding.c Wed Apr 20 04:30:39 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_encoding.c,v 1.93 2005/04/12 16:41:41 iliaa Exp $ */ +/* $Id: php_encoding.c,v 1.94 2005/04/20 08:30:39 dmitry Exp $ */ #include <time.h> @@ -1234,7 +1234,9 @@ } } xmlNodeSetName(property, model->u.element->name); - if (style == SOAP_LITERAL && model->u.element->namens) { + if (style == SOAP_LITERAL && + model->u.element->namens && + model->u.element->form == XSD_FORM_QUALIFIED) { xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens); xmlSetNs(property, nsp); } @@ -1482,8 +1484,9 @@ /* we need to handle xml: namespace specially, since it is an implicit schema. Otherwise, use form. */ - if ((!strncmp((*attr)->namens, XML_NAMESPACE, sizeof(XML_NAMESPACE)) || - ((*attr)->form == XSD_FORM_QUALIFIED)) && (*attr)->namens) { + if ((*attr)->namens && + (!strncmp((*attr)->namens, XML_NAMESPACE, sizeof(XML_NAMESPACE)) || + (*attr)->form == XSD_FORM_QUALIFIED)) { xmlNsPtr nsp = encode_add_ns(xmlParam, (*attr)->namens); xmlSetNsProp(xmlParam, nsp, (*attr)->name, dummy->children->content); http://cvs.php.net/diff.php/php-src/ext/soap/php_schema.c?r1=1.54&r2=1.55&ty=u Index: php-src/ext/soap/php_schema.c diff -u php-src/ext/soap/php_schema.c:1.54 php-src/ext/soap/php_schema.c:1.55 --- php-src/ext/soap/php_schema.c:1.54 Sun Apr 3 11:39:55 2005 +++ php-src/ext/soap/php_schema.c Wed Apr 20 04:30:40 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_schema.c,v 1.54 2005/04/03 15:39:55 gschlossnagle Exp $ */ +/* $Id: php_schema.c,v 1.55 2005/04/20 08:30:40 dmitry Exp $ */ #include "php_soap.h" #include "libxml/uri.h" @@ -1664,6 +1664,39 @@ cur_type->def = estrdup(attr->children->content); } + /* form */ + attr = get_attribute(attrs, "form"); + if (attr) { + if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) { + cur_type->form = XSD_FORM_QUALIFIED; + } else if (strncmp(attr->children->content,"unqualified",sizeof("unqualified")) == 0) { + cur_type->form = XSD_FORM_UNQUALIFIED; + } else { + cur_type->form = XSD_FORM_DEFAULT; + } + } else { + cur_type->form = XSD_FORM_DEFAULT; + } + if (cur_type->form == XSD_FORM_DEFAULT) { + xmlNodePtr parent = element->parent; + while (parent) { + if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) { + xmlAttrPtr def; + def = get_attribute(parent->properties, "elementFormDefault"); + if(def == NULL || strncmp(def->children->content, "qualified", sizeof("qualified"))) { + cur_type->form = XSD_FORM_UNQUALIFIED; + } else { + cur_type->form = XSD_FORM_QUALIFIED; + } + break; + } + parent = parent->parent; + } + if (parent == NULL) { + cur_type->form = XSD_FORM_UNQUALIFIED; + } + } + /* type = QName */ type = get_attribute(attrs, "type"); if (type) { @@ -1890,10 +1923,10 @@ } attr = attr->next; } - if(newAttr->form == XSD_FORM_DEFAULT) { - xmlNodePtr parent = attrType->parent; - while(parent) { - if(node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) { + if (newAttr->form == XSD_FORM_DEFAULT) { + xmlNodePtr parent = attrType->parent; + while (parent) { + if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) { xmlAttrPtr def; def = get_attribute(parent->properties, "attributeFormDefault"); if(def == NULL || strncmp(def->children->content, "qualified", sizeof("qualified"))) { @@ -1904,8 +1937,8 @@ break; } parent = parent->parent; - } - if(parent == NULL) { + } + if (parent == NULL) { newAttr->form = XSD_FORM_UNQUALIFIED; } } @@ -2209,6 +2242,7 @@ if ((*tmp)->def) { type->def = estrdup((*tmp)->def); } + type->form = (*tmp)->form; } else if (strcmp(type->ref, SCHEMA_NAMESPACE ":schema") == 0) { type->encode = get_conversion(XSD_ANYXML); } else { http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.81&r2=1.82&ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.81 php-src/ext/soap/php_sdl.c:1.82 --- php-src/ext/soap/php_sdl.c:1.81 Mon Mar 28 10:21:50 2005 +++ php-src/ext/soap/php_sdl.c Wed Apr 20 04:30:41 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_sdl.c,v 1.81 2005/03/28 15:21:50 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.82 2005/04/20 08:30:41 dmitry Exp $ */ #include "php_soap.h" #include "ext/libxml/php_libxml.h" @@ -1065,7 +1065,7 @@ return ctx.sdl; } -#define WSDL_CACHE_VERSION 0x0c +#define WSDL_CACHE_VERSION 0x0d #define WSDL_CACHE_GET(ret,type,buf) memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type); #define WSDL_CACHE_GET_INT(ret,buf) ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]<<8)|((unsigned char)(*buf)[2]<<16)|((int)(*buf)[3]<<24); *buf += 4; @@ -1214,6 +1214,7 @@ type->fixed = sdl_deserialize_string(in); type->ref = sdl_deserialize_string(in); WSDL_CACHE_GET_1(type->nillable, char, in); + WSDL_CACHE_GET_1(type->form, sdlForm, in); WSDL_CACHE_GET_INT(i, in); type->encode = encoders[i]; @@ -1788,6 +1789,7 @@ sdl_serialize_string(type->fixed, out); sdl_serialize_string(type->ref, out); WSDL_CACHE_PUT_1(type->nillable, out); + WSDL_CACHE_PUT_1(type->form, out); sdl_serialize_encoder_ref(type->encode, tmp_encoders, out); if (type->restrictions) { http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.h?r1=1.35&r2=1.36&ty=u Index: php-src/ext/soap/php_sdl.h diff -u php-src/ext/soap/php_sdl.h:1.35 php-src/ext/soap/php_sdl.h:1.36 --- php-src/ext/soap/php_sdl.h:1.35 Tue Mar 22 05:19:08 2005 +++ php-src/ext/soap/php_sdl.h Wed Apr 20 04:30:41 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_sdl.h,v 1.35 2005/03/22 10:19:08 dmitry Exp $ */ +/* $Id: php_sdl.h,v 1.36 2005/04/20 08:30:41 dmitry Exp $ */ #ifndef PHP_SDL_H #define PHP_SDL_H @@ -180,6 +180,19 @@ XSD_TYPEKIND_EXTENSION } sdlTypeKind; +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 _sdlType { sdlTypeKind kind; char *name; @@ -193,6 +206,7 @@ char *def; char *fixed; char *ref; + sdlForm form; }; struct _sdlParam { @@ -219,19 +233,6 @@ HashTable *faults; /* array of sdlFaultPtr */ }; -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; - typedef struct _sdlExtraAttribute { char *ns; char *val; http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl diff -u php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl:1.1 php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl:1.1 Sun Apr 3 11:51:20 2005 +++ php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl Wed Apr 20 04:30:43 2005 @@ -11,7 +11,7 @@ <types> <schema targetNamespace="http://soapinterop.org/xsd" xmlns="http://www.w3.org/2001/XMLSchema" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified"> <complexType name="ArrayOfstring_literal"> <sequence> <element maxOccurs="unbounded" minOccurs="1" name="string" type="xsd:string"/> http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl diff -u php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl:1.1 php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl:1.1 Sun Apr 3 11:51:20 2005 +++ php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl Wed Apr 20 04:30:43 2005 @@ -11,7 +11,7 @@ <types> <schema targetNamespace="http://soapinterop.org/xsd" xmlns="http://www.w3.org/2001/XMLSchema" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified"> <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="ArrayOfstring"> <complexContent> http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl diff -u php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl:1.1 php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl:1.1 Sun Apr 3 11:51:21 2005 +++ php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl Wed Apr 20 04:30:43 2005 @@ -10,7 +10,7 @@ targetNamespace="http://soapinterop.org/wsdl"> <types> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/types"> @@ -62,7 +62,7 @@ </schema> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types/part" targetNamespace="http://soapinterop.org/types/part"> @@ -74,7 +74,7 @@ </schema> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types/requestresponse" targetNamespace="http://soapinterop.org/types/requestresponse"> http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl diff -u php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl:1.1 php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl:1.1 Sun Apr 3 11:51:21 2005 +++ php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl Wed Apr 20 04:30:43 2005 @@ -8,7 +8,7 @@ targetNamespace="http://soapinterop.org/wsdl"> <types> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl diff -u php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl:1.1 php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl:1.1 Sun Apr 3 11:51:21 2005 +++ php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl Wed Apr 20 04:30:43 2005 @@ -9,7 +9,7 @@ xmlns:ns4="http://soapinterop.org/types/requestresponse" targetNamespace="http://soapinterop.org/wsdl"> <types> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/types"> @@ -41,7 +41,7 @@ </schema> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types/part" targetNamespace="http://soapinterop.org/types/part"> @@ -61,7 +61,7 @@ </schema> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types/requestresponse" targetNamespace="http://soapinterop.org/types/requestresponse"> http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl diff -u php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl:1.1 php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl:1.1 Sun Apr 3 11:51:21 2005 +++ php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl Wed Apr 20 04:30:43 2005 @@ -7,7 +7,7 @@ xmlns:ns2="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/wsdl"> <types> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema075.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema075.phpt +++ php-src/ext/soap/tests/schema/schema075.phpt --TEST-- SOAP XML Schema 75: Attributes form qualified/unqualified (attributeFormDefault="qualified") --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <attribute name="int1" type="int"/> <attribute name="int2" type="int" form="qualified"/> <attribute name="int3" type="int" form="unqualified"/> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded", 'attributeFormDefault="qualified"'); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" 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:test><testParam ns1:int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema076.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema076.phpt +++ php-src/ext/soap/tests/schema/schema076.phpt --TEST-- SOAP XML Schema 76: Attributes form qualified/unqualified (attributeFormDefault="unqualified") --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <attribute name="int1" type="int"/> <attribute name="int2" type="int" form="qualified"/> <attribute name="int3" type="int" form="unqualified"/> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded", 'attributeFormDefault="unqualified"'); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" 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:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema077.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema077.phpt +++ php-src/ext/soap/tests/schema/schema077.phpt --TEST-- SOAP XML Schema 77: Attributes form qualified/unqualified (attributeFormDefault - default) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <attribute name="int1" type="int"/> <attribute name="int2" type="int" form="qualified"/> <attribute name="int3" type="int" form="unqualified"/> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded"); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" 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:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema078.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema078.phpt +++ php-src/ext/soap/tests/schema/schema078.phpt --TEST-- SOAP XML Schema 78: Element form qualified/unqualified (elementFormDefault="qualified") --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <sequence> <element name="int1" type="int"/> <element name="int2" type="int" form="qualified"/> <element name="int3" type="int" form="unqualified"/> </sequence> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal", 'elementFormDefault="qualified"'); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:test><testParam><ns1:int1>1</ns1:int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema079.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema079.phpt +++ php-src/ext/soap/tests/schema/schema079.phpt --TEST-- SOAP XML Schema 79: Element form qualified/unqualified (elementFormDefault="unqualified") --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <sequence> <element name="int1" type="int"/> <element name="int2" type="int" form="qualified"/> <element name="int3" type="int" form="unqualified"/> </sequence> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal", 'elementFormDefault="unqualified"'); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:test><testParam><int1>1</int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema080.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema080.phpt +++ php-src/ext/soap/tests/schema/schema080.phpt --TEST-- SOAP XML Schema 80: Element form qualified/unqualified (elementFormDefault - default) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <sequence> <element name="int1" type="int"/> <element name="int2" type="int" form="qualified"/> <element name="int3" type="int" form="unqualified"/> </sequence> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal"); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:test><testParam><int1>1</int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.93&r2=1.94&ty=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.93 php-src/ext/soap/php_encoding.c:1.94 --- php-src/ext/soap/php_encoding.c:1.93 Tue Apr 12 12:41:41 2005 +++ php-src/ext/soap/php_encoding.c Wed Apr 20 04:30:39 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_encoding.c,v 1.93 2005/04/12 16:41:41 iliaa Exp $ */ +/* $Id: php_encoding.c,v 1.94 2005/04/20 08:30:39 dmitry Exp $ */ #include <time.h> @@ -1234,7 +1234,9 @@ } } xmlNodeSetName(property, model->u.element->name); - if (style == SOAP_LITERAL && model->u.element->namens) { + if (style == SOAP_LITERAL && + model->u.element->namens && + model->u.element->form == XSD_FORM_QUALIFIED) { xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens); xmlSetNs(property, nsp); } @@ -1482,8 +1484,9 @@ /* we need to handle xml: namespace specially, since it is an implicit schema. Otherwise, use form. */ - if ((!strncmp((*attr)->namens, XML_NAMESPACE, sizeof(XML_NAMESPACE)) || - ((*attr)->form == XSD_FORM_QUALIFIED)) && (*attr)->namens) { + if ((*attr)->namens && + (!strncmp((*attr)->namens, XML_NAMESPACE, sizeof(XML_NAMESPACE)) || + (*attr)->form == XSD_FORM_QUALIFIED)) { xmlNsPtr nsp = encode_add_ns(xmlParam, (*attr)->namens); xmlSetNsProp(xmlParam, nsp, (*attr)->name, dummy->children->content); http://cvs.php.net/diff.php/php-src/ext/soap/php_schema.c?r1=1.54&r2=1.55&ty=u Index: php-src/ext/soap/php_schema.c diff -u php-src/ext/soap/php_schema.c:1.54 php-src/ext/soap/php_schema.c:1.55 --- php-src/ext/soap/php_schema.c:1.54 Sun Apr 3 11:39:55 2005 +++ php-src/ext/soap/php_schema.c Wed Apr 20 04:30:40 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_schema.c,v 1.54 2005/04/03 15:39:55 gschlossnagle Exp $ */ +/* $Id: php_schema.c,v 1.55 2005/04/20 08:30:40 dmitry Exp $ */ #include "php_soap.h" #include "libxml/uri.h" @@ -1664,6 +1664,39 @@ cur_type->def = estrdup(attr->children->content); } + /* form */ + attr = get_attribute(attrs, "form"); + if (attr) { + if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) { + cur_type->form = XSD_FORM_QUALIFIED; + } else if (strncmp(attr->children->content,"unqualified",sizeof("unqualified")) == 0) { + cur_type->form = XSD_FORM_UNQUALIFIED; + } else { + cur_type->form = XSD_FORM_DEFAULT; + } + } else { + cur_type->form = XSD_FORM_DEFAULT; + } + if (cur_type->form == XSD_FORM_DEFAULT) { + xmlNodePtr parent = element->parent; + while (parent) { + if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) { + xmlAttrPtr def; + def = get_attribute(parent->properties, "elementFormDefault"); + if(def == NULL || strncmp(def->children->content, "qualified", sizeof("qualified"))) { + cur_type->form = XSD_FORM_UNQUALIFIED; + } else { + cur_type->form = XSD_FORM_QUALIFIED; + } + break; + } + parent = parent->parent; + } + if (parent == NULL) { + cur_type->form = XSD_FORM_UNQUALIFIED; + } + } + /* type = QName */ type = get_attribute(attrs, "type"); if (type) { @@ -1890,10 +1923,10 @@ } attr = attr->next; } - if(newAttr->form == XSD_FORM_DEFAULT) { - xmlNodePtr parent = attrType->parent; - while(parent) { - if(node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) { + if (newAttr->form == XSD_FORM_DEFAULT) { + xmlNodePtr parent = attrType->parent; + while (parent) { + if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) { xmlAttrPtr def; def = get_attribute(parent->properties, "attributeFormDefault"); if(def == NULL || strncmp(def->children->content, "qualified", sizeof("qualified"))) { @@ -1904,8 +1937,8 @@ break; } parent = parent->parent; - } - if(parent == NULL) { + } + if (parent == NULL) { newAttr->form = XSD_FORM_UNQUALIFIED; } } @@ -2209,6 +2242,7 @@ if ((*tmp)->def) { type->def = estrdup((*tmp)->def); } + type->form = (*tmp)->form; } else if (strcmp(type->ref, SCHEMA_NAMESPACE ":schema") == 0) { type->encode = get_conversion(XSD_ANYXML); } else { http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.81&r2=1.82&ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.81 php-src/ext/soap/php_sdl.c:1.82 --- php-src/ext/soap/php_sdl.c:1.81 Mon Mar 28 10:21:50 2005 +++ php-src/ext/soap/php_sdl.c Wed Apr 20 04:30:41 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_sdl.c,v 1.81 2005/03/28 15:21:50 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.82 2005/04/20 08:30:41 dmitry Exp $ */ #include "php_soap.h" #include "ext/libxml/php_libxml.h" @@ -1065,7 +1065,7 @@ return ctx.sdl; } -#define WSDL_CACHE_VERSION 0x0c +#define WSDL_CACHE_VERSION 0x0d #define WSDL_CACHE_GET(ret,type,buf) memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type); #define WSDL_CACHE_GET_INT(ret,buf) ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]<<8)|((unsigned char)(*buf)[2]<<16)|((int)(*buf)[3]<<24); *buf += 4; @@ -1214,6 +1214,7 @@ type->fixed = sdl_deserialize_string(in); type->ref = sdl_deserialize_string(in); WSDL_CACHE_GET_1(type->nillable, char, in); + WSDL_CACHE_GET_1(type->form, sdlForm, in); WSDL_CACHE_GET_INT(i, in); type->encode = encoders[i]; @@ -1788,6 +1789,7 @@ sdl_serialize_string(type->fixed, out); sdl_serialize_string(type->ref, out); WSDL_CACHE_PUT_1(type->nillable, out); + WSDL_CACHE_PUT_1(type->form, out); sdl_serialize_encoder_ref(type->encode, tmp_encoders, out); if (type->restrictions) { http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.h?r1=1.35&r2=1.36&ty=u Index: php-src/ext/soap/php_sdl.h diff -u php-src/ext/soap/php_sdl.h:1.35 php-src/ext/soap/php_sdl.h:1.36 --- php-src/ext/soap/php_sdl.h:1.35 Tue Mar 22 05:19:08 2005 +++ php-src/ext/soap/php_sdl.h Wed Apr 20 04:30:41 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_sdl.h,v 1.35 2005/03/22 10:19:08 dmitry Exp $ */ +/* $Id: php_sdl.h,v 1.36 2005/04/20 08:30:41 dmitry Exp $ */ #ifndef PHP_SDL_H #define PHP_SDL_H @@ -180,6 +180,19 @@ XSD_TYPEKIND_EXTENSION } sdlTypeKind; +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 _sdlType { sdlTypeKind kind; char *name; @@ -193,6 +206,7 @@ char *def; char *fixed; char *ref; + sdlForm form; }; struct _sdlParam { @@ -219,19 +233,6 @@ HashTable *faults; /* array of sdlFaultPtr */ }; -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; - typedef struct _sdlExtraAttribute { char *ns; char *val; http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl diff -u php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl:1.1 php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl:1.1 Sun Apr 3 11:51:20 2005 +++ php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl Wed Apr 20 04:30:43 2005 @@ -11,7 +11,7 @@ <types> <schema targetNamespace="http://soapinterop.org/xsd" xmlns="http://www.w3.org/2001/XMLSchema" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified"> <complexType name="ArrayOfstring_literal"> <sequence> <element maxOccurs="unbounded" minOccurs="1" name="string" type="xsd:string"/> http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl diff -u php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl:1.1 php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl:1.1 Sun Apr 3 11:51:20 2005 +++ php-src/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl Wed Apr 20 04:30:43 2005 @@ -11,7 +11,7 @@ <types> <schema targetNamespace="http://soapinterop.org/xsd" xmlns="http://www.w3.org/2001/XMLSchema" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified"> <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="ArrayOfstring"> <complexContent> http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl diff -u php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl:1.1 php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl:1.1 Sun Apr 3 11:51:21 2005 +++ php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl Wed Apr 20 04:30:43 2005 @@ -10,7 +10,7 @@ targetNamespace="http://soapinterop.org/wsdl"> <types> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/types"> @@ -62,7 +62,7 @@ </schema> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types/part" targetNamespace="http://soapinterop.org/types/part"> @@ -74,7 +74,7 @@ </schema> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types/requestresponse" targetNamespace="http://soapinterop.org/types/requestresponse"> http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl diff -u php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl:1.1 php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl:1.1 Sun Apr 3 11:51:21 2005 +++ php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl Wed Apr 20 04:30:43 2005 @@ -8,7 +8,7 @@ targetNamespace="http://soapinterop.org/wsdl"> <types> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl diff -u php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl:1.1 php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl:1.1 Sun Apr 3 11:51:21 2005 +++ php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl Wed Apr 20 04:30:43 2005 @@ -9,7 +9,7 @@ xmlns:ns4="http://soapinterop.org/types/requestresponse" targetNamespace="http://soapinterop.org/wsdl"> <types> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/types"> @@ -41,7 +41,7 @@ </schema> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types/part" targetNamespace="http://soapinterop.org/types/part"> @@ -61,7 +61,7 @@ </schema> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types/requestresponse" targetNamespace="http://soapinterop.org/types/requestresponse"> http://cvs.php.net/diff.php/php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl?r1=1.1&r2=1.2&ty=u Index: php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl diff -u php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl:1.1 php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl:1.2 --- php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl:1.1 Sun Apr 3 11:51:21 2005 +++ php-src/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl Wed Apr 20 04:30:43 2005 @@ -7,7 +7,7 @@ xmlns:ns2="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/wsdl"> <types> - <schema + <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema075.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema075.phpt +++ php-src/ext/soap/tests/schema/schema075.phpt --TEST-- SOAP XML Schema 75: Attributes form qualified/unqualified (attributeFormDefault="qualified") --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <attribute name="int1" type="int"/> <attribute name="int2" type="int" form="qualified"/> <attribute name="int3" type="int" form="unqualified"/> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded", 'attributeFormDefault="qualified"'); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" 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:test><testParam ns1:int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema076.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema076.phpt +++ php-src/ext/soap/tests/schema/schema076.phpt --TEST-- SOAP XML Schema 76: Attributes form qualified/unqualified (attributeFormDefault="unqualified") --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <attribute name="int1" type="int"/> <attribute name="int2" type="int" form="qualified"/> <attribute name="int3" type="int" form="unqualified"/> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded", 'attributeFormDefault="unqualified"'); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" 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:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema077.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema077.phpt +++ php-src/ext/soap/tests/schema/schema077.phpt --TEST-- SOAP XML Schema 77: Attributes form qualified/unqualified (attributeFormDefault - default) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <attribute name="int1" type="int"/> <attribute name="int2" type="int" form="qualified"/> <attribute name="int3" type="int" form="unqualified"/> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded"); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" 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:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema078.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema078.phpt +++ php-src/ext/soap/tests/schema/schema078.phpt --TEST-- SOAP XML Schema 78: Element form qualified/unqualified (elementFormDefault="qualified") --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <sequence> <element name="int1" type="int"/> <element name="int2" type="int" form="qualified"/> <element name="int3" type="int" form="unqualified"/> </sequence> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal", 'elementFormDefault="qualified"'); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:test><testParam><ns1:int1>1</ns1:int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema079.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema079.phpt +++ php-src/ext/soap/tests/schema/schema079.phpt --TEST-- SOAP XML Schema 79: Element form qualified/unqualified (elementFormDefault="unqualified") --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <sequence> <element name="int1" type="int"/> <element name="int2" type="int" form="qualified"/> <element name="int3" type="int" form="unqualified"/> </sequence> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal", 'elementFormDefault="unqualified"'); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:test><testParam><int1>1</int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok http://cvs.php.net/co.php/php-src/ext/soap/tests/schema/schema080.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/schema/schema080.phpt +++ php-src/ext/soap/tests/schema/schema080.phpt --TEST-- SOAP XML Schema 80: Element form qualified/unqualified (elementFormDefault - default) --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "test_schema.inc"; $schema = <<<EOF <complexType name="testType"> <sequence> <element name="int1" type="int"/> <element name="int2" type="int" form="qualified"/> <element name="int3" type="int" form="unqualified"/> </sequence> </complexType> EOF; test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "literal"); echo "ok"; ?> --EXPECTF-- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/"><SOAP-ENV:Body><ns1:test><testParam><int1>1</int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope> object(stdClass)#5 (3) { ["int1"]=> int(1) ["int2"]=> int(2) ["int3"]=> int(3) } ok