Index: modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java	(revision 16471)
+++ modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java	(working copy)
@@ -26,6 +26,9 @@
 import java.io.PrintStream;
 import java.io.Writer;
 import java.net.URL;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.math.BigInteger;
 
 import javax.jws.HandlerChain;
 import javax.jws.WebService;
@@ -398,10 +401,11 @@
       }
    }
 
-   private void writeWsdl(ServiceMetaData serviceMetaData, WSDLDefinitions wsdlDefinitions, EndpointMetaData epMetaData) throws IOException
+   private void writeWsdl(final ServiceMetaData serviceMetaData, WSDLDefinitions wsdlDefinitions, EndpointMetaData epMetaData) throws IOException
    {
       // The RI uses upper case, and the TCK expects it, so we just mimic this even though we don't really have to
       String wsdlName = ToolsUtils.firstLetterUpperCase(serviceMetaData.getServiceName().getLocalPart());
+
       // Ensure that types are only in the interface qname
       wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getPortTypeName().getNamespaceURI());
 
@@ -415,8 +419,7 @@
       else
       {
          dir = IOUtils.createTempDirectory();
-         wsdlFile = File.createTempFile(wsdlName, ".wsdl", dir);
-         wsdlFile.deleteOnExit();
+         wsdlFile = computeTempWsdlFile(serviceMetaData, dir, wsdlName);
       }
 
       message(wsdlFile.getName());
@@ -431,8 +434,7 @@
             }
             else
             {
-               file = File.createTempFile(suggestedFile, ".wsdl", dir);
-               file.deleteOnExit();
+               file = computeTempWsdlFile(serviceMetaData, dir, suggestedFile);
             }
             actualFile = file.getName();
             message(actualFile);
@@ -446,6 +448,35 @@
       serviceMetaData.setWsdlLocation(wsdlFile.toURL());
    }
 
+   private File computeTempWsdlFile(ServiceMetaData serviceMetaData, File dir, String wsdlName) throws IOException
+   {
+     File wsdlFile = null;
+     try
+     {
+        byte[] deploymentName = serviceMetaData.getUnifiedMetaData().getDeploymentName().getBytes("UTF-8");
+        String deploymentNameHash = toHexString(MessageDigest.getInstance("MD5").digest(deploymentName));
+        wsdlFile = new File(dir + File.separator + wsdlName + "_" + deploymentNameHash + ".wsdl");
+     }
+     catch(NoSuchAlgorithmException ex)
+     {
+        if(log.isTraceEnabled())
+          log.trace("MD5 has of deployment name failed for WSDL file name.  Falling back to File.createTempFile()", ex);
+        else
+          log.debug("MD5 has of deployment name failed for WSDL file name.  Falling back to File.createTempFile()");
+
+        wsdlFile = File.createTempFile(wsdlName, ".wsdl", dir);
+     }
+
+     wsdlFile.deleteOnExit();
+     return wsdlFile;
+   }
+
+   private String toHexString(byte[] hash)
+   {
+      BigInteger bi = new BigInteger(1, hash);
+      return String.format("%0" + (hash.length << 1) + "x", bi);
+   }
+
    private void message(String msg)
    {
       if (messageStream != null)
Index: modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
===================================================================
--- modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java	(revision 16471)
+++ modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java	(working copy)
@@ -27,6 +27,11 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.math.BigInteger;
 
 import javax.xml.namespace.QName;
 
@@ -508,7 +513,7 @@
 
    /** Get the temp file for a given namespace
     */
-   public static File getSchemaTempFile(String targetNS) throws IOException
+   public static File getSchemaTempFile(String targetNS, String fileName) throws IOException
    {
       if (targetNS.length() == 0)
          throw new IllegalArgumentException("Invalid null target namespace");
@@ -521,7 +526,8 @@
       try
       {
          SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-         ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();File tmpDir = serverConfig.getServerTempDir();
+         ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+         File tmpDir = serverConfig.getServerTempDir();
          tmpdir = serverConfig.getServerTempDir();
          tmpdir = new File(tmpdir.getCanonicalPath() + "/jbossws");
          tmpdir.mkdirs();
@@ -537,9 +543,35 @@
       fname = fname.replace('?', '_');
       fname = fname.replace('#', '_');
       
-      return File.createTempFile("JBossWS_" + fname, ".xsd", tmpdir);
+      File file = null;
+      try
+      {
+         String fileNameHash = toHexString(MessageDigest.getInstance("MD5").digest(fileName.getBytes("UTF-8")));
+         if(tmpdir == null)
+         {
+            tmpdir = (File) AccessController.doPrivileged(new PrivilegedAction() {
+               public Object run()
+               {
+                  return new File(System.getProperty("java.io.tmpdir"));
+               }
+            });
+         }
+         file = new File(tmpdir + File.separator + "JBossWS_" + fname + "_" + fileNameHash + ".xsd");
+      }
+      catch(NoSuchAlgorithmException noAlgEx)
+      {
+        file = File.createTempFile("JBossWS_" + fname, ".xsd", tmpdir);
+      }
+
+      return file;
    }
 
+   private static String toHexString(byte[] hash)
+   {
+      BigInteger bi = new BigInteger(1, hash);
+      return String.format("%0" + (hash.length << 1) + "x", bi);
+   }
+
    /**
     * Get the TargetNamespace from the schema model
     */
Index: modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java	(revision 16471)
+++ modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java	(working copy)
@@ -544,14 +544,14 @@
       {
          log.trace("processSchemaInclude: [targetNS=" + targetNS + ",parentURL=" + wsdlLoc + "]");
 
-         tmpFile = SchemaUtils.getSchemaTempFile(targetNS);
+         tmpFile = SchemaUtils.getSchemaTempFile(targetNS, getFileName(wsdlLoc));
          tempFiles.add(tmpFile);
 
          publishedLocations.put(wsdlLoc, tmpFile.toURL());
       }
       else
       {
-         tmpFile = SchemaUtils.getSchemaTempFile("no_namespace");
+         tmpFile = SchemaUtils.getSchemaTempFile("no_namespace", getFileName(wsdlLoc));
          tempFiles.add(tmpFile);
 
          publishedLocations.put(wsdlLoc, tmpFile.toURL());
@@ -600,6 +600,22 @@
       handleSchemaImports(schemaEl, wsdlLoc);
    }
 
+   private String getFileName(URL url)
+   {
+      String query = url.getQuery();
+      if(query != null)
+      {
+         if(query.contains("="))
+         {
+           return query.split("=")[1];
+         }
+      }
+
+      String exUrl = url.toExternalForm();
+      String[] paths = exUrl.split("/");
+      return paths[paths.length-1];
+   }
+
    private void handleSchemaImports(Element schemaEl, URL parentURL) throws WSDLException, IOException
    {
       if (parentURL == null)
Index: modules/testsuite/pom.xml
===================================================================
--- modules/testsuite/pom.xml	(revision 16471)
+++ modules/testsuite/pom.xml	(working copy)
@@ -1,10 +1,9 @@
+<?xml version="1.0"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
-
   <name>JBoss Web Services - Stack Native Testsuite</name>
   <artifactId>jbossws-native-testsuite</artifactId>
   <packaging>pom</packaging>
-
   <!-- Parent -->
   <parent>
     <groupId>org.jboss.ws.native</groupId>
@@ -12,7 +11,6 @@
     <version>3.1.2-SNAPSHOT</version>
     <relativePath>../../pom.xml</relativePath>
   </parent>
-
   <!-- Properties -->
   <properties>
     <surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/etc/tst.policy</surefire.security.args>
@@ -27,13 +25,11 @@
     <jboss.javaee.version>5.0.1.GA</jboss.javaee.version>
     <hornetq.version>2.2.2.Final</hornetq.version>
   </properties>
-
   <!-- Modules -->
   <modules>
     <module>native-tests</module>
     <module>framework-tests</module>
   </modules>
-
   <!-- Dependencies -->
   <dependencies>
     <dependency>
@@ -49,6 +45,7 @@
       <artifactId>jbossws-native-client</artifactId>
       <version>${version}</version>
     </dependency>
+    <!--
     <dependency>
       <groupId>com.sun</groupId>
       <artifactId>tools</artifactId>
@@ -56,6 +53,7 @@
       <scope>system</scope>
       <systemPath>${java.home}/../lib/tools.jar</systemPath>
     </dependency>
+    -->
     <dependency>
       <groupId>javax.ejb</groupId>
       <artifactId>ejb-api</artifactId>
@@ -103,7 +101,6 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-
   <!-- Build -->
   <build>
     <testResources>
@@ -240,10 +237,8 @@
       </plugin>
     </plugins>
   </build>
-
   <!-- Profiles -->
   <profiles>
-
     <!--
     Name:  debug
     Descr: Enable remote debuging for tests
@@ -270,7 +265,6 @@
         <surefire.jvm.args>${surefire.security.args} ${surefire.gc.args}</surefire.jvm.args>
       </properties>
     </profile>
-
     <!--
     Name:  hudson
     Descr: Ignore test failures on hudson
@@ -288,7 +282,6 @@
         </plugins>
       </build>
     </profile>
-
     <!--
     Name:  jboss510
     Descr: JBoss-5.1.0 specific options
@@ -355,10 +348,8 @@
               <excludes>
                 <!--# UsernameTokenHTTPSTestCase requires keystore & trustore in jboss-web tomcat configuration -->
                 <exclude>org/jboss/test/ws/interop/nov2007/wsse/UsernameTokenHTTPSTestCase.*</exclude>
-
                 <!--# [EJBTHREE-1152] service-ref in ejb-jar.xml is ignored -->
                 <exclude>org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.*</exclude>
-
                 <!--# [JBWS-2217] Fix BPEL jaxrpc samples -->
                 <exclude>org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/*TestCase.*</exclude>
               </excludes>
@@ -367,7 +358,6 @@
         </plugins>
       </build>
     </profile>
-
     <!--
     Name:  no-jboss-bind-address
     Descr: Set the default jboss.bind.address
@@ -386,8 +376,7 @@
         <jboss.bind.address>localhost</jboss.bind.address>
       </properties>
     </profile>
-
-  <!--
+    <!--
     Name:  no-jboss-server-instance
     Descr: Set the default jboss.server.instance
 
@@ -405,8 +394,7 @@
         <jboss.server.instance>default</jboss.server.instance>
       </properties>
     </profile>
-
-  <!--
+    <!--
     Name:  no-use-hornetq
     Descr: Set the default use.hornetq
 
@@ -425,5 +413,4 @@
       </properties>
     </profile>
   </profiles>
-
 </project>
Index: pom.xml
===================================================================
--- pom.xml	(revision 16471)
+++ pom.xml	(working copy)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!-- ====================================================================== -->
 <!--                                                                        -->
 <!--  JBoss, the OpenSource J2EE webOS                                      -->
@@ -8,31 +7,25 @@
 <!--  See terms of license at http://www.gnu.org.                           -->
 <!--                                                                        -->
 <!-- ====================================================================== -->
-
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
-
   <name>JBoss Web Services - Stack Native</name>
   <groupId>org.jboss.ws.native</groupId>
   <artifactId>jbossws-native</artifactId>
   <packaging>pom</packaging>
-
   <version>3.1.2-SNAPSHOT</version>
-
   <!-- Parent -->
   <parent>
     <groupId>org.jboss.ws</groupId>
     <artifactId>jbossws-parent</artifactId>
     <version>1.0.8.SP1</version>
   </parent>
-
   <!-- Source Control Management -->
   <scm>
     <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossws/stack/native/branches/jbossws-native-3.1.2</connection>
     <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossws/stack/native/branches/jbossws-native-3.1.2</developerConnection>
     <url>http://fisheye.jboss.com/viewrep/JBossWS/stack/native/branches/jbossws-native-3.1.2</url>
   </scm>
-
   <!-- Modules -->
   <modules>
     <module>modules/endorsed</module>
@@ -41,12 +34,11 @@
     <module>modules/management</module>
     <module>modules/resources</module>
   </modules>
-
   <!-- Properties -->
   <properties>
-    <jbossws.common.version>1.1.0.SP9</jbossws.common.version>
-    <jbossws.framework.version>3.1.2.SP11</jbossws.framework.version>
-    <jbossws.spi.version>1.1.2.SP8</jbossws.spi.version>
+    <jbossws.common.version>1.1.0-SNAPSHOT</jbossws.common.version>
+    <jbossws.framework.version>3.1.2-SNAPSHOT</jbossws.framework.version>
+    <jbossws.spi.version>1.1.2-SNAPSHOT</jbossws.spi.version>
     <!-- [JBWS-2505] -->
     <!-- START -->
     <!--
@@ -77,7 +69,6 @@
     <xalan.version>2.7.1.patch02</xalan.version>
     <xerces.version>2.9.1</xerces.version>
   </properties>
-
   <!-- DependencyManagement -->
   <dependencyManagement>
     <dependencies>
@@ -273,40 +264,40 @@
         <type>sar</type>
         <exclusions>
           <exclusion>
-             <groupId>jboss</groupId>
-             <artifactId>jboss-jmx</artifactId>
+            <groupId>jboss</groupId>
+            <artifactId>jboss-jmx</artifactId>
           </exclusion>
           <exclusion>
-             <groupId>jboss</groupId>
-             <artifactId>jboss-system-jmx</artifactId>
+            <groupId>jboss</groupId>
+            <artifactId>jboss-system-jmx</artifactId>
           </exclusion>
           <exclusion>
-             <groupId>jboss</groupId>
-             <artifactId>jboss-common</artifactId>
+            <groupId>jboss</groupId>
+            <artifactId>jboss-common</artifactId>
           </exclusion>
           <exclusion>
-             <groupId>jboss</groupId>
-             <artifactId>jboss-j2ee</artifactId>
+            <groupId>jboss</groupId>
+            <artifactId>jboss-j2ee</artifactId>
           </exclusion>
           <exclusion>
-             <groupId>jboss</groupId>
-             <artifactId>jboss-j2se</artifactId>
+            <groupId>jboss</groupId>
+            <artifactId>jboss-j2se</artifactId>
           </exclusion>
           <exclusion>
-             <groupId>jboss</groupId>
-             <artifactId>jboss-system</artifactId>
+            <groupId>jboss</groupId>
+            <artifactId>jboss-system</artifactId>
           </exclusion>
           <exclusion>
-             <groupId>org.jboss.microcontainer</groupId>
-             <artifactId>jboss-microcontainer</artifactId>
+            <groupId>org.jboss.microcontainer</groupId>
+            <artifactId>jboss-microcontainer</artifactId>
           </exclusion>
           <exclusion>
-             <groupId>jboss.jbossws</groupId>
-             <artifactId>jboss-jaxrpc</artifactId>
+            <groupId>jboss.jbossws</groupId>
+            <artifactId>jboss-jaxrpc</artifactId>
           </exclusion>
           <exclusion>
-             <groupId>jboss.jbossws</groupId>
-             <artifactId>jboss-saaj</artifactId>
+            <groupId>jboss.jbossws</groupId>
+            <artifactId>jboss-saaj</artifactId>
           </exclusion>
           <!-- 
           <exclusion>
@@ -367,7 +358,6 @@
       </dependency>
     </dependencies>
   </dependencyManagement>
-
   <!-- Plugins -->
   <build>
     <plugins>
@@ -375,9 +365,9 @@
         <artifactId>maven-resources-plugin</artifactId>
         <version>2.4</version>
         <configuration>
-           <escapeWindowsPaths>false</escapeWindowsPaths>
-        </configuration>      
-     </plugin>
+          <escapeWindowsPaths>false</escapeWindowsPaths>
+        </configuration>
+      </plugin>
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>
@@ -389,10 +379,10 @@
             </goals>
             <configuration>
               <tasks>
-                <echo />
-                <echo message="profile=${jbossws.integration.target}" />
-                <echo message="jboss.home=${jboss.home}" />
-                <echo />
+                <echo/>
+                <echo message="profile=${jbossws.integration.target}"/>
+                <echo message="jboss.home=${jboss.home}"/>
+                <echo/>
               </tasks>
             </configuration>
           </execution>
@@ -432,7 +422,6 @@
       </plugin>
     </plugins>
   </build>
-
   <!-- Repositories -->
   <repositories>
     <repository>
@@ -450,10 +439,8 @@
       </snapshots>
     </repository>
   </repositories>
-  
   <!-- Profiles -->
   <profiles>
-
     <!--
     Name:  bindist
     Descr: Build the binary distribution
@@ -476,7 +463,6 @@
         </plugins>
       </build>
     </profile>
-
     <!--
     Name:  srcdist
     Descr: Build the source distribution
@@ -499,7 +485,6 @@
         </plugins>
       </build>
     </profile>
-
     <!--
     Name:  jboss510
     Descr: JBoss-5.1.0 specific options
@@ -511,7 +496,6 @@
         <jboss.home>${jboss510.home}</jboss.home>
       </properties>
     </profile>
-
     <!--
     Name:  jdk16
     Descr: Compile with jdk1.6
@@ -534,7 +518,6 @@
         </plugins>
       </build>
     </profile>
-
     <!--
     Name:  smoketest
     Descr: Executes the smoke tests
@@ -557,7 +540,6 @@
         </plugins>
       </build>
     </profile>
-
     <!--
     Name:  testsuite
     Descr: Executes the testsuite
@@ -569,5 +551,4 @@
       </modules>
     </profile>
   </profiles>
-
 </project>
