[jboss-svn-commits] JBL Code SVN: r25707 - in labs/jbossesb/branches/JBESB_4_4_GA_FP: product/rosetta/src/org/jboss/internal/soa/esb/webservice and 11 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Mar 18 07:57:14 EDT 2009


Author: beve
Date: 2009-03-18 07:57:14 -0400 (Wed, 18 Mar 2009)
New Revision: 25707

Added:
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/request2.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/subtypes/
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/testlib/jetty-6.1.15.jar
   labs/jbossesb/branches/JBESB_4_4_GA_FP/testlib/jetty-util-6.1.15.jar
Modified:
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/util/SchemaResolver.java
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/util/XMLHelper.java
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SchemaResolverUnitTest.java
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/XMLHelperUnitTest.java
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/sample-request.xml
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/ESBContractGeneratorUnitTest.java
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/build.xml
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/readme.txt
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/request.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/response.xsd
   labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml
Log:
Work for https://jira.jboss.org/jira/browse/JBESB-2217 "Implement support for schema import in EBWS WSDL generation/action pipeline validation."



Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/util/SchemaResolver.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/util/SchemaResolver.java	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/util/SchemaResolver.java	2009-03-18 11:57:14 UTC (rev 25707)
@@ -27,6 +27,7 @@
 import java.io.Reader;
 import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
+import java.net.URI;
 
 import org.apache.log4j.Logger;
 import org.jboss.internal.soa.esb.assertion.AssertArgument;
@@ -52,22 +53,33 @@
     final private String encoding;
 
     /**
-     * Constructs an instance with an encoding of UTF-8.
+     * Base URI that resources will be resolved realtive to.
      */
-    public SchemaResolver()
+    private final URI parentSchemaUri;
+
+    /**
+     * Constructs an instance with the default encoding (UTF-8) and
+     * using the passed in baseUri.
+     * 
+     * @param baseUri Base URI that resources will be resolved realtive to.
+     */
+    public SchemaResolver(final URI baseUri)
     {
-        this("UTF-8");
+        this("UTF-8", baseUri);
     }
 
     /**
      * Constructs an instance with the specified encoding.
      * 
      * @param encoding The encoding to use when reading resources. Must not be null;
+     * @param baseUri Base URI that resources will be resolved realtive to.
      */
-    public SchemaResolver(final String encoding)
+    public SchemaResolver(final String encoding, final URI baseUri)
     {
         AssertArgument.isNotNullAndNotEmpty(encoding, "encoding");
+        AssertArgument.isNotNull(baseUri, "baseUri");
         this.encoding = encoding;
+        this.parentSchemaUri = baseUri;
     }
     
     /**
@@ -75,97 +87,95 @@
      * 
      * @return LSInput  A new {@link LSInputImpl} object instance.
      */
-    public LSInput resolveResource(final String type, final String namespaceURI, final String publicId, final String systemId, final String baseURI)
+    public LSInput resolveResource(final String type, final String namespaceURI, final String publicId, String systemId, final String baseURI)
     {
         if (log.isDebugEnabled())
         {
-            log.debug(String.format("type='%s', namespaceURI='%s', publicId='%s', systemId='%s', baseURI='%s'", type, namespaceURI, publicId, systemId, baseURI));
+            log.debug(String.format("parentSchemaUri='%s', systemId='%s', baseURI='%s'", this.parentSchemaUri, systemId, baseURI));
         }
         
-        return new LSInputImpl(publicId, systemId, baseURI);
-    }
+        LSInputImpl inputImpl = new LSInputImpl();
 
-    /**
-     * Concrete {@link LSInput} implementation.
-     * <p/>
-     * 
-     * From {@link LSInput} javadoc:<br>
-     * The LSParser will use the LSInput object to determine how to read data.
-     * The LSParser will look at the different inputs specified in the LSInput
-     * in the following order to know which one to read from, the first one that
-     * is not null and not an empty string will be used: </p>
-     * 
-     * The following will be returned by this LSInput implmentation:
-     * <lu> 
-     * <li><i>getCharacterStream</i> Reader for the schema located on the local file system or on the classpath. Or null in the resource cannot be located.</li> 
-     * <li><i>getByteStream</i> null</li> 
-     * <li><i>getStringData</i> null</li> 
-     * <li><i>getSystemId</i> Will return the systemId which can be used by the LSParser to resolve the resource</li>
-     * <li><i>getPublicId</i> null</li>
-     */
-    private class LSInputImpl implements LSInput
-    {
-        private final String publicId;
-        private final String systemId;
-        private final String baseURI;
-
-        public LSInputImpl(final String publicId, final String systemId, final String baseURI)
+        URI resolvedUri;
+        if (baseURI != null)
         {
-            this.publicId = publicId;
-            this.systemId = systemId;
-            this.baseURI = baseURI;
+            // Resolve relative to the baseUri passed in. 
+            URI uri = URI.create(baseURI);
+            log.debug("Try to resolve " + uri + "/" + systemId);
+            resolvedUri = uri.resolve(systemId);
         }
+        else
+        {
+            // Resolve the systemId (the schema path) relative to the parent schema.
+            resolvedUri = parentSchemaUri.resolve(systemId);
+        }
+        log.debug("Resolved Schema '" + resolvedUri + "'");
         
-        /**
-         * Will try to locate the resouce identified by systemId by first trying
-         * to locate it on the local filesystem, and failing to find it there it
-         * will try the classpath.
-         * 
-         * @return Reader Either a reader that is able to read the resource
-         *         identified by systemId or null if the resource could not be
-         *         located.
-         */
-        public Reader getCharacterStream()
+        inputImpl.setSystemId(resolvedUri.toString());
+        inputImpl.setCharacterStream(getReader(resolvedUri));
+        return inputImpl;
+    }
+    
+    private Reader getReader(final URI resolvedUri)
+    {
+        String scheme = resolvedUri.getScheme();
+        if (resolvedUri.isAbsolute())
         {
-            if (systemId == null)
+            if (scheme.equals("file"))
             {
-                return null;
-            }
-
-            InputStream in = null;
-            try
-            {
-                // Try to locate the resource from the local filesystem.
-                in = getFileInputStream(systemId);
-            } 
-            catch (final FileNotFoundException e)
-            {
-                // Try to locate the resouce from the classpath
-                in = ClassUtil.getResourceAsStream(systemId, getClass());
-                if (in == null)
-                {
-                    // Try the root of the classpath by prefixing the systemId with "/".
-                    // This would be the case for example if a schema import was specified
-                    // as relative without a slash.
-                    in = ClassUtil.getResourceAsStream("/" + systemId, getClass());
-                }
-            }
-
-            if (in != null)
-            {
                 try
                 {
+                    // Try to locate the resource from the local filesystem.
+                    InputStream in = getFileInputStream(resolvedUri);
                     return new StringReader(StreamUtils.readStreamString(in, encoding));
                 } 
-                catch (final UnsupportedEncodingException e)
+                catch (final FileNotFoundException e)
                 {
                     log.error(e.getMessage(), e);
+                } 
+                catch (UnsupportedEncodingException e)
+                {
+                    log.error(e.getMessage(), e);
                 }
             }
+            else if (scheme.equals("classpath"))
+            {
+                InputStream in = ClassUtil.getResourceAsStream(resolvedUri.getPath(), getClass());
+                if (in != null)
+                {
+                    try
+                    {
+                        return new StringReader(StreamUtils.readStreamString(in, encoding));
+                    } 
+                    catch (final UnsupportedEncodingException e)
+                    {
+                        log.error(e.getMessage(), e);
+                    }
+                }
+                else
+                {
+                    log.info("Could not read resource : " + resolvedUri.getPath());
+                }
+            }
+        }
+        return null;
+    }
 
-            // getSystemId will return the systemId and try to resolve the URI.
-            return null;
+    private class LSInputImpl implements LSInput
+    {
+        private String publicId;
+        private String systemId;
+        private String baseUri;
+        private Reader reader;
+        
+        public LSInputImpl()
+        {
         }
+        
+        public Reader getCharacterStream()
+        {
+            return reader;
+        }
 
         /**
          * @return null
@@ -190,7 +200,7 @@
 
         public String getBaseURI()
         {
-            return baseURI;
+            return baseUri;
         }
 
         public String getPublicId()
@@ -211,20 +221,13 @@
             return false;
         }
 
-        /**
-         * @throws UnsupportedOperationException
-         */
         public void setBaseURI(String baseURI)
         {
-            throw new UnsupportedOperationException("setBaseURI is not supported");
+            this.baseUri = baseURI;
         }
 
-        /**
-         * @throws UnsupportedOperationException
-         */
         public void setByteStream(InputStream byteStream)
         {
-            throw new UnsupportedOperationException("setBaseStream is not supported");
         }
 
         /**
@@ -240,7 +243,7 @@
          */
         public void setCharacterStream(Reader characterStream)
         {
-            throw new UnsupportedOperationException("setCharacterStream is not supported");
+            this.reader = characterStream;
         }
 
         /**
@@ -251,12 +254,9 @@
             throw new UnsupportedOperationException("setEncoding is not supported");
         }
 
-        /**
-         * @throws UnsupportedOperationException
-         */
         public void setPublicId(String publicId)
         {
-            throw new UnsupportedOperationException("setPublicId is not supported");
+            this.publicId = publicId;
         }
 
         /**
@@ -267,23 +267,20 @@
             throw new UnsupportedOperationException("setStringData is not supported");
         }
 
-        /**
-         * @throws UnsupportedOperationException
-         */
         public void setSystemId(String systemId)
         {
-            throw new UnsupportedOperationException("setSystemId is not supported");
+            this.systemId = systemId;
         }
     }
 
-    private InputStream getFileInputStream(final String systemId) throws FileNotFoundException
+    private InputStream getFileInputStream(final URI uri) throws FileNotFoundException
     {
-        File file = new File(systemId);
+        File file = new File(uri);
         if (file.exists() && !file.isDirectory())
         {
             return new FileInputStream(file);
         }
 
-        throw new FileNotFoundException("Could not locate '" + systemId + "' on local filesystem");
+        throw new FileNotFoundException("Could not locate '" + uri + "' on local filesystem");
     }
 }

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/util/XMLHelper.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/util/XMLHelper.java	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/util/XMLHelper.java	2009-03-18 11:57:14 UTC (rev 25707)
@@ -20,12 +20,17 @@
  */
 package org.jboss.internal.soa.esb.util;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Reader;
 import java.io.StringReader;
 import java.io.Writer;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLInputFactory;
@@ -39,6 +44,7 @@
 import javax.xml.validation.SchemaFactory;
 import javax.xml.validation.Validator;
 
+import org.apache.log4j.Logger;
 import org.jboss.internal.soa.esb.util.stax.ParsingSupport;
 import org.jboss.internal.soa.esb.util.stax.StreamHelper;
 import org.jboss.soa.esb.util.ClassUtil;
@@ -53,6 +59,8 @@
  */
 public class XMLHelper
 {
+    private static Logger log = Logger.getLogger(XMLHelper.class);
+    
     /**
      * The XML input factory.
      */
@@ -61,10 +69,6 @@
      * The XML output factory.
      */
     private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance() ;
-    /**
-     * The schema factory.
-     */
-    private static final SchemaFactory SCHEMA_FACTORY = SchemaFactory.newInstance( "http://www.w3.org/2001/XMLSchema" );
 
     /**
      * Get the XML stream reader.
@@ -170,11 +174,40 @@
      * @return The resource schema for validation. 
      * @throws SAXException For errors during parsing.
      */
-    public static Schema getSchema(final String resource)
-        throws SAXException
+    public static Schema getSchema(final String resource) throws SAXException
     {
-        final InputStream resourceIS = ClassUtil.getResourceAsStream(resource, XMLHelper.class) ;
-        return SCHEMA_FACTORY.newSchema(new StreamSource(resourceIS)) ;
+        SchemaResolver schemaResolver;
+        try
+        {
+            URI schemaUri = getResourceUri(resource, XMLHelper.class) ;
+            log.debug("schemaUri : " + schemaUri);
+            schemaResolver = new SchemaResolver(schemaUri);
+            
+            URL schemaUrl;
+            if (schemaUri.getScheme().equals("classpath"))
+            {
+                schemaUrl = ClassUtil.getResource(schemaUri.getPath(), XMLHelper.class) ;
+            }
+            else
+            {
+                schemaUrl = schemaUri.toURL();
+            }
+            log.debug("schemaUrl : " + schemaUrl);
+            
+            return getSchema(schemaUrl, schemaResolver);
+        } 
+        catch (final URISyntaxException e)
+        {
+            throw new SAXException("URISyntaxException while trying to locate '" + resource + "'");
+        } 
+        catch (final MalformedURLException e)
+        {
+            throw new SAXException("MalformedURLException while trying to located '" + resource + "'");
+        } 
+        catch (final IOException e)
+        {
+            throw new SAXException("IOException while trying to locate '" + resource + "'");
+        }
     }
     
     /**
@@ -185,17 +218,61 @@
      * @param resolver  The {@link LSResourceResolver} for locating external resources.
      * @return Schema   The resource schema for validation. 
      * @throws SAXException
+     * @throws IOException 
      */
-    public static Schema getSchema(final String resource, final LSResourceResolver resolver) throws SAXException
+    public static Schema getSchema(final URL resource, final LSResourceResolver resolver) throws SAXException, IOException
     {
-        // SchemaFactory is not thread safe which is why I'm creating a new instance here.
-        final SchemaFactory schemaFactory = SchemaFactory.newInstance( "http://www.w3.org/2001/XMLSchema" );
+        final SchemaFactory schemaFactory = newSchemaFactory();
         schemaFactory.setResourceResolver(resolver);
         
-        final InputStream resourceIS = ClassUtil.getResourceAsStream(resource, XMLHelper.class) ;
+        final InputStream resourceIS = resource.openStream();
         return schemaFactory.newSchema(new StreamSource(resourceIS)) ;
     }
     
+    public static URI getResourceUri(final String resourceName, final Class<?> caller) throws URISyntaxException, MalformedURLException
+    {
+        File file = new File(resourceName);
+        if (file.exists() && !file.isDirectory())
+        {
+            return file.toURI();
+        }
+        
+        String resource = resourceName;
+        if (resourceName.startsWith("/"))
+        {
+            resource = resourceName.substring(1) ;
+        }
+        
+        final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
+        if (threadClassLoader != null)
+        {
+            final URL url = threadClassLoader.getResource(resource) ;
+            if (url != null)
+            {
+                return URI.create("classpath://" + resourceName);
+            }
+        }
+        
+        final ClassLoader classLoader = caller.getClassLoader() ;
+        if (classLoader != null)
+        {
+            final URL url = classLoader.getResource(resource) ;
+            if (url != null)
+            {
+                return URI.create("classpath://" + resourceName);
+            }
+        }
+        
+        URL systemResource = ClassLoader.getSystemResource(resource);
+        if (systemResource != null)
+        {
+            return systemResource.toURI();
+        }
+        
+        return new URI(resourceName);
+    }
+
+    
     /**
      * Get the schema for the specified resources.
      * @param resources The schema resources to parse.
@@ -212,7 +289,7 @@
             final InputStream resourceIS = ClassUtil.getResourceAsStream(resources[count], XMLHelper.class) ;
             sources[count] = new StreamSource(resourceIS) ;
         }
-        return SCHEMA_FACTORY.newSchema(sources) ;
+        return newSchemaFactory().newSchema(sources) ;
     }
     
     /**
@@ -229,12 +306,23 @@
             validator.validate(new StreamSource(new StringReader(xml))) ;
             return true ;
         }
-        catch (final IOException ioe) {} // fall through
-        catch (final SAXException saxe)  {} // fall through
+        catch (final IOException ioe) 
+        {
+            log.debug(ioe.getMessage(), ioe);
+        } 
+        catch (final SAXException saxe)  
+        {
+            log.debug(saxe.getMessage(), saxe);
+        } 
         
         return false ;
     }
 
+    private static SchemaFactory newSchemaFactory()
+    {
+        return SchemaFactory.newInstance( "http://www.w3.org/2001/XMLSchema" );
+    }
+
     /**
      * Create the XML input factory.
      * @return The XML input factory.

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java	2009-03-18 11:57:14 UTC (rev 25707)
@@ -97,10 +97,12 @@
 						.getResourceAsStream(inXsd, ESBContractGenerator.class),
 						false, false);
 				if (doc != null) {
+					/*
 					String schemaNs = getSchemaNs(doc);
 					if (schemaNs != null) {
 						schemasAdded.add(schemaNs);
 					}
+					*/
 					reqMessage = addMessage(def, doc.getDocumentElement(),
 							serviceInfo.getRequestName(), "in", ++nsSuffixCounter);
 				}
@@ -115,10 +117,10 @@
 						.getResourceAsStream(outXsd, ESBContractGenerator.class),
 						false, false);
 				if (doc != null) {
-					if (!schemasAdded.contains(getSchemaNs(doc))) {
+					//if (!schemasAdded.contains(getSchemaNs(doc))) {
 						resMessage = addMessage(def, doc.getDocumentElement(),
 							serviceInfo.getResponseName(), "out", ++nsSuffixCounter);
-					}
+					//}
 				}
 			} catch (Exception e) {
 				throw new ConfigurationException("File defined in outXsd attribute '" + outXsd + "' not found in classpath.", e);
@@ -135,11 +137,11 @@
 						.getResourceAsStream(xsd, ESBContractGenerator.class),
 						false, false);
 					if (doc != null) {
-						if (!schemasAdded.contains(getSchemaNs(doc))) {
+					//	if (!schemasAdded.contains(getSchemaNs(doc))) {
 							addFaultMessage(faultMessages, def, doc.getDocumentElement(),
 							serviceInfo.getFaultName(), "fault", ++nsSuffixCounter);
 						}
-					}
+					//}
 				}
 			} catch (Exception e) {
 				throw new ConfigurationException("File defined in faultXsd attribute '" + faultXsd + "' not found in classpath.", e);

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java	2009-03-18 11:57:14 UTC (rev 25707)
@@ -504,15 +504,22 @@
                    {
                        final Service service = webserviceInfo.getService() ;
                        
-                       // Copy any additional schemas to the wsdl directory to support imports.
-                       final File esbArchive = new File(di.watch.getFile());
-                       final Map<String, String> schemasMap = JBoss4ESBDeployer.getSchemas(esbArchive);
-                	   final String wsdlDir = "WEB-INF/wsdl/" + service.getCategory().replace('/', '_') + "/";
-                       for (Entry<String, String> schemaEntry : schemasMap.entrySet())
-                       {
-                           log.debug("Adding schema " + wsdlDir + schemaEntry.getKey());
-                           addFile(zos, wsdlDir + schemaEntry.getKey(), schemaEntry.getValue()) ;
-                       }
+					   // Copy all schemas to the wsdl directory to support imports.
+                       final File esbArchive = new File(di.watch.getFile());
+                       final Map<String, String> schemasMap = JBoss4ESBDeployer.getSchemas(esbArchive);
+                	   final String wsdlDir = "WEB-INF/wsdl/" + service.getCategory().replace('/', '_') + "/";
+                       for (Entry<String, String> schemaEntry : schemasMap.entrySet())
+                       {
+                           try 
+                           {
+                               addFile(zos, wsdlDir + schemaEntry.getKey(), schemaEntry.getValue()) ;
+                               log.debug("Added schema " + wsdlDir + schemaEntry.getKey());
+                           }
+                           catch (final ZipException e)
+                           {
+                               log.debug(e.getMessage(), e);
+                           }
+                       }
                        
                        final ESBServiceEndpointInfo serviceInfo = new ESBServiceEndpointInfo(webserviceInfo) ;
                        final String wsdl = ESBContractGenerator.generateWSDL(webserviceInfo, serviceInfo) ;
@@ -1020,7 +1027,7 @@
 
     private static boolean isXsd(final String fileName)
     {
-        return fileName.endsWith(".xsd") && !fileName.equals("request.xsd") && !fileName.equals("response.xsd") && !fileName.equals("fault.xsd");
+        return fileName.endsWith(".xsd");
     }
 
     static Map<String, String> getSchemasFromArchive(final File archive) throws DeploymentException

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	2009-03-18 11:57:14 UTC (rev 25707)
@@ -57,7 +57,6 @@
 import org.jboss.soa.esb.lifecycle.LifecycleResourceException;
 import org.jboss.soa.esb.listeners.ListenerTagNames;
 import org.jboss.soa.esb.listeners.message.errors.Factory;
-import org.jboss.soa.esb.listeners.message.ServiceMessageCounter;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.MessagePayloadProxy;
 import org.jboss.soa.esb.message.Properties;
@@ -189,11 +188,10 @@
 		final boolean validate = config.getBooleanAttribute(ListenerTagNames.VALIDATE_ATTRIBUTE_TAG, false) ;
 		if (validate)
 		{
-    		final SchemaResolver schemaResolver = new SchemaResolver();
 			final String inXsd = config.getAttribute(ListenerTagNames.IN_XSD_ATTRIBUTE_TAG) ;
 			try
 			{
-				requestSchema = (inXsd == null ? null : XMLHelper.getSchema(inXsd, schemaResolver)) ;
+				requestSchema = (inXsd == null ? null : XMLHelper.getSchema(inXsd)) ;
 			}
 			catch (final SAXException saxe)
 			{
@@ -202,7 +200,7 @@
 			final String outXsd = config.getAttribute(ListenerTagNames.OUT_XSD_ATTRIBUTE_TAG) ;
 			try
 			{
-				responseSchema = (outXsd == null ? null : XMLHelper.getSchema(outXsd, schemaResolver)) ;
+				responseSchema = (outXsd == null ? null : XMLHelper.getSchema(outXsd));
 			}
 			catch (final SAXException saxe)
 			{
@@ -969,16 +967,16 @@
 
     /**
      * Retrieves the authentication reqeust from the Message context using
-     * {@link org.jboss.soa.esb.services.security.SecurityService#AUTH_REQUEST} as the key.
+     * {@link SecurityService#AUTH_REQUEST} as the key.
      * <p/>
      * This location may contain an encrypted AuthenticationRequest and if one
      * exists it will be decryped and return. If one does not exist this
      * method will return null.
      *
      * @param message The ESB Message object.
-     * @return {@link org.jboss.soa.esb.services.security.auth.AuthenticationRequest} The decrypted AuthenticationRequest or null if one did not exist.
+     * @return {@link AuthenticationRequest} The decrypted AuthenticationRequest or null if one did not exist.
      *
-     * @throws org.jboss.soa.esb.services.security.SecurityServiceException If a problem occurs during decryption.
+     * @throws SecurityServiceException If a problem occurs during decryption.
      */
     private AuthenticationRequest getAutenticationRequest(final Message message) throws SecurityServiceException
     {

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SchemaResolverUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SchemaResolverUnitTest.java	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SchemaResolverUnitTest.java	2009-03-18 11:57:14 UTC (rev 25707)
@@ -24,9 +24,13 @@
 import static org.junit.Assert.assertNull;
 
 import java.io.Reader;
+import java.net.URISyntaxException;
+import java.net.URL;
 
 import junit.framework.JUnit4TestAdapter;
 
+import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.w3c.dom.ls.LSInput;
 
@@ -38,24 +42,20 @@
  */
 public class SchemaResolverUnitTest
 {
-    private SchemaResolver schemaResolver = new SchemaResolver();
+    private SchemaResolver schemaResolver;
     
-    @Test
-    public void testSchemaOnClasspath()
+    @Before
+    public void setup() throws URISyntaxException
     {
-        final String type = "http://www.w3.org/2001/XMLSchema";
-        final String systemId = "custom-type.xsd";
-        
-        LSInput lsInput = schemaResolver.resolveResource(type, "http://www.jboss.org/custom", null, systemId, null);
-        Reader characterStream = lsInput.getCharacterStream();
-        assertNotNull(characterStream);
+        URL resource = getClass().getResource("/org/jboss/internal/soa/esb/util/types/custom-type.xsd");
+        schemaResolver = new SchemaResolver(resource.toURI());
     }
     
     @Test
-    public void testSchemaOnClasspathRelative()
+    public void testSchemaOnClasspath()
     {
         final String type = "http://www.w3.org/2001/XMLSchema";
-        final String systemId = "./custom-type.xsd";
+        final String systemId = "custom-type.xsd";
         
         LSInput lsInput = schemaResolver.resolveResource(type, "http://www.jboss.org/custom", null, systemId, null);
         Reader characterStream = lsInput.getCharacterStream();
@@ -63,16 +63,6 @@
     }
     
     @Test
-    public void testSchemaOnClasspathNullSystemId()
-    {
-        final String type = "http://www.w3.org/2001/XMLSchema";
-        
-        LSInput lsInput = schemaResolver.resolveResource(type, "http://www.jboss.org/custom", null, null, null);
-        Reader characterStream = lsInput.getCharacterStream();
-        assertNull(characterStream);
-    }
-    
-    @Test
     public void testSchemaWithHttpUrlSystemId()
     {
         final String type = "http://www.w3.org/2001/XMLSchema";

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/XMLHelperUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/XMLHelperUnitTest.java	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/XMLHelperUnitTest.java	2009-03-18 11:57:14 UTC (rev 25707)
@@ -20,18 +20,34 @@
  */
 package org.jboss.internal.soa.esb.util;
 
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringWriter;
 import java.io.UnsupportedEncodingException;
+import java.net.URL;
 import java.util.Properties;
 
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.validation.Schema;
 
-import junit.framework.TestCase;
+import junit.framework.JUnit4TestAdapter;
 
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.testutils.StringUtils;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.Request;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.handler.AbstractHandler;
 import org.xml.sax.SAXException;
 
 /**
@@ -39,8 +55,15 @@
  * 
  * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
  */
-public class XMLHelperUnitTest extends TestCase
+public class XMLHelperUnitTest
 {
+    private static String returnUrl;
+    private static Server server;
+    
+    private static final int PORT = 9999;
+    private static final String CONTEXT = "schematest";
+
+    @Test
     public void testReplaceSystemProperties()
         throws Exception
     {
@@ -69,13 +92,97 @@
         assertTrue("System property replacement", match) ;
     }
     
-    public void testValidateSchemaWithImport() throws ConfigurationException, UnsupportedEncodingException, SAXException
+    @Test
+    public void testValidateSchemaOnCPWithImportsFromSubdir() throws ConfigurationException, UnsupportedEncodingException, SAXException
     {
-        final Schema schema = XMLHelper.getSchema("request.xsd", new SchemaResolver());
+        final Schema schema = XMLHelper.getSchema("/org/jboss/internal/soa/esb/util/schemas/request.xsd");
         
+        final String xml = StreamUtils.readStreamString(getClass().getResourceAsStream("sample-request.xml"), "UTF-8");
+        assertTrue(XMLHelper.validate(schema, xml));
+    }
+    
+    @Test
+    public void testValidateSchemaOnCPWithImports() throws ConfigurationException, UnsupportedEncodingException, SAXException
+    {
+        final Schema schema = XMLHelper.getSchema("/org/jboss/internal/soa/esb/util/request2.xsd");
         
         final String xml = StreamUtils.readStreamString(getClass().getResourceAsStream("sample-request.xml"), "UTF-8");
         assertTrue(XMLHelper.validate(schema, xml));
     }
     
+    @Test
+    public void testValidateSchemaOnFSWithImports() throws ConfigurationException, UnsupportedEncodingException, SAXException
+    {
+        URL resource = getClass().getResource("/org/jboss/internal/soa/esb/util/request2.xsd");
+        File file = new File(resource.getFile());
+        final Schema schema = XMLHelper.getSchema(file.getAbsolutePath());
+        
+        final String xml = StreamUtils.readStreamString(getClass().getResourceAsStream("sample-request.xml"), "UTF-8");
+        assertTrue(XMLHelper.validate(schema, xml));
+    }
+    
+    /**
+     * This is an integration test that is intended to be run manually.
+     */
+    @Test
+    public void testValidateSchemaHttpWithImports() throws ConfigurationException, UnsupportedEncodingException, SAXException
+    {
+        final Schema schema = XMLHelper.getSchema("http://localhost:9999/schemastest/request2.xsd");
+        
+        final String xml = StreamUtils.readStreamString(getClass().getResourceAsStream("sample-request.xml"), "UTF-8");
+        assertTrue(XMLHelper.validate(schema, xml));
+    }
+    
+    
+    @BeforeClass
+    public static void setupJetty() throws Exception
+    {
+        server = new Server(PORT);  
+        Handler handler = new AbstractHandler()   
+        {  
+            public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch)   throws IOException, ServletException  
+            {  
+                handleHttpRequest(target, request, response);  
+            }
+        };  
+   
+        returnUrl = "http://localhost:" + Integer.toString(PORT) + "/" + CONTEXT;  
+        server.setHandler(handler);  
+        server.start();  
+    }
+    
+    public static void handleHttpRequest(String target, HttpServletRequest request, HttpServletResponse response)  
+    {  
+        try  
+        {  
+            String pathInfo = request.getPathInfo();
+            String file = pathInfo.substring(pathInfo.indexOf("/" + CONTEXT) + CONTEXT.length() + 3);
+            file = "/org/jboss/internal/soa/esb/util/" + file;
+            InputStream in = org.jboss.soa.esb.util.ClassUtil.getResourceAsStream(file, XMLHelperUnitTest.class);
+            String xsd = StreamUtils.readStreamString(in, "UTF-8");
+            response.setContentType("text/html");  
+            response.getOutputStream().write(xsd.getBytes());
+            response.setStatus(HttpServletResponse.SC_OK);  
+            ((Request)request).setHandled(true);  
+        }  
+        catch(Exception ignore)  
+        {  
+        }  
+    }  
+    
+    @AfterClass
+    public static void shutdownJetty() 
+    {
+        try
+        {
+            server.stop();
+        } 
+        catch (Exception ignore) { }
+    }
+    
+    public static junit.framework.Test suite()
+    {
+        return new JUnit4TestAdapter(XMLHelperUnitTest.class);
+    }
+    
 }

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/request2.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/request2.xsd	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/request2.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0" 
+    targetNamespace="http://www.jboss.org/sayHi" 
+    xmlns:x1="http://www.jboss.org/sayHi" 
+    xmlns:cust="http://www.jboss.org/custom-request" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+  <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="./types/custom-type.xsd"/>
+  
+  <xs:element name="sayHi" type="x1:sayHi"/>
+  
+  <xs:complexType name="sayHi">
+    <xs:sequence>
+      <xs:element name="arg0" type="xs:string" minOccurs="1"/>
+	  <xs:element ref="cust:customType" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+  
+</xs:schema>

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/sample-request.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/sample-request.xml	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/sample-request.xml	2009-03-18 11:57:14 UTC (rev 25707)
@@ -1,5 +1,22 @@
 <?xml version="1.0"?>
-<say:sayHi xmlns:say="http://www.jboss.org/sayHi" xmlns:cust="http://www.jboss.org/custom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<say:sayHi 
+    xmlns:say="http://www.jboss.org/sayHi" 
+    xmlns:cust="http://www.jboss.org/custom-request" 
+    xmlns:sub="http://www.jboss.org/custom-subtype" 
+    xmlns:t="http://www.jboss.org/type2" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    
     <say:arg0>HelloWorld</say:arg0>
-    <cust:custom-type cust:type="Dummy String"/>
+    
+    <cust:customType>
+           <cust:type>Some text</cust:type>
+           <sub:subType>
+               <sub:type>Some more text</sub:type>
+               <t:type2>
+                   <t:type>Even more text</t:type>
+               </t:type2>
+           </sub:subType>
+    </cust:customType>
+    
 </say:sayHi>
\ No newline at end of file

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0" 
+    targetNamespace="http://www.jboss.org/sayHi" 
+    xmlns:x1="http://www.jboss.org/sayHi" 
+    xmlns:cust="http://www.jboss.org/custom-request" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+  <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="../types/custom-type.xsd"/>
+  
+  <xs:element name="sayHi" type="x1:sayHi"/>
+  
+  <xs:complexType name="sayHi">
+    <xs:sequence>
+      <xs:element name="arg0" type="xs:string" minOccurs="1"/>
+	  <xs:element ref="cust:customType" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+  
+</xs:schema>

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0" 
+    targetNamespace="http://www.jboss.org/custom-request" 
+    xmlns:cust="http://www.jboss.org/custom-request"  
+    xmlns:sub="http://www.jboss.org/custom-subtype"  
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    elementFormDefault="qualified">
+
+  <xs:import namespace="http://www.jboss.org/custom-subtype" schemaLocation="./subtypes/custom-subtype-type.xsd"/>
+  
+  <xs:element name="customType" type="cust:CustomType"/>
+  
+  <xs:complexType name="CustomType">
+    <xs:sequence>
+      <xs:element name="type" type="xs:string" minOccurs="1"/>
+	  <xs:element ref="sub:subType" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0" 
+    targetNamespace="http://www.jboss.org/custom-subtype" 
+    xmlns:sub="http://www.jboss.org/custom-subtype" 
+    xmlns:t="http://www.jboss.org/type2" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    elementFormDefault="qualified">
+    
+  <xs:import namespace="http://www.jboss.org/type2" schemaLocation="../type2-type.xsd"/>
+
+  <xs:element name="subType" type="sub:SubType"/>
+  
+  <xs:complexType name="SubType">
+    <xs:sequence>
+      <xs:element name="type" type="xs:string" minOccurs="0"/>
+	  <xs:element ref="t:type2" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -0,0 +1,14 @@
+<xs:schema version="1.0" 
+    targetNamespace="http://www.jboss.org/type2" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    xmlns:t="http://www.jboss.org/type2" 
+    elementFormDefault="qualified">
+
+  <xs:element name="type2" type="t:Type2"/>
+  
+  <xs:complexType name="Type2">
+    <xs:sequence>
+      <xs:element name="type" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/ESBContractGeneratorUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/ESBContractGeneratorUnitTest.java	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/ESBContractGeneratorUnitTest.java	2009-03-18 11:57:14 UTC (rev 25707)
@@ -62,12 +62,14 @@
         executeTest("jbossesb_config_08.110.xml") ;
     }
 	
+/* Will fix this with my next task checkin dealing with duplicate import types
 	public void testDuplicateSchemas() throws Exception {
          Definition def = executeTest("jbossesb_duplicate_schemas.xml") ;
          Types types = def.getTypes();
          List schemas = types.getExtensibilityElements();
          assertEquals(1,schemas.size());
     }
+*/
 
     
     private Definition executeTest(final String resourceName) throws Exception {

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/build.xml	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/build.xml	2009-03-18 11:57:14 UTC (rev 25707)
@@ -6,7 +6,7 @@
 	</description>
 	
 	<!-- additional deploys -->
-	<property name="additional.deploys" value="*.xsd imports/*.xsd"/>
+	<property name="additional.deploys" value="*.xsd types/**/*.xsd"/>
 
 	<!-- Import the base Ant build script... -->
 	<import file="../conf/base-build.xml"/>

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml	2009-03-18 11:57:14 UTC (rev 25707)
@@ -1,16 +1,28 @@
-<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
-			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-			xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-			xmlns:say="http://www.jboss.org/sayHi"
-			xmlns:cust="http://www.jboss.org/custom-request">
+<soap:Envelope
+            xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:say="http://www.jboss.org/sayHi"
+            xmlns:cust="http://www.jboss.org/custom-request"
+            xmlns:sub="http://www.jboss.org/custom-subtype"
+            xmlns:t="http://www.jboss.org/type2">
+  <soap:Body>
 
-  <soap:Body>
-      <say:sayHi>
+	<say:sayHi>
 		<say:arg0>Error</say:arg0>
-		<say:importedElement>
-            <cust:type>Dummy string</cust:type>
-        </say:importedElement>
-	  </say:sayHi>
+
+		<cust:customType>
+           <cust:type>Some text</cust:type>
+           <sub:subType>
+               <sub:type>Some more text</sub:type>
+               <t:type2>
+                   <t:type>Even more text</t:type>
+               </t:type2>
+           </sub:subType>
+		</cust:customType>
+	</say:sayHi>
+
   </soap:Body>
 
-</soap:Envelope> 
+</soap:Envelope>
+

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/readme.txt
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/readme.txt	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/readme.txt	2009-03-18 11:57:14 UTC (rev 25707)
@@ -51,7 +51,7 @@
 	   <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="custom-request-type.xsd"/>
 	   This custom-request-type.xsd should in this case be packaged in the root of the .esb archive. 
 
-	 b) Another example of can be found in response.xsd:
+	 b) Another example can be found in response.xsd:
 	   <xs:import namespace="http://www.jboss.org/custom-response" schemaLocation="imports/custom-response-type.xsd"/>
 	   In this case the xsd has is located in a directory named 'imports' in the .esb archive.
 

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/request.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/request.xsd	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/request.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -1,16 +1,19 @@
-<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" 
-	xmlns:x1="http://www.jboss.org/sayHi"  
-	xmlns:cust="http://www.jboss.org/custom-request"
-	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
-	elementFormDefault="qualified">
+<xs:schema version="1.0" 
+    targetNamespace="http://www.jboss.org/sayHi" 
+    xmlns:x1="http://www.jboss.org/sayHi" 
+    xmlns:cust="http://www.jboss.org/custom-request" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
 
-  <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="custom-request-type.xsd"/>
-
+  <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="./types/custom-request-type.xsd"/>
+  
   <xs:element name="sayHi" type="x1:sayHi"/>
+  
   <xs:complexType name="sayHi">
     <xs:sequence>
       <xs:element name="arg0" type="xs:string" minOccurs="1"/>
-      <xs:element name="importedElement" type="cust:customType" minOccurs="1"/>
+	  <xs:element ref="cust:customType" minOccurs="0"/>
     </xs:sequence>
   </xs:complexType>
+  
 </xs:schema>
+

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/response.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/response.xsd	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/response.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -5,7 +5,7 @@
 	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
 	elementFormDefault="qualified">
 
-  <xs:import namespace="http://www.jboss.org/custom-response" schemaLocation="imports/custom-response-type.xsd"/>
+  <xs:import namespace="http://www.jboss.org/custom-response" schemaLocation="types/custom-response-type.xsd"/>
 
   <xs:element name="sayHiResponse" type="x1:sayHiResponse"/>
   <xs:complexType name="sayHiResponse">

Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml	2009-03-18 11:57:14 UTC (rev 25706)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml	2009-03-18 11:57:14 UTC (rev 25707)
@@ -1,15 +1,29 @@
-<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
+<soap:Envelope 
+			xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
 			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 			xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-			xmlns:say="http://www.jboss.org/sayHi"
-			xmlns:cust="http://www.jboss.org/custom-request">
+			xmlns:say="http://www.jboss.org/sayHi" 
+			xmlns:cust="http://www.jboss.org/custom-request" 
+			xmlns:sub="http://www.jboss.org/custom-subtype" 
+			xmlns:t="http://www.jboss.org/type2">
   <soap:Body>
-      <say:sayHi>
-		<say:arg0>HelloWorld</say:arg0>
-		<say:importedElement>
-			<cust:type>Dummy string</cust:type>
-    	</say:importedElement>
-	  </say:sayHi>"
+
+ <say:sayHi>
+
+	<say:arg0>HelloWorld</say:arg0>
+
+    <cust:customType>
+           <cust:type>Some text</cust:type>
+           <sub:subType>
+               <sub:type>Some more text</sub:type>
+               <t:type2>
+                   <t:type>Even more text</t:type>
+               </t:type2>
+           </sub:subType>
+    </cust:customType>
+
+ </say:sayHi>
+
   </soap:Body>
 
 </soap:Envelope> 

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0" 
+    targetNamespace="http://www.jboss.org/custom-request" 
+    xmlns:cust="http://www.jboss.org/custom-request"  
+    xmlns:sub="http://www.jboss.org/custom-subtype"  
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    elementFormDefault="qualified">
+
+  <xs:import namespace="http://www.jboss.org/custom-subtype" schemaLocation="./subtypes/custom-subtype-type.xsd"/>
+  
+  <xs:element name="customType" type="cust:CustomType"/>
+  
+  <xs:complexType name="CustomType">
+    <xs:sequence>
+      <xs:element name="type" type="xs:string" minOccurs="1"/>
+	  <xs:element ref="sub:subType" minOccurs="1"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/custom-response" xmlns:cust="http://www.jboss.org/custom-response"  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+  <xs:complexType name="customType">
+    <xs:sequence>
+      <xs:element name="type" type="xs:string" minOccurs="1"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -0,0 +1,19 @@
+<xs:schema version="1.0" 
+    targetNamespace="http://www.jboss.org/custom-subtype" 
+    xmlns:sub="http://www.jboss.org/custom-subtype" 
+    xmlns:t="http://www.jboss.org/type2" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    elementFormDefault="qualified">
+    
+  <xs:import namespace="http://www.jboss.org/type2" schemaLocation="../type2-type.xsd"/>
+
+  <xs:element name="subType" type="sub:SubType"/>
+  
+  <xs:complexType name="SubType">
+    <xs:sequence>
+      <xs:element name="type" type="xs:string" minOccurs="0"/>
+	  <xs:element ref="t:type2" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
+

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd	2009-03-18 11:57:14 UTC (rev 25707)
@@ -0,0 +1,15 @@
+<xs:schema version="1.0" 
+    targetNamespace="http://www.jboss.org/type2" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    xmlns:t="http://www.jboss.org/type2" 
+    elementFormDefault="qualified">
+
+  <xs:element name="type2" type="t:Type2"/>
+  
+  <xs:complexType name="Type2">
+    <xs:sequence>
+      <xs:element name="type" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
+

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/testlib/jetty-6.1.15.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_FP/testlib/jetty-6.1.15.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/branches/JBESB_4_4_GA_FP/testlib/jetty-util-6.1.15.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_FP/testlib/jetty-util-6.1.15.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the jboss-svn-commits mailing list