Author: veithen
Date: Tue Jun 24 18:50:39 2014
New Revision: 1605152

URL: http://svn.apache.org/r1605152
Log:
Validate the SOAP test messages against the SOAP 1.1/1.2 schemas.

Added:
    webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.1.xsd
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.2.xsd
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/xml.xsd
    webservices/axiom/trunk/testsuites/soap-testsuite/src/test/
    webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/
    webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/
    webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/axiom/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/axiom/ts/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/axiom/ts/soap/
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/axiom/ts/soap/ValidationTest.java
   (with props)
Modified:
    webservices/axiom/trunk/testsuites/soap-testsuite/pom.xml
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessage.java
    
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessageSet.java

Modified: webservices/axiom/trunk/testsuites/soap-testsuite/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/soap-testsuite/pom.xml?rev=1605152&r1=1605151&r2=1605152&view=diff
==============================================================================
--- webservices/axiom/trunk/testsuites/soap-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/testsuites/soap-testsuite/pom.xml Tue Jun 24 
18:50:39 2014
@@ -29,6 +29,13 @@
     <description>
         Contains sample messages, metadata and utilities to build tests for 
SOAP 1.1 and 1.2.
     </description>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
     <profiles>
         <profile>
             <id>apache-release</id>
@@ -39,9 +46,10 @@
                         <artifactId>apache-rat-plugin</artifactId>
                         <configuration>
                             <excludes>
-                                <!-- src/main/resources contains test files 
and they obviously cannot
-                                     all contain a valid license header -->
-                                <exclude>src/main/resources/**</exclude>
+                                <!-- the schemas have their own copyright 
notices -->
+                                
<exclude>src/main/resources/org/apache/axiom/ts/soap/xsd/*</exclude>
+                                <!-- test messages obviously cannot all 
contain a valid license header -->
+                                
<exclude>src/main/resources/test-message/**</exclude>
                             </excludes>
                         </configuration>
                     </plugin>

Modified: 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java?rev=1605152&r1=1605151&r2=1605152&view=diff
==============================================================================
--- 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
 (original)
+++ 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
 Tue Jun 24 18:50:39 2014
@@ -24,6 +24,10 @@ import java.util.List;
 import java.util.Set;
 
 import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
 
 /**
  * Describes the characteristics of a given SOAP version.
@@ -41,7 +45,8 @@ public abstract class SOAPSpec extends A
             new QName("detail"),
             "http://schemas.xmlsoap.org/soap/actor/next";,
             new QName("http://schemas.xmlsoap.org/soap/envelope/";, "Client"),
-            new QName("http://schemas.xmlsoap.org/soap/envelope/";, "Server")) {
+            new QName("http://schemas.xmlsoap.org/soap/envelope/";, "Server"),
+            new String[] { "soap-1.1.xsd" }) {
         public SOAPSpec getAltSpec() {
             return SOAPSpec.SOAP12;
         }
@@ -63,7 +68,8 @@ public abstract class SOAPSpec extends A
             new QName("http://www.w3.org/2003/05/soap-envelope";, "Detail"),
             "http://www.w3.org/2003/05/soap-envelope/role/next";,
             new QName("http://www.w3.org/2003/05/soap-envelope";, "Sender"),
-            new QName("http://www.w3.org/2003/05/soap-envelope";, "Receiver")) {
+            new QName("http://www.w3.org/2003/05/soap-envelope";, "Receiver"),
+            new String[] { "xml.xsd", "soap-1.2.xsd" }) {
         public SOAPSpec getAltSpec() {
             return SOAPSpec.SOAP11;
         }
@@ -91,11 +97,14 @@ public abstract class SOAPSpec extends A
     private final String nextRoleURI;
     private final QName senderFaultCode;
     private final QName receiverFaultCode;
+    private final String[] schemaResources;
+    private Schema schema;
     
     public SOAPSpec(String name, String envelopeNamespaceURI, BooleanLiteral[] 
booleanLiterals,
             QName faultCodeQName, QName faultValueQName, QName 
faultSubCodeQName, QName faultReasonQName,
             QName faultTextQName, QName faultNodeQName, QName faultRoleQName, 
QName faultDetailQName,
-            String nextRoleURI, QName senderFaultCode, QName 
receiverFaultCode) {
+            String nextRoleURI, QName senderFaultCode, QName receiverFaultCode,
+            String[] schemaResources) {
         this.name = name;
         this.envelopeNamespaceURI = envelopeNamespaceURI;
         this.booleanLiterals = booleanLiterals;
@@ -114,6 +123,7 @@ public abstract class SOAPSpec extends A
         this.nextRoleURI = nextRoleURI;
         this.senderFaultCode = senderFaultCode;
         this.receiverFaultCode = receiverFaultCode;
+        this.schemaResources = schemaResources;
     }
     
     public final String getName() {
@@ -245,4 +255,19 @@ public abstract class SOAPSpec extends A
     public final QName getReceiverFaultCode() {
         return receiverFaultCode;
     }
+    
+    public synchronized final Schema getSchema() {
+        if (schema == null) {
+            Source[] sources = new Source[schemaResources.length];
+            for (int i=0; i<schemaResources.length; i++) {
+                sources[i] = new 
StreamSource(SOAPSpec.class.getResource("xsd/" + 
schemaResources[i]).toString());
+            }
+            try {
+                schema = 
SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema";).newSchema(sources);
+            } catch (Exception ex) {
+                throw new Error(ex);
+            }
+        }
+        return schema;
+    }
 }

Modified: 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessage.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessage.java?rev=1605152&r1=1605151&r2=1605152&view=diff
==============================================================================
--- 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessage.java
 (original)
+++ 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessage.java
 Tue Jun 24 18:50:39 2014
@@ -21,6 +21,8 @@ package org.apache.axiom.ts.soap;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.TransformerFactory;
@@ -36,12 +38,24 @@ import org.xml.sax.InputSource;
  * A SOAP test message.
  */
 public abstract class TestMessage extends Adaptable {
+    private static final List<TestMessage> instances = new 
ArrayList<TestMessage>();
+    
+    static {
+        // Force instantiation of TestMessage objects related to 
TestMessageSets
+        TestMessageSet.getAll();
+    }
+    
     private final SOAPSpec spec;
     private final String name;
     
     TestMessage(SOAPSpec spec, String name) {
         this.spec = spec;
         this.name = name;
+        instances.add(this);
+    }
+    
+    public static TestMessage[] getAll() {
+        return instances.toArray(new TestMessage[instances.size()]);
     }
     
     /**

Modified: 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessageSet.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessageSet.java?rev=1605152&r1=1605151&r2=1605152&view=diff
==============================================================================
--- 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessageSet.java
 (original)
+++ 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/TestMessageSet.java
 Tue Jun 24 18:50:39 2014
@@ -18,10 +18,15 @@
  */
 package org.apache.axiom.ts.soap;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * A set of two equivalent SOAP messages, one for SOAP 1.1 and one for SOAP 
1.2.
  */
 public final class TestMessageSet extends Adaptable {
+    private static final List<TestMessageSet> instances = new 
ArrayList<TestMessageSet>();
+    
     /**
      * A simple SOAP message without header.
      */
@@ -49,8 +54,13 @@ public final class TestMessageSet extend
     private TestMessageSet(String name) {
         soap12Message = new SimpleTestMessage(SOAPSpec.SOAP12, 
"test-message/set/" + name + ".xml", "soap12/" + name);
         soap11Message = new ConvertedTestMessage(soap12Message, "soap11/" + 
name);
+        instances.add(this);
     }
 
+    public static TestMessageSet[] getAll() {
+        return instances.toArray(new TestMessageSet[instances.size()]);
+    }
+    
     /**
      * Get the test message for the given SOAP version.
      * 

Added: 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.1.xsd
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.1.xsd?rev=1605152&view=auto
==============================================================================
--- 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.1.xsd
 (added)
+++ 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.1.xsd
 Tue Jun 24 18:50:39 2014
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Schema for the SOAP/1.1 envelope
+
+Portions © 2001 DevelopMentor. 
+© 2001 W3C (Massachusetts Institute of Technology, Institut National de 
Recherche en Informatique et en Automatique, Keio University). All Rights 
Reserved.  
+ 
+This document is governed by the W3C Software License [1] as described in the 
FAQ [2].
+[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD 
+By obtaining, using and/or copying this work, you (the licensee) agree that 
you have read, understood, and will comply with the following terms and 
conditions:
+
+Permission to use, copy, modify, and distribute this software and its 
documentation, with or without modification,  for any purpose and without fee 
or royalty is hereby granted, provided that you include the following on ALL 
copies of the software and documentation or portions thereof, including 
modifications, that you make:
+
+1.  The full text of this NOTICE in a location viewable to users of the 
redistributed or derivative work. 
+
+2.  Any pre-existing intellectual property disclaimers, notices, or terms and 
conditions. If none exist, a short notice of the following form (hypertext is 
preferred, text is permitted) should be used within the body of any 
redistributed or derivative code: "Copyright © 2001 World Wide Web Consortium, 
(Massachusetts Institute of Technology, Institut National de Recherche en 
Informatique et en Automatique, Keio University). All Rights Reserved. 
http://www.w3.org/Consortium/Legal/"; 
+
+3.  Notice of any changes or modifications to the W3C files, including the 
date changes were made. (We recommend you provide URIs to the location from 
which the code is derived.)   
+
+Original W3C files; http://www.w3.org/2001/06/soap-envelope
+Changes made: 
+     - reverted namespace to http://schemas.xmlsoap.org/soap/envelope/
+     - reverted mustUnderstand to only allow 0 and 1 as lexical values
+        - made encodingStyle a global attribute 20020825
+        - removed default value from mustUnderstand attribute declaration
+
+THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS 
MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE 
OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD 
PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR 
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+The name and trademarks of copyright holders may NOT be used in advertising or 
publicity pertaining to the software without specific, written prior 
permission. Title to copyright in this software and any associated 
documentation will at all times remain with copyright holders.
+
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/"; 
targetNamespace="http://schemas.xmlsoap.org/soap/envelope/";>
+
+     
+  <!-- Envelope, header and body -->
+  <xs:element name="Envelope" type="tns:Envelope"/>
+  <xs:complexType name="Envelope">
+    <xs:sequence>
+      <xs:element ref="tns:Header" minOccurs="0"/>
+      <xs:element ref="tns:Body" minOccurs="1"/>
+      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" 
processContents="lax"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:element name="Header" type="tns:Header"/>
+  <xs:complexType name="Header">
+    <xs:sequence>
+      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" 
processContents="lax"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+  
+  <xs:element name="Body" type="tns:Body"/>
+  <xs:complexType name="Body">
+    <xs:sequence>
+      <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" 
processContents="lax"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##any" processContents="lax">
+         <xs:annotation>
+           <xs:documentation>
+                 Prose in the spec does not specify that attributes are 
allowed on the Body element
+               </xs:documentation>
+         </xs:annotation>
+       </xs:anyAttribute>
+  </xs:complexType>
+
+       
+  <!-- Global Attributes.  The following attributes are intended to be usable 
via qualified attribute names on any complex type referencing them.  -->
+  <xs:attribute name="mustUnderstand"> 
+     <xs:simpleType>
+     <xs:restriction base="xs:boolean">
+          <xs:pattern value="0|1"/>
+        </xs:restriction>
+   </xs:simpleType>
+  </xs:attribute>
+  <xs:attribute name="actor" type="xs:anyURI"/>
+
+  <xs:simpleType name="encodingStyle">
+    <xs:annotation>
+         <xs:documentation>
+           'encodingStyle' indicates any canonicalization conventions followed 
in the contents of the containing element.  For example, the value 
'http://schemas.xmlsoap.org/soap/encoding/' indicates the pattern described in 
SOAP specification
+         </xs:documentation>
+       </xs:annotation>
+    <xs:list itemType="xs:anyURI"/>
+  </xs:simpleType>
+
+  <xs:attribute name="encodingStyle" type="tns:encodingStyle"/>
+  <xs:attributeGroup name="encodingStyle">
+    <xs:attribute ref="tns:encodingStyle"/>
+  </xs:attributeGroup>
+
+  <xs:element name="Fault" type="tns:Fault"/>
+  <xs:complexType name="Fault" final="extension">
+    <xs:annotation>
+         <xs:documentation>
+           Fault reporting structure
+         </xs:documentation>
+       </xs:annotation>
+    <xs:sequence>
+      <xs:element name="faultcode" type="xs:QName"/>
+      <xs:element name="faultstring" type="xs:string"/>
+      <xs:element name="faultactor" type="xs:anyURI" minOccurs="0"/>
+      <xs:element name="detail" type="tns:detail" minOccurs="0"/>      
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="detail">
+    <xs:sequence>
+      <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" 
processContents="lax"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##any" processContents="lax"/> 
+  </xs:complexType>
+
+</xs:schema>
\ No newline at end of file

Added: 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.2.xsd
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.2.xsd?rev=1605152&view=auto
==============================================================================
--- 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.2.xsd
 (added)
+++ 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/soap-1.2.xsd
 Tue Jun 24 18:50:39 2014
@@ -0,0 +1,146 @@
+<!-- Schema defined in the SOAP Version 1.2 Part 1 specification
+     Recommendation:
+     http://www.w3.org/TR/2003/REC-soap12-part1-20030624/
+     $Id$
+
+     Copyright (C)2003 W3C(R) (MIT, ERCIM, Keio), All Rights Reserved.
+     W3C viability, trademark, document use and software licensing rules
+     apply.
+     http://www.w3.org/Consortium/Legal/
+
+     This document is governed by the W3C Software License [1] as
+     described in the FAQ [2].
+
+     [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+     [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"; 
targetNamespace="http://www.w3.org/2003/05/soap-envelope"; 
elementFormDefault="qualified">
+
+  <xs:import namespace="http://www.w3.org/XML/1998/namespace"; 
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+  <!-- Envelope, header and body -->
+  <xs:element name="Envelope" type="tns:Envelope"/>
+  <xs:complexType name="Envelope">
+    <xs:sequence>
+      <xs:element ref="tns:Header" minOccurs="0"/>
+      <xs:element ref="tns:Body" minOccurs="1"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:element name="Header" type="tns:Header"/>
+  <xs:complexType name="Header">
+    <xs:annotation>
+         <xs:documentation>
+         Elements replacing the wildcard MUST be namespace qualified, but can 
be in the targetNamespace
+         </xs:documentation>
+       </xs:annotation>
+    <xs:sequence>
+      <xs:any namespace="##any" processContents="lax" minOccurs="0" 
maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+  
+  <xs:element name="Body" type="tns:Body"/>
+  <xs:complexType name="Body">
+    <xs:sequence>
+      <xs:any namespace="##any" processContents="lax" minOccurs="0" 
maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <!-- Global Attributes.  The following attributes are intended to be
+  usable via qualified attribute names on any complex type referencing
+  them.  -->
+  <xs:attribute name="mustUnderstand" type="xs:boolean" default="0"/>
+  <xs:attribute name="relay" type="xs:boolean" default="0"/>
+  <xs:attribute name="role" type="xs:anyURI"/>
+
+  <!-- 'encodingStyle' indicates any canonicalization conventions
+  followed in the contents of the containing element.  For example, the
+  value 'http://www.w3.org/2003/05/soap-encoding' indicates the pattern
+  described in the SOAP Version 1.2 Part 2: Adjuncts Recommendation -->
+
+  <xs:attribute name="encodingStyle" type="xs:anyURI"/>
+
+  <xs:element name="Fault" type="tns:Fault"/>
+  <xs:complexType name="Fault" final="extension">
+    <xs:annotation>
+         <xs:documentation>
+           Fault reporting structure
+         </xs:documentation>
+       </xs:annotation>
+    <xs:sequence>
+      <xs:element name="Code" type="tns:faultcode"/>
+      <xs:element name="Reason" type="tns:faultreason"/>
+      <xs:element name="Node" type="xs:anyURI" minOccurs="0"/>
+         <xs:element name="Role" type="xs:anyURI" minOccurs="0"/>
+      <xs:element name="Detail" type="tns:detail" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="faultreason">
+    <xs:sequence>
+         <xs:element name="Text" type="tns:reasontext" minOccurs="1" 
maxOccurs="unbounded"/>
+       </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="reasontext">
+    <xs:simpleContent>
+         <xs:extension base="xs:string">
+           <xs:attribute ref="xml:lang" use="required"/>
+         </xs:extension>
+       </xs:simpleContent>
+  </xs:complexType>
+  
+  <xs:complexType name="faultcode">
+    <xs:sequence>
+      <xs:element name="Value" type="tns:faultcodeEnum"/>
+      <xs:element name="Subcode" type="tns:subcode" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:simpleType name="faultcodeEnum">
+    <xs:restriction base="xs:QName">
+      <xs:enumeration value="tns:DataEncodingUnknown"/>
+      <xs:enumeration value="tns:MustUnderstand"/>
+      <xs:enumeration value="tns:Receiver"/>
+      <xs:enumeration value="tns:Sender"/>
+      <xs:enumeration value="tns:VersionMismatch"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:complexType name="subcode">
+    <xs:sequence>
+      <xs:element name="Value" type="xs:QName"/>
+      <xs:element name="Subcode" type="tns:subcode" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="detail">
+    <xs:sequence>
+      <xs:any namespace="##any" processContents="lax" minOccurs="0" 
maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/> 
+  </xs:complexType>
+
+  <!-- Global element declaration and complex type definition for header entry 
returned due to a mustUnderstand fault -->
+  <xs:element name="NotUnderstood" type="tns:NotUnderstoodType"/>
+  <xs:complexType name="NotUnderstoodType">
+    <xs:attribute name="qname" type="xs:QName" use="required"/>
+  </xs:complexType>
+
+
+  <!-- Global element and associated types for managing version transition as 
described in Appendix A of the SOAP Version 1.2 Part 1 Recommendation  -->  
<xs:complexType name="SupportedEnvType">
+    <xs:attribute name="qname" type="xs:QName" use="required"/>
+  </xs:complexType>
+
+  <xs:element name="Upgrade" type="tns:UpgradeType"/>
+  <xs:complexType name="UpgradeType">
+    <xs:sequence>
+         <xs:element name="SupportedEnvelope" type="tns:SupportedEnvType" 
minOccurs="1" maxOccurs="unbounded"/>
+       </xs:sequence>
+  </xs:complexType>
+
+
+</xs:schema>
\ No newline at end of file

Added: 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/xml.xsd
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/xml.xsd?rev=1605152&view=auto
==============================================================================
--- 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/xml.xsd
 (added)
+++ 
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/xsd/xml.xsd
 Tue Jun 24 18:50:39 2014
@@ -0,0 +1,287 @@
+<?xml version='1.0'?>
+<?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace"; 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
+  xmlns   ="http://www.w3.org/1999/xhtml";
+  xml:lang="en">
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+    <h1>About the XML namespace</h1>
+
+    <div class="bodytext">
+     <p>
+      This schema document describes the XML namespace, in a form
+      suitable for import by other schema documents.
+     </p>
+     <p>
+      See <a href="http://www.w3.org/XML/1998/namespace.html";>
+      http://www.w3.org/XML/1998/namespace.html</a> and
+      <a href="http://www.w3.org/TR/REC-xml";>
+      http://www.w3.org/TR/REC-xml</a> for information 
+      about this namespace.
+     </p>
+     <p>
+      Note that local names in this namespace are intended to be
+      defined only by the World Wide Web Consortium or its subgroups.
+      The names currently defined in this namespace are listed below.
+      They should not be used with conflicting semantics by any Working
+      Group, specification, or document instance.
+     </p>
+     <p>   
+      See further below in this document for more information about <a
+      href="#usage">how to refer to this schema document from your own
+      XSD schema documents</a> and about <a href="#nsversioning">the
+      namespace-versioning policy governing this schema document</a>.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>lang (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       is a language code for the natural language of the content of
+       any element; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML specification.</p>
+     
+    </div>
+    <div>
+     <h4>Notes</h4>
+     <p>
+      Attempting to install the relevant ISO 2- and 3-letter
+      codes as the enumerated possible values is probably never
+      going to be a realistic possibility.  
+     </p>
+     <p>
+      See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt";>
+       http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
+      and the IANA language subtag registry at
+      <a href="http://www.iana.org/assignments/language-subtag-registry";>
+       http://www.iana.org/assignments/language-subtag-registry</a>
+      for further information.
+     </p>
+     <p>
+      The union allows for the 'un-declaration' of xml:lang with
+      the empty string.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:union memberTypes="xs:language">
+    <xs:simpleType>    
+     <xs:restriction base="xs:string">
+      <xs:enumeration value=""/>
+     </xs:restriction>
+    </xs:simpleType>
+   </xs:union>
+  </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>space (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose
+       value is a keyword indicating what whitespace processing
+       discipline is intended for the content of the element; its
+       value is inherited.  This name is reserved by virtue of its
+       definition in the XML specification.</p>
+     
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:restriction base="xs:NCName">
+    <xs:enumeration value="default"/>
+    <xs:enumeration value="preserve"/>
+   </xs:restriction>
+  </xs:simpleType>
+ </xs:attribute>
+ 
+ <xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>base (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       provides a URI to be used as the base for interpreting any
+       relative URIs in the scope of the element on which it
+       appears; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML Base specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xmlbase/";>http://www.w3.org/TR/xmlbase/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+ 
+ <xs:attribute name="id" type="xs:ID">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>id (as an attribute name)</h3> 
+      <p>
+       denotes an attribute whose value
+       should be interpreted as if declared to be of type ID.
+       This name is reserved by virtue of its definition in the
+       xml:id specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xml-id/";>http://www.w3.org/TR/xml-id/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+  <xs:attribute ref="xml:base"/>
+  <xs:attribute ref="xml:lang"/>
+  <xs:attribute ref="xml:space"/>
+  <xs:attribute ref="xml:id"/>
+ </xs:attributeGroup>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+   
+    <h3>Father (in any context at all)</h3> 
+
+    <div class="bodytext">
+     <p>
+      denotes Jon Bosak, the chair of 
+      the original XML Working Group.  This name is reserved by 
+      the following decision of the W3C XML Plenary and 
+      XML Coordination groups:
+     </p>
+     <blockquote>
+       <p>
+       In appreciation for his vision, leadership and
+       dedication the W3C XML Plenary on this 10th day of
+       February, 2000, reserves for Jon Bosak in perpetuity
+       the XML name "xml:Father".
+       </p>
+     </blockquote>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div xml:id="usage" id="usage">
+    <h2><a name="usage">About this schema document</a></h2>
+
+    <div class="bodytext">
+     <p>
+      This schema defines attributes and an attribute group suitable
+      for use by schemas wishing to allow <code>xml:base</code>,
+      <code>xml:lang</code>, <code>xml:space</code> or
+      <code>xml:id</code> attributes on elements they define.
+     </p>
+     <p>
+      To enable this, such a schema must import this schema for
+      the XML namespace, e.g. as follows:
+     </p>
+     <pre>
+          &lt;schema . . .>
+           . . .
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace";
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     </pre>
+     <p>
+      or
+     </p>
+     <pre>
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace";
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     </pre>
+     <p>
+      Subsequently, qualified reference to any of the attributes or the
+      group defined below will have the desired effect, e.g.
+     </p>
+     <pre>
+          &lt;type . . .>
+           . . .
+           &lt;attributeGroup ref="xml:specialAttrs"/>
+     </pre>
+     <p>
+      will define a type which will schema-validate an instance element
+      with any of those attributes.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div id="nsversioning" xml:id="nsversioning">
+    <h2><a name="nsversioning">Versioning policy for this schema 
document</a></h2>
+    <div class="bodytext">
+     <p>
+      In keeping with the XML Schema WG's standard versioning
+      policy, this schema document will persist at
+      <a href="http://www.w3.org/2009/01/xml.xsd";>
+       http://www.w3.org/2009/01/xml.xsd</a>.
+     </p>
+     <p>
+      At the date of issue it can also be found at
+      <a href="http://www.w3.org/2001/xml.xsd";>
+       http://www.w3.org/2001/xml.xsd</a>.
+     </p>
+     <p>
+      The schema document at that URI may however change in the future,
+      in order to remain compatible with the latest version of XML
+      Schema itself, or with the XML namespace itself.  In other words,
+      if the XML Schema or XML namespaces change, the version of this
+      document at <a href="http://www.w3.org/2001/xml.xsd";>
+       http://www.w3.org/2001/xml.xsd 
+      </a> 
+      will change accordingly; the version at 
+      <a href="http://www.w3.org/2009/01/xml.xsd";>
+       http://www.w3.org/2009/01/xml.xsd 
+      </a> 
+      will not change.
+     </p>
+     <p>
+      Previous dated (and unchanging) versions of this schema 
+      document are at:
+     </p>
+     <ul>
+      <li><a href="http://www.w3.org/2009/01/xml.xsd";>
+       http://www.w3.org/2009/01/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2007/08/xml.xsd";>
+       http://www.w3.org/2007/08/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2004/10/xml.xsd";>
+       http://www.w3.org/2004/10/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2001/03/xml.xsd";>
+       http://www.w3.org/2001/03/xml.xsd</a></li>
+     </ul>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+</xs:schema>
+

Added: 
webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/axiom/ts/soap/ValidationTest.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/axiom/ts/soap/ValidationTest.java?rev=1605152&view=auto
==============================================================================
--- 
webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/axiom/ts/soap/ValidationTest.java
 (added)
+++ 
webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/axiom/ts/soap/ValidationTest.java
 Tue Jun 24 18:50:39 2014
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.ts.soap;
+
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class ValidationTest extends TestCase {
+    private final TestMessage message;
+    
+    public ValidationTest(TestMessage message) {
+        super(message.getName());
+        this.message = message;
+    }
+
+    @Override
+    protected void runTest() throws Throwable {
+        message.getSOAPSpec().getSchema().newValidator().validate(new 
StreamSource(message.getInputStream()));
+    }
+
+    public static TestSuite suite() {
+        TestSuite suite = new TestSuite();
+        for (TestMessage message : TestMessage.getAll()) {
+            suite.addTest(new ValidationTest(message));
+        }
+        return suite;
+    }
+}

Propchange: 
webservices/axiom/trunk/testsuites/soap-testsuite/src/test/java/org/apache/axiom/ts/soap/ValidationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to