]> granicus.if.org Git - php/commitdiff
Fix qualified names for attributes according to attributeFormDefault.
authorGeorge Schlossnagle <gschlossnagle@php.net>
Sun, 3 Apr 2005 15:39:56 +0000 (15:39 +0000)
committerGeorge Schlossnagle <gschlossnagle@php.net>
Sun, 3 Apr 2005 15:39:56 +0000 (15:39 +0000)
Add SOAP Interop tests from Dmitry.

22 files changed:
ext/soap/php_encoding.c
ext/soap/php_schema.c
ext/soap/tests/bugs/bug29236.phpt
ext/soap/tests/schema/schema037.phpt
ext/soap/tests/schema/schema038.phpt
ext/soap/tests/schema/schema039.phpt
ext/soap/tests/schema/schema040.phpt
ext/soap/tests/schema/schema042.phpt
ext/soap/tests/schema/schema043.phpt
ext/soap/tests/schema/schema044.phpt
ext/soap/tests/schema/schema045.phpt
ext/soap/tests/schema/schema046.phpt
ext/soap/tests/schema/schema047.phpt
ext/soap/tests/schema/schema048.phpt
ext/soap/tests/schema/schema062.phpt
ext/soap/tests/schema/schema065.phpt
ext/soap/tests/schema/schema066.phpt
ext/soap/tests/schema/schema067.phpt
ext/soap/tests/schema/schema069.phpt
ext/soap/tests/schema/schema070.phpt
ext/soap/tests/schema/schema074.phpt [new file with mode: 0644]
ext/soap/tests/schema/test_schema.inc

index e9efb553cd0761770095e50081b503acc4f1ee5c..8e731679f4a5698eed3e813ff610a4bb93904f73 100644 (file)
@@ -1479,11 +1479,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
                                                                if ((*attr)->fixed && strcmp((*attr)->fixed,dummy->children->content) != 0) {
                                                                        soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, dummy->children->content);
                                                                }
-                                                               if ((*attr)->namens) {
-/*
-                                                               if ((*attr)->namens &&
-                                                                   (type->ns == NULL || strcmp((*attr)->namens, type->ns))) {
-*/
+                                                               /* 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) {
                                                                        xmlNsPtr nsp = encode_add_ns(xmlParam, (*attr)->namens);
 
                                                                        xmlSetNsProp(xmlParam, nsp, (*attr)->name, dummy->children->content);
index 6aee0926c52331cf690273f83ebe77b49085aa6c..b0e537f34807bc0c082645ea0569dbfd916884f0 100644 (file)
@@ -1890,7 +1890,25 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
                }
                attr = attr->next;
        }
-
+       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"))) {
+                                       newAttr->form = XSD_FORM_UNQUALIFIED;
+                               } else {
+                                       newAttr->form = XSD_FORM_QUALIFIED;
+                               }
+                               break;
+                       }
+                       parent = parent->parent;
+               }
+               if(parent == NULL) {
+                       newAttr->form = XSD_FORM_UNQUALIFIED;
+               }       
+       }
        trav = attrType->children;
        if (trav != NULL && node_is_equal(trav, "annotation")) {
                /* TODO: <annotation> support */
index 372449fbb267bbb90b72aad1af53b82a7d7a4bc6..4dbc302c171cea44c005aa16cbadeb61e27b1ba9 100644 (file)
@@ -3,7 +3,7 @@ Bug #29236 (memory error when wsdl-cache is enabled)
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
 --FILE--
-<?
+<?php
 $client = new SoapClient(dirname(__FILE__)."/bug29236.wsdl");
 var_dump($client->__getFunctions()); 
 ?>
@@ -17,4 +17,4 @@ array(4) {
   string(41) "LogoutResponse Logout(Logout $parameters)"
   [3]=>
   string(62) "GetSystemInfoResponse GetSystemInfo(GetSystemInfo $parameters)"
-}
\ No newline at end of file
+}
index 75e1757554d3775e489e520b035add6f5308f01a..4e59981fc9a50588ddf3e7ebe14efc8b5bb097a3 100644 (file)
@@ -18,7 +18,7 @@ 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:int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["str"]=>
   string(3) "str"
index ed7e3b4fc5150bd5622d15ea0c8489e0c3f81b79..2d37e89e0b536f1a9704ff5519fccc1738d7c154 100644 (file)
@@ -19,7 +19,7 @@ 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:int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["str"]=>
   string(3) "str"
index 67b1c2544aba629d3da0537a2ff4a16a2bf92e14..0b7ef5afc462768dd878c1b514de9c49dc630c3f 100644 (file)
@@ -21,7 +21,7 @@ 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:int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["str"]=>
   string(3) "str"
index 29815fe1f5c9b2dc3234649d7dd45fb662954e6a..f7ddc04546848d5d0c7f4312177061b77073b9d0 100644 (file)
@@ -22,7 +22,7 @@ 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:int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["str"]=>
   string(3) "str"
index 35a9e8ea02d681ab781ab8e12c1137b5b2ad9cee..a8aa8857d9bf227723df5ca4639d5779ccb9695b 100644 (file)
@@ -19,7 +19,7 @@ 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 xsi:type="ns1:testType" ns1:int="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 xsi:type="ns1:testType" int="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["_"]=>
   int(123)
index db48582647a5fb883049ce3d86f3fec5b1557109..08c29963634d13750d95944eda6700ccf62eeaa6 100644 (file)
@@ -26,7 +26,7 @@ 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 xsi:type="ns1:testType" ns1:int="123" ns1:int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 xsi:type="ns1:testType" int="123" int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (3) {
   ["_"]=>
   int(123)
index e2b9fda77aa9a961487a1025441d4e7931502480..8fc070551874229829ff980861148182693ea203 100644 (file)
@@ -19,7 +19,7 @@ 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 xsi:type="ns1:testType" ns1:int="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 xsi:type="ns1:testType" int="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["_"]=>
   int(123)
index 5f7e649f5a458f44c09d45410b6256287178a95c..346a929d85b51ccae93b8e1af3d73c9b5a29a94d 100644 (file)
@@ -26,7 +26,7 @@ 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 xsi:type="ns1:testType" ns1:int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 xsi:type="ns1:testType" int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["_"]=>
   int(123)
index 3452c20b4e3cfb10e999c009e7e4a848f1a0c755..3f9d03afadd74da33c711c1f03e39cd58eb8688f 100644 (file)
@@ -26,7 +26,7 @@ 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 xsi:type="ns1:testType" ns1:int="123" ns1:int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 xsi:type="ns1:testType" int="123" int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (3) {
   ["_"]=>
   int(123)
index f49946ff4a839f23e063a66bbf8974b575a78438..1265cfd3a3817eb87859fe808265ebc1e002d80a 100644 (file)
@@ -24,7 +24,7 @@ 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 xsi:type="ns1:testType" ns1:int2="123"><int xsi:type="xsd:int">123</int></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 xsi:type="ns1:testType" int2="123"><int xsi:type="xsd:int">123</int></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["int"]=>
   int(123)
index 4f0cb7e20fd6b0760243a558665f09788c81cde6..98d4d4be443839ec84eb066904aa1a4f1b6e5ed6 100644 (file)
@@ -26,7 +26,7 @@ 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 xsi:type="ns1:testType" ns1:int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 xsi:type="ns1:testType" int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["_"]=>
   int(123)
index e9e295a6a30cc2561586050bdb5ca37195654611..d4efc9a599f38c36ae8a23318fa4f2f586f61862 100644 (file)
@@ -19,7 +19,7 @@ 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 xsi:nil="1" ns1:int="123" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 xsi:nil="1" int="123" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["_"]=>
   NULL
index abc6cf9268fd54d20546ec6db6b9ca1e649a6ee7..e3f0d646dccd7a906e510cd90a470271501da361 100644 (file)
@@ -16,7 +16,7 @@ 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:str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["str"]=>
   string(3) "str"
index 3991708ee8ba6062a1932bb025a1a19ba837669e..b2812719634b8cce46973f1887dd645532d92dca 100644 (file)
@@ -16,7 +16,7 @@ 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:str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["str"]=>
   string(3) "str"
index 34cb89c332337d4e8df27d9dcca27ded011f9f5e..0e4000957a77c0b26266c29222bb1ede315c0b77 100644 (file)
@@ -16,7 +16,7 @@ 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:str="str" ns1:int="5" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 str="str" int="5" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["str"]=>
   string(3) "str"
index 8f21e8670df9c2824d5344374ed7bf394a1fb227..e4f733a1c07a622b53456761931e386a91423dea 100644 (file)
@@ -17,7 +17,7 @@ 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:str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["str"]=>
   string(3) "str"
index e471ca88fffd70aefef7cc0fdf02a65358d9bf2e..af9abdc10f334703f4196889c4d1cddba21f5a81 100644 (file)
@@ -19,7 +19,7 @@ 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:str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<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 str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
 object(stdClass)#%d (2) {
   ["str"]=>
   string(3) "str"
diff --git a/ext/soap/tests/schema/schema074.phpt b/ext/soap/tests/schema/schema074.phpt
new file mode 100644 (file)
index 0000000..3dbba0c
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+SOAP XML Schema 74: Structure with attributes and qualified elements
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "test_schema.inc";
+$schema = <<<EOF
+       <complexType name="testType">
+               <sequence>
+                       <element name="str" type="string"/>
+               </sequence>
+               <attribute name="int" type="int"/>
+       </complexType>
+EOF;
+
+test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5), "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:int="123" xsi:type="ns1:testType"><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#%d (2) {
+  ["str"]=>
+  string(3) "str"
+  ["int"]=>
+  int(123)
+}
+ok
index e3d83f42d77f595e80eaee1872860a8fdc223c66..e1d4eeb5087abc6b18083ddfdc7d714cfd1c4a0d 100644 (file)
@@ -6,7 +6,7 @@ function test($input) {
        $val = $input;
 }
 
-function test_schema($schema,$type,$param,$style="rpc",$use="encoded") {
+function test_schema($schema,$type,$param,$style="rpc",$use="encoded", $attributeFormDefault='') {
   global $HTTP_RAW_POST_DATA, $val;
 $wsdl  = <<<EOF
 <definitions name="InteropTest"
@@ -16,9 +16,10 @@ $wsdl  = <<<EOF
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
-    targetNamespace="http://test-uri/">
+    targetNamespace="http://test-uri/"
+    >
   <types>
-  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test-uri/">
+  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test-uri/" $attributeFormDefault>
    <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
        $schema
@@ -53,7 +54,7 @@ EOF;
   $f = fopen($fname,"w");
   fwrite($f,$wsdl);
   fclose($f);
-       ini_set("soap.wsdl_cache_enabled",0);
+  ini_set("soap.wsdl_cache_enabled",0);
   $x = new SoapClient($fname, array("trace"=>1,"exceptions"=>0));
   $y = new SoapServer($fname);
        $y->addfunction("test");
@@ -73,4 +74,4 @@ EOF;
     echo $req;
   }
 }
-?>
\ No newline at end of file
+?>