Author: thomas.diesler(a)jboss.com
Date: 2006-12-12 07:23:36 -0500 (Tue, 12 Dec 2006)
New Revision: 1630
Added:
trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java
trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
Removed:
trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
Modified:
trunk/src/ant/build-release.xml
trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
trunk/src/test/ant/build-jars-jaxws.xml
trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/JSEBean.java
Log:
[JBCTS-422] Nested war deployments using wsdlLocation fail
Modified: trunk/src/ant/build-release.xml
===================================================================
--- trunk/src/ant/build-release.xml 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/ant/build-release.xml 2006-12-12 12:23:36 UTC (rev 1630)
@@ -43,6 +43,7 @@
<copy todir="${jbossws.dir}/lib" overwrite="true">
<fileset dir="${build.lib.dir}">
<include name="jbossws.sar"/>
+ <include name="jbossws.deployer"/>
<include name="jbossws-client.jar"/>
<include name="jbossws-jboss-integration.jar"/>
<include name="jbossws-tomcat-integration.jar"/>
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-12 08:28:24 UTC
(rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-12 12:23:36 UTC
(rev 1630)
@@ -611,7 +611,7 @@
private void generateOrUpdateSchemas(OperationMetaData opMetaData)
{
ServiceMetaData serviceMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData();
- if (serviceMetaData.getWsdlFile() == null)
+ if (serviceMetaData.getWsdlLocation() == null)
{
TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
for (ParameterMetaData paramMetaData : opMetaData.getParameters())
Deleted: trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12
08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.server;
-
-// $Id$
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedDeploymentInfo
-{
- public enum DeploymentType
- {
- JAXRPC_Client, JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_EJB3, JAXWS_JSE, JAXWS_EJB21,
JAXWS_EJB3
- };
-
- public UnifiedDeploymentInfo(DeploymentType type)
- {
- this.type = type;
- }
-
- /** The type of this deployment */
- public DeploymentType type;
- /** Sub deployments have a parent */
- public UnifiedDeploymentInfo parent;
- /** The suffix of the deployment url */
- public String shortName;
- /** The URL identifing this deployment **/
- public URL url;
- /** The URL to the expanded webapp **/
- public URL expandedWebApp;
- /** We can hold "typed" metadata */
- public Object metaData;
- /** The deployment classloader **/
- public ClassLoader classLoader;
- /** An arbitrary map of state associated with the deployment */
- public Map<String, Object> context = new HashMap<String, Object>();
-
- /** The sortName concatenated with the canonical names of all parents. */
- public String getCanonicalName()
- {
- String name = shortName;
- if (parent != null)
- name = parent.getCanonicalName() + "/" + name;
- return name;
- }
-
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("[");
- builder.append("type=" + type);
- builder.append(",shortName=" + shortName);
- builder.append(",url=" + url);
- builder.append("]");
- return builder.toString();
- }
-}
Added: trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12
08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.server;
+
+// $Id$
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedDeploymentInfo
+{
+ public enum DeploymentType
+ {
+ JAXRPC_Client, JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_EJB3, JAXWS_JSE, JAXWS_EJB21,
JAXWS_EJB3
+ };
+
+ public UnifiedDeploymentInfo(DeploymentType type)
+ {
+ this.type = type;
+ }
+
+ /** The type of this deployment */
+ public DeploymentType type;
+ /** Sub deployments have a parent */
+ public UnifiedDeploymentInfo parent;
+ /** The suffix of the deployment url */
+ public String shortName;
+ /** The URL identifing this deployment **/
+ public URL url;
+ /** The URL to the expanded webapp **/
+ public URL expandedWebApp;
+ /** We can hold "typed" metadata */
+ public Object metaData;
+ /** The deployment classloader **/
+ public ClassLoader classLoader;
+ /** An arbitrary map of state associated with the deployment */
+ public Map<String, Object> context = new HashMap<String, Object>();
+
+ /** The sortName concatenated with the canonical names of all parents. */
+ public String getCanonicalName()
+ {
+ String name = shortName;
+ if (parent != null)
+ name = parent.getCanonicalName() + "/" + name;
+ return name;
+ }
+
+ public URL getMetaDataFile(String resource) throws IOException
+ {
+ URL targetURL = null;
+ if (resource != null && resource.length() > 0)
+ {
+ if (resource.startsWith("/"))
+ resource = resource.substring(1);
+
+ try
+ {
+ // assign an absolute URL
+ targetURL = new URL(resource);
+ }
+ catch (MalformedURLException ex)
+ {
+ // assign a relative URL
+ String depPath = url.toExternalForm();
+ if (depPath.startsWith("jar:"))
+ {
+ if(depPath.endsWith("!/") == false)
+ depPath += "!/";
+ }
+
+ if(depPath.endsWith("/") == false)
+ depPath += "/";
+
+ targetURL = new URL(depPath + resource);
+ }
+ }
+ return targetURL;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("[");
+ builder.append("type=" + type);
+ builder.append(",shortName=" + shortName);
+ builder.append(",url=" + url);
+ builder.append("]");
+ return builder.toString();
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-12
08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -87,10 +87,10 @@
// For each service
for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
{
- String wsdlFile = serviceMetaData.getWsdlFile();
- log.debug("Publish WSDL file: " + wsdlFile);
+ String wsdlPath = serviceMetaData.getWsdlLocation().toExternalForm();
+ log.debug("Publish WSDL file: " + wsdlPath);
- if (wsdlFile != null)
+ if (wsdlPath != null)
{
File targetFile = getPublishLocation(deploymentName, serviceMetaData);
targetFile.getParentFile().mkdirs();
@@ -108,13 +108,13 @@
// delete wsdl temp file
ServerConfigFactory factory = ServerConfigFactory.getInstance();
ServerConfig config = factory.getServerConfig();
- if
(wsdlFile.startsWith(config.getServerTempDir().toURL().toExternalForm()))
+ if
(wsdlPath.startsWith(config.getServerTempDir().toURL().toExternalForm()))
{
- new File(wsdlFile).delete();
+ new File(wsdlPath).delete();
}
// udpate the wsdl file location
- serviceMetaData.setWsdlFile(wsdlPublishURL.toExternalForm());
+ serviceMetaData.setWsdlLocation(wsdlPublishURL);
// Process the wsdl imports
Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
@@ -301,27 +301,23 @@
}
}
- // make sure we don't have a leadig '/'
- String wsdlFile = serviceMetaData.getWsdlFile();
- if (wsdlFile.startsWith("/"))
- wsdlFile = wsdlFile.substring(1);
-
- File wsdlLocation;
- if (wsdlFile.startsWith(expLocation))
+ File wsdlFile;
+ String wsdlLocation = serviceMetaData.getWsdlLocation().toExternalForm();
+ if (wsdlLocation.startsWith(expLocation))
{
- wsdlFile = wsdlFile.substring(expLocation.length());
- wsdlLocation = new File(locationFile + "/" + wsdlFile);
+ wsdlLocation = wsdlLocation.substring(expLocation.length());
+ wsdlFile = new File(locationFile + "/" + wsdlLocation);
}
- else if (wsdlFile.startsWith("file:/"))
+ else if (wsdlLocation.startsWith("file:") ||
wsdlLocation.startsWith("jar:"))
{
- wsdlFile = wsdlFile.substring(wsdlFile.lastIndexOf("/") + 1);
- wsdlLocation = new File(locationFile + "/" + wsdlFile);
+ wsdlLocation = wsdlLocation.substring(wsdlLocation.lastIndexOf("/") +
1);
+ wsdlFile = new File(locationFile + "/" + wsdlLocation);
}
else
{
- throw new WSException("Invalid wsdlFile '" + wsdlFile +
"', expected in: " + expLocation);
+ throw new WSException("Invalid wsdlFile '" + wsdlLocation +
"', expected in: " + expLocation);
}
- return wsdlLocation;
+ return wsdlFile;
}
}
Modified: trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2006-12-12
08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -70,26 +70,22 @@
*/
public Document getDocumentForPath(URL reqURL, String wsdlHost, String resPath) throws
IOException
{
- String wsdlLocation = epMetaData.getServiceMetaData().getWsdlFile();
- if (wsdlLocation == null)
- throw new IllegalStateException("Cannot obtain wsdlFile from endpoint meta
data");
-
Document wsdlDoc;
// The WSDLFilePublisher should set the location to an URL
- URL wsdlURL = new URL(wsdlLocation);
+ URL wsdlLocation = epMetaData.getServiceMetaData().getWsdlLocation();
// get the root wsdl
if (resPath == null)
{
- Element wsdlElement = DOMUtils.parse(wsdlURL.openStream());
+ Element wsdlElement = DOMUtils.parse(wsdlLocation.openStream());
wsdlDoc = wsdlElement.getOwnerDocument();
}
// get some imported resource
else
{
- String impResourcePath = new File(wsdlURL.getPath()).getParent() +
File.separatorChar + resPath;
+ String impResourcePath = new File(wsdlLocation.getPath()).getParent() +
File.separatorChar + resPath;
File impResourceFile = new File(impResourcePath);
Element wsdlElement = DOMUtils.parse(impResourceFile.toURL().openStream());
Added: trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java 2006-12-12 08:28:24
UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java 2006-12-12 12:23:36
UTC (rev 1630)
@@ -0,0 +1,304 @@
+package org.jboss.ws.core.utils;
+
+/*
+ $Id$
+
+ Copyright 2002 (C) The Werken Company. All Rights Reserved.
+
+ Redistribution and use of this software and associated documentation
+ ("Software"), with or without modification, are permitted provided
+ that the following conditions are met:
+
+ 1. Redistributions of source code must retain copyright
+ statements and notices. Redistributions must also contain a
+ copy of this document.
+
+ 2. Redistributions in binary form must reproduce the
+ above copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+ 3. The name "classworlds" must not be used to endorse or promote
+ products derived from this Software without prior written
+ permission of The Werken Company. For written permission,
+ please contact bob(a)werken.com.
+
+ 4. Products derived from this Software may not be called "classworlds"
+ nor may "classworlds" appear in their names without prior written
+ permission of The Werken Company. "classworlds" is a registered
+ trademark of The Werken Company.
+
+ 5. Due credit should be given to The Werken Company.
+ (
http://classworlds.werken.com/).
+
+ THIS SOFTWARE IS PROVIDED BY THE WERKEN COMPANY AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+ NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE WERKEN COMPANY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.JarURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarInputStream;
+
+/** <code>URLConnection</code> capable of handling multiply-nested jars.
+ *
+ *
+ * @author <a href="mailto:bob@eng.werken.com">bob mcwhirter</a>
+ *
+ * @version $Id$
+ */
+public class JarUrlConnection extends JarURLConnection
+{
+ // ----------------------------------------------------------------------
+ // Instance members
+ // ----------------------------------------------------------------------
+
+ /** Base resource. */
+ private URL baseResource;
+
+ /** Additional nested segments. */
+ private String[] segments;
+
+ /** Terminal input-stream. */
+ private InputStream in;
+
+ // ----------------------------------------------------------------------
+ // Constructors
+ // ----------------------------------------------------------------------
+
+ /** Construct.
+ *
+ * @param url Target URL of the connections.
+ *
+ * @throws java.io.IOException If an error occurs while attempting to initialize
+ * the connection.
+ */
+ public JarUrlConnection(URL url) throws IOException
+ {
+ super(url = normaliseURL(url));
+
+ String baseText = url.getPath();
+
+ int bangLoc = baseText.indexOf("!");
+
+ String baseResourceText = baseText.substring(0, bangLoc);
+
+ String extraText = "";
+
+ if (bangLoc <= (baseText.length() - 2) && baseText.charAt(bangLoc + 1)
== '/')
+ {
+ if (bangLoc + 2 == baseText.length())
+ {
+ extraText = "";
+ }
+ else
+ {
+ extraText = baseText.substring(bangLoc + 1);
+ }
+ }
+ else
+ {
+ throw new MalformedURLException("No !/ in url: " +
url.toExternalForm());
+ }
+
+ List segments = new ArrayList();
+
+ StringTokenizer tokens = new StringTokenizer(extraText, "!");
+
+ while (tokens.hasMoreTokens())
+ {
+ segments.add(tokens.nextToken());
+ }
+
+ this.segments = (String[])segments.toArray(new String[segments.size()]);
+
+ this.baseResource = new URL(baseResourceText);
+ }
+
+ protected static URL normaliseURL(URL url) throws MalformedURLException
+ {
+ String text = normalizeUrlPath(url.toString());
+
+ if (!text.startsWith("jar:"))
+ {
+ text = "jar:" + text;
+ }
+
+ if (text.indexOf('!') < 0)
+ {
+ text = text + "!/";
+ }
+
+ return new URL(text);
+ }
+
+ // ----------------------------------------------------------------------
+ // Instance methods
+ // ----------------------------------------------------------------------
+
+ /** Retrieve the nesting path segments.
+ *
+ * @return The segments.
+ */
+ protected String[] getSegments()
+ {
+ return this.segments;
+ }
+
+ /** Retrieve the base resource <code>URL</code>.
+ *
+ * @return The base resource url.
+ */
+ protected URL getBaseResource()
+ {
+ return this.baseResource;
+ }
+
+ /** @see java.net.URLConnection
+ */
+ public void connect() throws IOException
+ {
+ if (this.segments.length == 0)
+ {
+ setupBaseResourceInputStream();
+ }
+ else
+ {
+ setupPathedInputStream();
+ }
+ }
+
+ /** Setup the <code>InputStream</code> purely from the base resource.
+ *
+ * @throws java.io.IOException If an I/O error occurs.
+ */
+ protected void setupBaseResourceInputStream() throws IOException
+ {
+ this.in = getBaseResource().openStream();
+ }
+
+ /** Setup the <code>InputStream</code> for URL with nested segments.
+ *
+ * @throws java.io.IOException If an I/O error occurs.
+ */
+ protected void setupPathedInputStream() throws IOException
+ {
+ InputStream curIn = getBaseResource().openStream();
+
+ for (int i = 0; i < this.segments.length; ++i)
+ {
+ curIn = getSegmentInputStream(curIn, segments[i]);
+ }
+
+ this.in = curIn;
+ }
+
+ /** Retrieve the <code>InputStream</code> for the nesting
+ * segment relative to a base <code>InputStream</code>.
+ *
+ * @param baseIn The base input-stream.
+ * @param segment The nesting segment path.
+ *
+ * @return The input-stream to the segment.
+ *
+ * @throws java.io.IOException If an I/O error occurs.
+ */
+ protected InputStream getSegmentInputStream(InputStream baseIn, String segment) throws
IOException
+ {
+ JarInputStream jarIn = new JarInputStream(baseIn);
+ JarEntry entry = null;
+
+ while (jarIn.available() != 0)
+ {
+ entry = jarIn.getNextJarEntry();
+
+ if (entry == null)
+ {
+ break;
+ }
+
+ if (("/" + entry.getName()).equals(segment))
+ {
+ return jarIn;
+ }
+ }
+
+ throw new IOException("unable to locate segment: " + segment);
+ }
+
+ /** @see java.net.URLConnection
+ */
+ public InputStream getInputStream() throws IOException
+ {
+ if (this.in == null)
+ {
+ connect();
+ }
+ return this.in;
+ }
+
+ /**
+ * @return JarFile
+ * @throws java.io.IOException
+ * @see java.net.JarURLConnection#getJarFile()
+ */
+ public JarFile getJarFile() throws IOException
+ {
+ String url = baseResource.toExternalForm();
+
+ if (url.startsWith("file:/"))
+ {
+ url = url.substring(6);
+ }
+
+ return new JarFile(URLDecoder.decode(url, "UTF-8"));
+ }
+
+ private static String normalizeUrlPath(String name)
+ {
+ if (name.startsWith("/"))
+ {
+ name = name.substring(1);
+
+ System.out.println("1 name = " + name);
+ }
+
+ // Looking for org/codehaus/werkflow/personality/basic/../common/core-idioms.xml
+ // | i |
+ // +-------+ remove
+ //
+ int i = name.indexOf("/..");
+
+ // Can't be at the beginning because we have no root to refer to so
+ // we start at 1.
+ if (i > 0)
+ {
+ int j = name.lastIndexOf("/", i - 1);
+
+ name = name.substring(0, j) + name.substring(i + 3);
+
+ System.out.println("2 name = " + name);
+ }
+
+ return name;
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2006-12-12 08:28:24 UTC
(rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2006-12-12 12:23:36 UTC
(rev 1630)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.utils;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * A wrapper around an URL that can handle input streams for resources in nested jars.
+ *
+ * The jdk-1.5.0_10 cannot handle this type of URL
+ *
+ *
jar:file://somepath/jaxws-eardeployment.ear!/jaxws-eardeployment.war!/WEB-INF/wsdl/TestEndpoint.wsdl
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Dec-2006 (Dosi's birthday)
+ */
+public class ResourceURL
+{
+ private URL targetURL;
+
+ public ResourceURL(URL targetURL)
+ {
+ this.targetURL = targetURL;
+ }
+
+ public URL getTargetURL()
+ {
+ return targetURL;
+ }
+
+ public InputStream openStream() throws IOException
+ {
+ boolean isJarUrl = "jar".equals(targetURL.getProtocol());
+ return isJarUrl ? new JarUrlConnection(targetURL).getInputStream() :
targetURL.openStream();
+ }
+
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof ResourceURL)) return false;
+ ResourceURL other = (ResourceURL)obj;
+ return toString().equals(other.toString());
+ }
+
+ public String toString()
+ {
+ return targetURL.toString();
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-12
08:28:24 UTC (rev 1629)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -108,7 +108,7 @@
ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData,
serviceQName);
wsMetaData.addService(serviceMetaData);
- serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
+ serviceMetaData.setWsdlLocation(wsdlURL);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
URL mappingURL = null;
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-12
08:28:24 UTC (rev 1629)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -22,6 +22,7 @@
// $Id$
package org.jboss.ws.metadata.builder.jaxrpc;
+import java.net.URL;
import java.util.Set;
import javax.management.ObjectName;
@@ -80,8 +81,12 @@
serviceMetaData.setWebserviceDescriptionName(wsdMetaData.getWebserviceDescriptionName());
wsMetaData.addService(serviceMetaData);
+ // Set wsdl location
+ String wsdlFile = wsdMetaData.getWsdlFile();
+ URL wsdlLocation = udi.getMetaDataFile(wsdlFile);
+
// Unmarshall the WSDL
- serviceMetaData.setWsdlFile(wsdMetaData.getWsdlFile());
+ serviceMetaData.setWsdlLocation(wsdlLocation);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
// Unmarshall the jaxrpc-mapping.xml
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-12
08:28:24 UTC (rev 1629)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -75,7 +75,7 @@
ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
wsMetaData.addService(serviceMetaData);
- serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
+ serviceMetaData.setWsdlLocation(wsdlURL);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
buildMetaDataInternal(serviceMetaData, wsdlDefinitions);
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-12
08:28:24 UTC (rev 1629)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.metadata.builder.jaxws;
+import java.io.IOException;
+
import javax.xml.ws.BindingType;
import org.jboss.logging.Logger;
@@ -42,7 +44,7 @@
// provide logging
private final Logger log = Logger.getLogger(JAXWSEndpointMetaDataBuilder.class);
- public abstract ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName);
+ public abstract ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException;
protected void processBindingType(EndpointMetaData epMetaData, Class<?>
wsClass)
{
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-12
08:28:24 UTC (rev 1629)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -22,6 +22,9 @@
// $Id$
package org.jboss.ws.metadata.builder.jaxws;
+import java.io.IOException;
+import java.net.URL;
+
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.management.ObjectName;
@@ -64,7 +67,7 @@
*/
@Override
- public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
+ public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException
{
// 5.3 Conformance (Provider implementation): A Provider based service endpoint
implementation MUST
// implement a typed Provider interface.
@@ -126,7 +129,10 @@
// Process WSDL
String wsdlLocation = anWebServiceProvider.wsdlLocation();
if (wsdlLocation.length() > 0)
- serviceMetaData.setWsdlFile(wsdlLocation);
+ {
+ URL wsdlURL = udi.getMetaDataFile(wsdlLocation);
+ serviceMetaData.setWsdlLocation(wsdlURL);
+ }
// Set the endpoint address
processPortComponent(udi, sepClass, linkName, sepMetaData);
@@ -135,7 +141,7 @@
MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
// A provider may not have a WSDL file
- if (sepMetaData.getServiceMetaData().getWsdlFile() != null)
+ if (sepMetaData.getServiceMetaData().getWsdlLocation() != null)
MetaDataBuilder.replaceAddressLocation(sepMetaData);
// init service endpoint id
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-12
08:28:24 UTC (rev 1629)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -23,6 +23,8 @@
// $Id$
+import java.io.IOException;
+
import javax.jws.WebService;
import javax.xml.ws.WebServiceProvider;
@@ -50,7 +52,7 @@
}
protected void setupEndpoint(UnifiedMetaData umd, UnifiedDeploymentInfo udi,
Class<?> beanClass, String beanName)
- throws SecurityException, ClassNotFoundException, NoSuchMethodException
+ throws SecurityException, ClassNotFoundException, NoSuchMethodException,
IOException
{
JAXWSEndpointMetaDataBuilder builder = getEndpointBuilder(beanClass);
if (builder != null)
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-12
08:28:24 UTC (rev 1629)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -59,7 +59,6 @@
import javax.xml.ws.addressing.AddressingProperties;
import org.jboss.logging.Logger;
-import org.jboss.remoting.samples.chat.exceptions.InvalidArgumentException;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
@@ -120,7 +119,7 @@
private Class<?> klass;
private ServerEndpointMetaData semd;
private ServiceMetaData smd;
- private String wsdlLocation;
+ private URL wsdlLocation;
}
// provide logging
@@ -642,7 +641,7 @@
processMetaExtensions(epMetaData, opMetaData);
}
- private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?>
sepClass, ClassLoader loader) throws ClassNotFoundException
+ private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?>
sepClass, UnifiedDeploymentInfo udi) throws ClassNotFoundException, IOException
{
WebService anWebService = sepClass.getAnnotation(WebService.class);
if (anWebService == null)
@@ -674,23 +673,15 @@
if (anWebService.endpointInterface().length() > 0)
{
seiName = anWebService.endpointInterface();
- seiClass = loader.loadClass(seiName);
+ seiClass = udi.classLoader.loadClass(seiName);
anWebService = seiClass.getAnnotation(WebService.class);
if (anWebService == null)
throw new WSException("Interface does not have a @WebService annotation:
" + seiName);
- else
- {
- if(anWebService.portName().length()>0
- || anWebService.serviceName().length()>0
- || anWebService.endpointInterface().length()>0
- )
- {
- throw new WSException(seiName + ": The service endpoint interface
MUST NOT include the JSR-181 annotation " +
- "elements portName, serviceName and endpointInterface of the
annotation @WebService.");
- }
- }
+ if (anWebService.portName().length() > 0 ||
anWebService.serviceName().length() > 0 || anWebService.endpointInterface().length()
> 0)
+ throw new
WSException("@WebService[portName,serviceName,endpointInterface] MUST NOT be defined
on: " + seiName);
+
name = anWebService.name();
if (name.length() == 0)
name = WSDLUtils.getJustClassName(seiClass);
@@ -715,8 +706,7 @@
result.smd = new ServiceMetaData(wsMetaData, new QName(serviceNS, serviceName));
result.semd = new ServerEndpointMetaData(result.smd, portQName, portTypeQName,
EndpointMetaData.Type.JAXWS);
result.klass = (seiClass != null ? seiClass : sepClass);
- result.wsdlLocation = wsdlLocation;
-
+ result.wsdlLocation = udi.getMetaDataFile(wsdlLocation);
result.smd.addEndpoint(result.semd);
wsMetaData.addService(result.smd);
@@ -859,11 +849,11 @@
}
}
- protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData,
String wsdlLocation, EndpointMetaData epMetaData)
+ protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData,
URL wsdlLocation, EndpointMetaData epMetaData)
{
- if (wsdlLocation.length() > 0)
+ if (wsdlLocation != null)
{
- serviceMetaData.setWsdlFile(wsdlLocation);
+ serviceMetaData.setWsdlLocation(wsdlLocation);
}
else
{
@@ -882,8 +872,7 @@
wsdlTmpFile.deleteOnExit();
Writer writer = IOUtils.getCharsetFileWriter(wsdlTmpFile,
Constants.DEFAULT_XML_CHARSET);
- new WSDLWriter(wsdlDefinitions).write(writer, Constants.DEFAULT_XML_CHARSET,
new WSDLWriterResolver()
- {
+ new WSDLWriter(wsdlDefinitions).write(writer, Constants.DEFAULT_XML_CHARSET,
new WSDLWriterResolver() {
public WSDLWriterResolver resolve(String suggestedFile) throws
IOException
{
File newTmpFile = File.createTempFile(suggestedFile, ".wsdl",
tmpdir);
@@ -896,7 +885,7 @@
});
writer.close();
- serviceMetaData.setWsdlFile(wsdlTmpFile.toURL().toExternalForm());
+ serviceMetaData.setWsdlLocation(wsdlTmpFile.toURL());
}
catch (RuntimeException rte)
{
@@ -981,7 +970,7 @@
{
try
{
- EndpointResult result = processWebService(wsMetaData, sepClass,
udi.classLoader);
+ EndpointResult result = processWebService(wsMetaData, sepClass, udi);
// Clear the java types, etc.
resetMetaDataBuilder(udi.classLoader);
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2006-12-12
08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -71,7 +71,7 @@
private QName serviceName;
private String wsdName;
- private String wsdlFile;
+ private URL wsdlLocation;
private String jaxrpcMappingFile;
private String wsdlPublishLocation;
@@ -121,14 +121,14 @@
this.wsdName = wsdName;
}
- public String getWsdlFile()
+ public URL getWsdlLocation()
{
- return wsdlFile;
+ return wsdlLocation;
}
- public void setWsdlFile(String wsdlFile)
+ public void setWsdlLocation(URL wsdlLocation)
{
- this.wsdlFile = wsdlFile;
+ this.wsdlLocation = wsdlLocation;
}
public String getWsdlPublishLocation()
@@ -247,39 +247,18 @@
*/
public WSDLDefinitions getWsdlDefinitions()
{
- WSDLDefinitions wsdlDefinitions =
(WSDLDefinitions)wsMetaData.getWSDLDefinition(wsdlFile);
- if (wsdlDefinitions == null && wsdlFile != null)
+ WSDLDefinitions wsdlDefinitions = null;
+ if (wsdlLocation != null)
{
- URL wsdlLocation = getWsdlLocation();
- if (wsdlLocation == null)
- throw new IllegalArgumentException("Cannot find wsdl in deployment:
" + wsdlFile);
-
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- wsdlDefinitions = factory.parse(wsdlLocation);
- wsMetaData.addWSDLDefinition(wsdlFile, wsdlDefinitions);
- }
- return wsdlDefinitions;
- }
-
- public URL getWsdlLocation()
- {
- URL wsdlLocation = null;
- if (wsdlFile != null)
- {
- try
+ wsdlDefinitions =
(WSDLDefinitions)wsMetaData.getWSDLDefinition(wsdlLocation.toExternalForm());
+ if (wsdlDefinitions == null)
{
- wsdlLocation = new URL(wsdlFile);
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ wsdlDefinitions = factory.parse(wsdlLocation);
+ wsMetaData.addWSDLDefinition(wsdlLocation.toExternalForm(),
wsdlDefinitions);
}
- catch (MalformedURLException e)
- {
- // ignore
- }
- if (wsdlLocation == null)
- {
- wsdlLocation = wsMetaData.getClassLoader().getResource(wsdlFile);
- }
}
- return wsdlLocation;
+ return wsdlDefinitions;
}
public TypeMappingImpl getTypeMapping()
@@ -401,7 +380,7 @@
StringBuilder buffer = new StringBuilder("\nServiceMetaData:");
buffer.append("\n qname=" + serviceName);
buffer.append("\n wsdName=" + wsdName);
- buffer.append("\n wsdlFile=" + wsdlFile);
+ buffer.append("\n wsdlFile=" + wsdlLocation);
buffer.append("\n jaxrpcFile=" + jaxrpcMappingFile);
buffer.append("\n publishLocation=" + wsdlPublishLocation);
buffer.append("\n properties=" + properties);
Modified: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2006-12-12
08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -40,6 +40,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.JBossWSEntityResolver;
+import org.jboss.ws.core.utils.ResourceURL;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLException;
import org.w3c.dom.Document;
@@ -164,15 +165,15 @@
{
try
{
- InputStream wsdlInputStream = wsdlLocation.openStream();
+ InputStream inputStream = new ResourceURL(wsdlLocation).openStream();
try
{
DocumentBuilder builder = DOMUtils.getDocumentBuilder();
- return builder.parse(wsdlInputStream);
+ return builder.parse(inputStream);
}
finally
{
- wsdlInputStream.close();
+ inputStream.close();
}
}
catch (ConnectException ex)
Modified: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2006-12-12 08:28:24
UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2006-12-12 12:23:36
UTC (rev 1630)
@@ -32,6 +32,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.ResourceURL;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
@@ -43,38 +44,38 @@
private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
private EntityResolver entityResolver;
- private URL wsdlURL;
+ private URL wsdlLocation;
private String latestImportURI;
- public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
+ public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlLocation)
{
- if (wsdlFile == null)
+ if (wsdlLocation == null)
throw new IllegalArgumentException("WSDL file argument cannot be
null");
this.entityResolver = entityResolver;
- this.wsdlURL = wsdlFile;
+ this.wsdlLocation = wsdlLocation;
}
public InputSource getBaseInputSource()
{
- log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
+ log.trace("getBaseInputSource [wsdlUrl=" + wsdlLocation +
"]");
try
{
- InputStream is = wsdlURL.openStream();
- if (is == null)
- throw new IllegalArgumentException("Cannot obtain wsdl from [" +
wsdlURL + "]");
+ InputStream inputStream = new ResourceURL(wsdlLocation).openStream();
+ if (inputStream == null)
+ throw new IllegalArgumentException("Cannot obtain wsdl from [" +
wsdlLocation + "]");
- return new InputSource(is);
+ return new InputSource(inputStream);
}
catch (IOException e)
{
- throw new RuntimeException("Cannot access wsdl from [" + wsdlURL +
"], " + e.getMessage());
+ throw new RuntimeException("Cannot access wsdl from [" + wsdlLocation
+ "], " + e.getMessage());
}
}
public String getBaseURI()
{
- return wsdlURL.toExternalForm();
+ return wsdlLocation.toExternalForm();
}
public InputSource getImportInputSource(String parent, String resource)
Modified: trunk/src/test/ant/build-jars-jaxws.xml
===================================================================
--- trunk/src/test/ant/build-jars-jaxws.xml 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/test/ant/build-jars-jaxws.xml 2006-12-12 12:23:36 UTC (rev 1630)
@@ -47,11 +47,17 @@
<classes dir="${build.tests.dir}/classes">
<include
name="org/jboss/test/ws/jaxws/eardeployment/JSEBean.class"/>
</classes>
+ <webinf
dir="${build.tests.dir}/resources/jaxws/eardeployment/WEB-INF">
+ <include name="wsdl/**"/>
+ </webinf>
</war>
<jar jarfile="${build.tests.dir}/libs/jaxws-eardeployment.jar">
<fileset dir="${build.tests.dir}/classes">
<include
name="org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.class"/>
</fileset>
+ <metainf
dir="${build.tests.dir}/resources/jaxws/eardeployment/WEB-INF">
+ <include name="wsdl/**"/>
+ </metainf>
</jar>
<jar jarfile="${build.tests.dir}/libs/jaxws-eardeployment.ear">
<fileset dir="${build.tests.dir}/libs">
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java 2006-12-12
08:28:24 UTC (rev 1629)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -29,10 +29,11 @@
import org.jboss.logging.Logger;
import org.jboss.ws.annotation.PortComponent;
-@Stateless
-@WebService(name="TestEndpoint")
+// Test that the wsdl can be read from the nested deployment
+@WebService(name="TestEndpoint",
wsdlLocation="META-INF/wsdl/TestEndpoint.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@PortComponent(contextRoot="/earejb3")
+@Stateless
public class EJB3Bean
{
private static Logger log = Logger.getLogger(EJB3Bean.class);
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-12
08:28:24 UTC (rev 1629)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.eardeployment;
+import java.io.File;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -29,6 +30,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.ResourceURL;
+import org.w3c.dom.Element;
/**
* Test ear deployment
@@ -42,6 +46,18 @@
{
return JBossWSTestSetup.newTestSetup(EarTestCase.class,
"jaxws-eardeployment.ear");
}
+
+ public void testResourceURL() throws Exception
+ {
+ File earFile = new File("libs/jaxws-eardeployment.ear");
+ assertTrue(earFile.exists());
+
+ URL warURL = new URL("jar:" + earFile.toURL() +
"!/jaxws-eardeployment.war!/");
+ URL wsdlURL = new URL(warURL, "WEB-INF/wsdl/TestEndpoint.wsdl");
+
+ Element root = DOMUtils.parse(new ResourceURL(wsdlURL).openStream());
+ assertNotNull(root);
+ }
public void testEJB3Endpoint() throws Exception
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/JSEBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/JSEBean.java 2006-12-12
08:28:24 UTC (rev 1629)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/JSEBean.java 2006-12-12
12:23:36 UTC (rev 1630)
@@ -27,7 +27,8 @@
import org.jboss.logging.Logger;
-@WebService(name="TestEndpoint")
+//Test that the wsdl can be read from the nested deployment
+@WebService(name="TestEndpoint",
wsdlLocation="WEB-INF/wsdl/TestEndpoint.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class JSEBean
{