Author: mageshbk(a)jboss.com
Date: 2008-02-22 00:42:14 -0500 (Fri, 22 Feb 2008)
New Revision: 5761
Modified:
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
Log:
[JBWS-1969] Cannot publish wsdl with imported schema files, using bottom up approach
Modified:
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2008-02-21
15:40:58 UTC (rev 5760)
+++
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2008-02-22
05:42:14 UTC (rev 5761)
@@ -60,6 +60,7 @@
/** A helper class that publishes the wsdl files and their imports to the
server/data/wsdl directory.
*
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
* @author Thomas.Diesler(a)jboss.org
* @since 02-June-2004
*/
@@ -181,8 +182,7 @@
wsdlWriter.writeWSDL(subdef, fw);
fw.close();
- if (log.isDebugEnabled())
- log.debug("WSDL import published to: " + targetURL);
+ log.debug("WSDL import published to: " + targetURL);
// recursively publish imports
publishWsdlImports(targetURL, subdef, published);
@@ -228,12 +228,11 @@
String deploymentName = dep.getCanonicalName();
- // get the resource path
- int index = baseURI.indexOf(deploymentName);
+ // get the resource path including the separator
+ int index = baseURI.indexOf(deploymentName) + 1;
String resourcePath = baseURI.substring(index +
deploymentName.length());
- resourcePath = resourcePath.substring(0,
resourcePath.lastIndexOf("/"));
- if (resourcePath.length() > 0)
- resourcePath = resourcePath + "/";
+ //check for sub-directories
+ resourcePath = resourcePath.substring(0,
resourcePath.lastIndexOf("/") + 1);
resourcePath = expLocation + resourcePath + schemaLocation;
URL resourceURL = dep.getMetaDataFileURL(resourcePath);
@@ -246,8 +245,7 @@
fos.close();
is.close();
- if (log.isDebugEnabled())
- log.debug("XMLSchema import published to: " + xsdURL);
+ log.debug("XMLSchema import published to: " + xsdURL);
// recursivly publish imports
Element subdoc = DOMUtils.parse(xsdURL.openStream());
@@ -312,8 +310,7 @@
if (wsdlLocation == null)
throw new IllegalStateException("Cannot obtain wsdl location for: " +
serviceMetaData.getServiceName());
- if (log.isDebugEnabled())
- log.debug("Publish WSDL file: " + wsdlLocation);
+ log.debug("Publish WSDL file: " + wsdlLocation);
// Only file URLs are supported in <wsdl-publish-location>
String publishLocation = serviceMetaData.getWsdlPublishLocation();
@@ -322,6 +319,9 @@
File locationFile = null;
if (predefinedLocation == false)
{
+ System.out.println("serverConfig -> "+ serverConfig);
+ System.out.println("serverConfig.getServerDataDir() -> "+
serverConfig.getServerDataDir());
+ System.out.println("serverConfig.getServerDataDir().getCanonicalPath()
-> "+ serverConfig.getServerDataDir().getCanonicalPath());
locationFile = new File(serverConfig.getServerDataDir().getCanonicalPath() +
"/wsdl/" + archiveName);
}
else
Show replies by date