JBossWS SVN: r5804 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-02-25 15:32:13 -0500 (Mon, 25 Feb 2008)
New Revision: 5804
Modified:
stack/cxf/trunk/build.xml
Log:
Fix implementation version
Modified: stack/cxf/trunk/build.xml
===================================================================
--- stack/cxf/trunk/build.xml 2008-02-25 19:44:59 UTC (rev 5803)
+++ stack/cxf/trunk/build.xml 2008-02-25 20:32:13 UTC (rev 5804)
@@ -84,7 +84,7 @@
<filter token="java.vm.version" value="${java.vm.version}"/>
<filter token="java.vm.vendor" value="${java.vm.vendor}"/>
<filter token="build.id" value="${build.id}"/>
- <filter token="implementation.version" value="${specification.version}-cxf-${version.id}"/>
+ <filter token="implementation.version" value="jbossws-${version.id}"/>
<filtersfile file="${int.cxf.dir}/version.properties"/>
</filterset>
</copy>
@@ -126,7 +126,7 @@
</fileset>
<filterset>
<filter token="build.id" value="${build.id}"/>
- <filter token="implementation.version" value="${specification.version}-cxf-${version.id}"/>
+ <filter token="implementation.version" value="jbossws-${version.id}"/>
<filtersfile file="${cxf.dir}/version.properties"/>
</filterset>
</copy>
16 years, 10 months
JBossWS SVN: r5803 - stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-02-25 14:44:59 -0500 (Mon, 25 Feb 2008)
New Revision: 5803
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
Log:
[JBWS-1861] Improve exception message on invalid @WebService usage on SEI
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2008-02-25 16:22:35 UTC (rev 5802)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2008-02-25 19:44:59 UTC (rev 5803)
@@ -328,7 +328,7 @@
throw new WSException("Interface does not have a @WebService annotation: " + seiName);
if (seiAnnotation.portName().length() > 0 || seiAnnotation.serviceName().length() > 0 || seiAnnotation.endpointInterface().length() > 0)
- throw new WSException("@WebService[portName,serviceName,endpointInterface] MUST NOT be defined on: " + seiName);
+ throw new WSException("@WebService cannot have attribute 'portName', 'serviceName', 'endpointInterface' on: " + seiName);
// Redefine the interface or "PortType" name
name = seiAnnotation.name();
16 years, 10 months
JBossWS SVN: r5802 - in stack/native/trunk/src/main/java/org/jboss/ws/core: jaxws/handler and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-02-25 11:22:35 -0500 (Mon, 25 Feb 2008)
New Revision: 5802
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
Log:
[JBWS-1878] ConcurrentModificationException in initHandlerChain()
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2008-02-25 16:07:09 UTC (rev 5801)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2008-02-25 16:22:35 UTC (rev 5802)
@@ -88,10 +88,16 @@
// Initialize the handler chain
if (isInitialized() == false)
{
- initHandlerChain(sepMetaData, HandlerType.PRE);
- initHandlerChain(sepMetaData, HandlerType.ENDPOINT);
- initHandlerChain(sepMetaData, HandlerType.POST);
- setInitialized(true);
+ synchronized (sepMetaData)
+ {
+ if (isInitialized() == false)
+ {
+ initHandlerChain(sepMetaData, HandlerType.PRE);
+ initHandlerChain(sepMetaData, HandlerType.ENDPOINT);
+ initHandlerChain(sepMetaData, HandlerType.POST);
+ setInitialized(true);
+ }
+ }
}
boolean status = true;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2008-02-25 16:07:09 UTC (rev 5801)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2008-02-25 16:22:35 UTC (rev 5802)
@@ -80,10 +80,16 @@
// Initialize the handler chain
if (isInitialized() == false)
{
- resolver.initHandlerChain(sepMetaData, HandlerType.PRE, true);
- resolver.initHandlerChain(sepMetaData, HandlerType.ENDPOINT, true);
- resolver.initHandlerChain(sepMetaData, HandlerType.POST, true);
- setInitialized(true);
+ synchronized (resolver)
+ {
+ if (isInitialized() == false)
+ {
+ resolver.initHandlerChain(sepMetaData, HandlerType.PRE, true);
+ resolver.initHandlerChain(sepMetaData, HandlerType.ENDPOINT, true);
+ resolver.initHandlerChain(sepMetaData, HandlerType.POST, true);
+ setInitialized(true);
+ }
+ }
}
HandlerChainExecutor executor = createExecutor(sepMetaData, type);
16 years, 10 months
JBossWS SVN: r5801 - in stack: metro/trunk/ant-import and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-02-25 11:07:09 -0500 (Mon, 25 Feb 2008)
New Revision: 5801
Modified:
stack/cxf/trunk/ant-import/macros-deploy-cxf.xml
stack/metro/trunk/ant-import/macros-deploy-metro.xml
stack/native/trunk/ant-import/macros-deploy-native.xml
Log:
Always delete jbossws.sar
Modified: stack/cxf/trunk/ant-import/macros-deploy-cxf.xml
===================================================================
--- stack/cxf/trunk/ant-import/macros-deploy-cxf.xml 2008-02-25 14:53:32 UTC (rev 5800)
+++ stack/cxf/trunk/ant-import/macros-deploy-cxf.xml 2008-02-25 16:07:09 UTC (rev 5801)
@@ -70,6 +70,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss422.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -134,6 +135,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss423.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss423.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss423.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -206,6 +208,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss500.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss500.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss500.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -278,6 +281,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss501.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss501.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss501.home}" includes="${jbossws.undeploy.files}"/>
</delete>
Modified: stack/metro/trunk/ant-import/macros-deploy-metro.xml
===================================================================
--- stack/metro/trunk/ant-import/macros-deploy-metro.xml 2008-02-25 14:53:32 UTC (rev 5800)
+++ stack/metro/trunk/ant-import/macros-deploy-metro.xml 2008-02-25 16:07:09 UTC (rev 5801)
@@ -100,6 +100,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss422.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -160,6 +161,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss423.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss423.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss423.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -230,6 +232,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss500.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss500.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss500.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -300,6 +303,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss501.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss501.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss501.home}" includes="${jbossws.undeploy.files}"/>
</delete>
Modified: stack/native/trunk/ant-import/macros-deploy-native.xml
===================================================================
--- stack/native/trunk/ant-import/macros-deploy-native.xml 2008-02-25 14:53:32 UTC (rev 5800)
+++ stack/native/trunk/ant-import/macros-deploy-native.xml 2008-02-25 16:07:09 UTC (rev 5801)
@@ -135,6 +135,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss421.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss421.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss421.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -205,6 +206,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss422.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss422.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -275,6 +277,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss423.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss423.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss423.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -365,6 +368,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss500.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss500.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss500.home}" includes="${jbossws.undeploy.files}"/>
</delete>
@@ -457,6 +461,7 @@
<loadfile property="jbossws.undeploy.files" srcfile="${jboss501.home}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws.deploy.files.txt" failonerror="false"/>
<property name="jbossws.undeploy.files" value="nothing.to.undeploy"/>
+ <delete dir="${jboss501.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete>
<fileset dir="${jboss501.home}" includes="${jbossws.undeploy.files}"/>
</delete>
16 years, 10 months
JBossWS SVN: r5800 - in stack/native/trunk: src/main/java/org/jboss/wsf/stack/jbws and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-02-25 09:53:32 -0500 (Mon, 25 Feb 2008)
New Revision: 5800
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java
Modified:
stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
Log:
JBWS-1909 - RequestHandler.handlerWSDLResquest has dependency on Servlet API
Modified: stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2008-02-25 14:48:51 UTC (rev 5799)
+++ stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2008-02-25 14:53:32 UTC (rev 5800)
@@ -625,6 +625,14 @@
</fileset>
</jar>
+ <!-- jaxws-jbws1909 -->
+ <jar destfile="${tests.output.dir}/libs/jaxws-jbws1909.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1909/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws1909/*TestCase.class"/>
+ </fileset>
+ </jar>
+
<!-- jaxws-jbws1969 -->
<jar destfile="${tests.output.dir}/libs/jaxws-jbws1969.jar">
<fileset dir="${tests.output.dir}/classes">
Modified: stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-02-25 14:48:51 UTC (rev 5799)
+++ stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-02-25 14:53:32 UTC (rev 5800)
@@ -28,6 +28,7 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
@@ -93,6 +94,7 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.IOUtils;
import org.w3c.dom.Document;
/**
@@ -521,37 +523,26 @@
}
}
- public void handleWSDLRequest(Endpoint endpoint, OutputStream outputStream, InvocationContext context)
+ public void handleWSDLRequest(Endpoint endpoint, OutputStream outStream, InvocationContext context)
{
log.debug("handleWSDLRequest: " + endpoint.getName());
- ServerEndpointMetaData epMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
- if (epMetaData == null)
- throw new IllegalStateException("Cannot obtain endpoint meta data");
-
- ServletRequestContext reqContext = (ServletRequestContext)context;
- HttpServletRequest req = reqContext.getHttpServletRequest();
-
try
{
- // For the base document the resourcePath should be null
- String resPath = (String)req.getParameter("resource");
- URL reqURL = new URL(req.getRequestURL().toString());
-
- String wsdlHost = reqURL.getProtocol() + "://" + reqURL.getHost();
- if (reqURL.getPort() != -1)
- wsdlHost += ":" + reqURL.getPort();
-
- if (ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()) == false)
- wsdlHost = serverConfig.getWebServiceHost();
-
- log.debug("WSDL request, using host: " + wsdlHost);
-
- WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
- Document document = wsdlRequestHandler.getDocumentForPath(reqURL, wsdlHost, resPath);
-
- OutputStreamWriter writer = new OutputStreamWriter(outputStream);
- new DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
+ if (context instanceof ServletRequestContext)
+ {
+ handleWSDLRequestFromServletContext(endpoint, outStream, context);
+ }
+ else
+ {
+ String epAddress = endpoint.getAddress();
+ if (epAddress == null)
+ throw new IllegalArgumentException("Invalid endpoint address: " + epAddress);
+
+ URL wsdlUrl = new URL(epAddress + "?wsdl");
+ InputStream inStream = wsdlUrl.openStream();
+ IOUtils.copyStream(outStream, inStream);
+ }
}
catch (RuntimeException rte)
{
@@ -563,6 +554,35 @@
}
}
+ private void handleWSDLRequestFromServletContext(Endpoint endpoint, OutputStream outputStream, InvocationContext context) throws MalformedURLException, IOException
+ {
+ ServerEndpointMetaData epMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
+ if (epMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta data");
+
+ ServletRequestContext reqContext = (ServletRequestContext)context;
+ HttpServletRequest req = reqContext.getHttpServletRequest();
+
+ // For the base document the resourcePath should be null
+ String resPath = (String)req.getParameter("resource");
+ URL reqURL = new URL(req.getRequestURL().toString());
+
+ String wsdlHost = reqURL.getProtocol() + "://" + reqURL.getHost();
+ if (reqURL.getPort() != -1)
+ wsdlHost += ":" + reqURL.getPort();
+
+ if (ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()) == false)
+ wsdlHost = serverConfig.getWebServiceHost();
+
+ log.debug("WSDL request, using host: " + wsdlHost);
+
+ WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
+ Document document = wsdlRequestHandler.getDocumentForPath(reqURL, wsdlHost, resPath);
+
+ OutputStreamWriter writer = new OutputStreamWriter(outputStream);
+ new DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
+ }
+
private void handleException(Exception ex) throws ServletException
{
log.error("Error processing web service request", ex);
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java 2008-02-25 14:53:32 UTC (rev 5800)
@@ -0,0 +1,58 @@
+/*
+ * 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.test.ws.jaxws.jbws1909;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-1909] RequestHandler.handlerWSDLResquest has dependency on Servlet API
+ *
+ * http://jira.jboss.org/jira/browse/JBWS-1909
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 25-Feb-2007
+ */
+public class JBWS1909TestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS1909TestCase.class, "jaxws-jbws1909.jar");
+ }
+
+ public void testWSDLSchema() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1909/TestEndpointImpl?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws1909", "TestEndpointService");
+ Service service = Service.create(wsdlURL, serviceName);
+ TestEndpoint port = service.getPort(TestEndpoint.class);
+ String retStr = port.echo("hello");
+ assertEquals("hello|TestEndpointService", retStr);
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java 2008-02-25 14:53:32 UTC (rev 5800)
@@ -0,0 +1,32 @@
+/*
+ * 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.test.ws.jaxws.jbws1909;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "TestEndpoint", targetNamespace = "http://org.jboss.ws/jbws1909")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+public interface TestEndpoint
+{
+ String echo(String input);
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java 2008-02-25 14:53:32 UTC (rev 5800)
@@ -0,0 +1,98 @@
+/*
+ * 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.test.ws.jaxws.jbws1909;
+
+// $Id$
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.w3c.dom.Element;
+
+@WebService(serviceName = "TestEndpointService", name = "TestEndpoint", targetNamespace = "http://org.jboss.ws/jbws1909")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@Stateless
+public class TestEndpointImpl implements TestEndpoint
+{
+ // provide logging
+ private final static Logger log = Logger.getLogger(TestEndpointImpl.class);
+
+ @Resource
+ WebServiceContext context;
+
+ @WebMethod
+ public String echo(String input)
+ {
+ MessageContext msgContext = context.getMessageContext();
+ for (String key : msgContext.keySet())
+ {
+ log.info(key + "=" + msgContext.get(key));
+ }
+
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ EndpointRegistry registry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+
+ ObjectName oname = ObjectNameFactory.create("jboss.ws:context=jaxws-jbws1909,endpoint=TestEndpointImpl");
+ Endpoint endpoint = registry.getEndpoint(oname);
+ RequestHandler reqHandler = endpoint.getRequestHandler();
+
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ reqHandler.handleWSDLRequest(endpoint, baos, null); // The context is null
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ Element root = DOMUtils.parse(bais);
+ Element serviceEl = DOMUtils.getFirstChildElement(root, new QName("http://schemas.xmlsoap.org/wsdl/", "service"));
+ String serviceName = DOMUtils.getAttributeValue(serviceEl, "name");
+
+ input += "|" + serviceName;
+ }
+ catch (IOException ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ return input;
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 10 months
JBossWS SVN: r5799 - in stack/native/trunk/src/test: resources/jaxws and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-02-25 09:48:51 -0500 (Mon, 25 Feb 2008)
New Revision: 5799
Added:
stack/native/trunk/src/test/resources/jaxws/jbws771/
stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
Log:
Fix JBWS-771: Added binding customization examples
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-02-25 14:25:31 UTC (rev 5798)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-02-25 14:48:51 UTC (rev 5799)
@@ -25,6 +25,8 @@
import java.net.URL;
import java.util.List;
+import java.io.IOException;
+import java.io.File;
import javax.wsdl.Binding;
import javax.wsdl.BindingOperation;
@@ -42,6 +44,7 @@
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
+import org.jboss.wsf.spi.tools.cmd.WSConsume;
/**
* [JBWS-771] Use part names that are friendly to .NET
@@ -55,6 +58,11 @@
private static URL wsdlURL;
private static IWebsvc port;
+ private String JBOSS_HOME;
+ private String JDK_HOME;
+ private String TEST_EXEC_DIR;
+ private String OS;
+
public static Test suite()
{
return new JBossWSTestSetup(JBWS771TestCase.class, "jaxws-jbws771.jar");
@@ -71,6 +79,11 @@
Service service = Service.create(wsdlURL, serviceName);
port = service.getPort(IWebsvc.class);
}
+
+ JBOSS_HOME = System.getProperty("jboss.home");
+ TEST_EXEC_DIR = System.getProperty("test.execution.dir");
+ JDK_HOME = System.getProperty("jdk.home");
+ OS = System.getProperty("os.name").toLowerCase();
}
public void testSubmit() throws Exception
@@ -136,9 +149,15 @@
}
public void testWSConsume() throws Exception
- {
- System.out.println("FIXME [JBWS-1724] wsconsume cannot use part names that are friendly to .NET");
- //WSConsume.main(new String[]{"--output=tests/wsconsume", wsdlURL.toExternalForm()});
+ {
+ // use absolute path for the output to be re-usable
+ String absOutput = new File("wsconsume/java").getAbsolutePath();
+ String command = JBOSS_HOME + "/bin/wsconsume.sh -k -o "+absOutput+" --binding=resources/jaxws/jbws771/binding.xml "+ wsdlURL.toExternalForm();
+ Process p = executeCommand(command);
+
+ // check status code
+ assertStatusCode(p, "wsconsume");
+
}
private Definition getWSDLDefinition(String wsdlLocation) throws Exception
@@ -149,4 +168,26 @@
Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
return definition;
}
+
+ private Process executeCommand(String command)
+ throws IOException
+ {
+ // be verbose
+ System.out.println("cmd: " + command);
+ System.out.println("test execution dir: " + TEST_EXEC_DIR);
+
+ Process p = Runtime.getRuntime().exec(
+ command,
+ new String[] {"JBOSS_HOME="+ JBOSS_HOME, "JAVA_HOME="+ JDK_HOME}
+ );
+ return p;
+ }
+
+ private void assertStatusCode(Process p, String s)
+ throws InterruptedException
+ {
+ // check status code
+ int status = p.waitFor();
+ assertTrue(s +" did exit with status " + status, status==0);
+ }
}
Added: stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml 2008-02-25 14:48:51 UTC (rev 5799)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<jaxws:bindings wsdlLocation="http://localhost:8080/jaxws-jbws771/IWebsvcImpl?wsdl"
+ xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <jaxws:bindings
+ node="wsdl:definitions/wsdl:portType[@name='IWebsvc']/wsdl:operation[@name='cancel']">
+ <jaxws:parameter
+ part="wsdl:definitions/wsdl:message[@name='IWebsvc_cancel']/wsdl:part[@name='parameters']"
+ element="tns:cancel" name="cancelMessage"/>
+ </jaxws:bindings>
+</jaxws:bindings>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 10 months
JBossWS SVN: r5798 - stack/native/trunk/ant-import.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-02-25 09:25:31 -0500 (Mon, 25 Feb 2008)
New Revision: 5798
Modified:
stack/native/trunk/ant-import/macros-deploy-native.xml
Log:
[JBWS-1982] Simplify deploy/undeploy cycles for different stacks
deploy/undeploy based on filelist
Modified: stack/native/trunk/ant-import/macros-deploy-native.xml
===================================================================
--- stack/native/trunk/ant-import/macros-deploy-native.xml 2008-02-25 13:18:38 UTC (rev 5797)
+++ stack/native/trunk/ant-import/macros-deploy-native.xml 2008-02-25 14:25:31 UTC (rev 5798)
@@ -345,6 +345,17 @@
<unjar dest="${core.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-native50.sar"/>
<mkdir dir="${core.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
<unzip dest="${core.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
+
+ <fileset id="jbossws.deploy.files" dir="${core.output.deploy.dir}" excludes="jbossws.deploy.files.txt"/>
+ <copy todir="${jboss500.home}" overwrite="true">
+ <fileset refid="jbossws.deploy.files"/>
+ </copy>
+
+ <property name="jbossws.deploy.files" refid="jbossws.deploy.files"/>
+ <echo file="${core.output.deploy.dir}/jbossws.deploy.files.txt" message="${jbossws.deploy.files}"/>
+ <replace file="${core.output.deploy.dir}/jbossws.deploy.files.txt" token=";" value=" "/>
+ <copy todir="${jboss500.home}/server/${jboss.server.instance}/deploy/jbossws.sar" file="${core.output.deploy.dir}/jbossws.deploy.files.txt" overwrite="true"/>
+
</sequential>
</macrodef>
16 years, 10 months
JBossWS SVN: r5797 - stack/metro/trunk/ant-import.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-02-25 08:18:38 -0500 (Mon, 25 Feb 2008)
New Revision: 5797
Modified:
stack/metro/trunk/ant-import/macros-deploy-metro.xml
Log:
[JBWS-1982] Simplify deploy/undeploy cycles for different stacks
Use jbossws.sar for all stacks
Modified: stack/metro/trunk/ant-import/macros-deploy-metro.xml
===================================================================
--- stack/metro/trunk/ant-import/macros-deploy-metro.xml 2008-02-25 13:18:25 UTC (rev 5796)
+++ stack/metro/trunk/ant-import/macros-deploy-metro.xml 2008-02-25 13:18:38 UTC (rev 5797)
@@ -76,8 +76,8 @@
</fileset>
</copy>
- <mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-metro.sar"/>
- <unjar dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-metro.sar" src="@{stacklibs}/jbossws-metro42.sar"/>
+ <mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-metro42.sar"/>
<mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
<unzip dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
@@ -136,8 +136,8 @@
</fileset>
</copy>
- <mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-metro.sar"/>
- <unjar dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-metro.sar" src="@{stacklibs}/jbossws-metro42.sar"/>
+ <mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-metro42.sar"/>
<mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
<unzip dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
@@ -206,8 +206,8 @@
</fileset>
</copy>
- <mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-metro.sar"/>
- <unjar dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-metro.sar" src="@{stacklibs}/jbossws-metro50.sar"/>
+ <mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-metro50.sar"/>
<mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
<unzip dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
@@ -276,8 +276,8 @@
</fileset>
</copy>
- <mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-metro.sar"/>
- <unjar dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-metro.sar" src="@{stacklibs}/jbossws-metro50.sar"/>
+ <mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-metro50.sar"/>
<mkdir dir="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
<unzip dest="${metro.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
16 years, 10 months
JBossWS SVN: r5796 - stack/cxf/trunk/ant-import.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-02-25 08:18:25 -0500 (Mon, 25 Feb 2008)
New Revision: 5796
Modified:
stack/cxf/trunk/ant-import/macros-deploy-cxf.xml
Log:
[JBWS-1982] Simplify deploy/undeploy cycles for different stacks
Use jbossws.sar for all stacks
Modified: stack/cxf/trunk/ant-import/macros-deploy-cxf.xml
===================================================================
--- stack/cxf/trunk/ant-import/macros-deploy-cxf.xml 2008-02-25 12:55:56 UTC (rev 5795)
+++ stack/cxf/trunk/ant-import/macros-deploy-cxf.xml 2008-02-25 13:18:25 UTC (rev 5796)
@@ -46,8 +46,8 @@
</copy>
<!--SERVER JARS -->
- <mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-cxf.sar"/>
- <unjar dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-cxf.sar" src="@{stacklibs}/jbossws-cxf42.sar"/>
+ <mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-cxf42.sar"/>
<mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
<unzip dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
@@ -110,8 +110,8 @@
</copy>
<!--SERVER JARS -->
- <mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-cxf.sar"/>
- <unjar dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-cxf.sar" src="@{stacklibs}/jbossws-cxf42.sar"/>
+ <mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-cxf42.sar"/>
<mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
<unzip dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
@@ -182,8 +182,8 @@
</fileset>
</copy>
- <mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-cxf.sar"/>
- <unjar dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-cxf.sar" src="@{stacklibs}/jbossws-cxf50.sar"/>
+ <mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-cxf50.sar"/>
<mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
<unzip dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
@@ -254,8 +254,8 @@
</fileset>
</copy>
- <mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-cxf.sar"/>
- <unjar dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws-cxf.sar" src="@{stacklibs}/jbossws-cxf50.sar"/>
+ <mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <unjar dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-cxf50.sar"/>
<mkdir dir="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
<unzip dest="${cxf.output.deploy.dir}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
16 years, 10 months
JBossWS SVN: r5795 - in stack/native/trunk/src: test/java/org/jboss/test/ws/jaxws/xop and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-02-25 07:55:56 -0500 (Mon, 25 Feb 2008)
New Revision: 5795
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
Log:
Fix JBWS-2012: Attachment support for JAX-WS collections
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2008-02-25 12:08:24 UTC (rev 5794)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2008-02-25 12:55:56 UTC (rev 5795)
@@ -30,6 +30,8 @@
import java.awt.*;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
@@ -82,7 +84,9 @@
Class<?> type = field.getType();
boolean exceptionToTheRule = isAttachmentDataType(type);
-
+ if (! exceptionToTheRule) {
+ type = getFieldComponentType(field);
+ }
// only non JDK types are inspected except for byte[] and java.lang.String
if( !alreadyScanned(field) && (exceptionToTheRule || !isJDKType(type)) )
{
@@ -218,6 +222,31 @@
scannedFields.clear();
}
+ /**
+ * In the case of an array T[] or a List<T> returns T, else returns the field type
+ *
+ * @param clazz
+ * @return the type of the field, if the field is an array returns the component type,
+ * if the field is declared as List<T> returns T
+ */
+ private Class<?> getFieldComponentType(Field field) {
+ Class<?> fieldType = field.getType();
+ if (fieldType.isArray()) {
+ return fieldType.getComponentType();
+ } else if (List.class.isAssignableFrom(fieldType)) {
+ if (field.getGenericType() instanceof ParameterizedType) {
+ ParameterizedType paramType = (ParameterizedType) field.getGenericType();
+ if ((paramType.getRawType() instanceof Class) && List.class.isAssignableFrom((Class<?>) paramType.getRawType())) {
+ Type[] actualTypes = paramType.getActualTypeArguments();
+ if (actualTypes.length == 1 && (actualTypes[0] instanceof Class)) {
+ return (Class<?>) actualTypes[0];
+ }
+ }
+ }
+ }
+ return fieldType;
+ }
+
private static boolean isAttachmentDataType(Class clazz) {
for(Class cl : SUPPORTED_TYPES)
{
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2008-02-25 12:08:24 UTC (rev 5794)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2008-02-25 12:55:56 UTC (rev 5795)
@@ -108,6 +108,20 @@
assertFalse("MTOM should be disabled", XOPContext.isMTOMEnabled());
}
+ public void testNestedArray() throws Exception
+ {
+ AttachmentScanResult mimeType = SCANNER.scanBean(NestedArray.class);
+ assertNotNull("Unable to find xop declaration", mimeType);
+ assertEquals("text/plain", mimeType.getMimeType());
+ }
+
+ public void testNestedList() throws Exception
+ {
+ AttachmentScanResult mimeType = SCANNER.scanBean(NestedList.class);
+ assertNotNull("Unable to find xop declaration", mimeType);
+ assertEquals("text/plain", mimeType.getMimeType());
+ }
+
class FieldAnnotation
{
@XmlMimeType("text/xml")
@@ -158,4 +172,12 @@
@XmlMimeType("text/plain")
String data;
}
+
+ class NestedArray {
+ Nested[] nested;
+ }
+
+ class NestedList {
+ List<Nested> nested;
+ }
}
16 years, 10 months