JBossWS SVN: r10376 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/oneway.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-23 12:21:31 -0400 (Thu, 23 Jul 2009)
New Revision: 10376
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/oneway/OneWayTestCase.java
Log:
Trying fix on one-way testcase (intermittent failure in with CXF stack) at the current test impl goes a bit beyond what it's supposed to test
(invokeOneWay is supposed to be non-blocking subject to the capabilities of the underlying protocol)
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/oneway/OneWayTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/oneway/OneWayTestCase.java 2009-07-23 15:54:37 UTC (rev 10375)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/oneway/OneWayTestCase.java 2009-07-23 16:21:31 UTC (rev 10376)
@@ -61,10 +61,13 @@
QName portName = new QName(targetNS, "PingEndpointPort");
Service service = Service.create(wsdlURL, serviceName);
Dispatch dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
-
+
String payload = "<ns1:ping xmlns:ns1='http://oneway.samples.jaxws.ws.test.jboss.org/'/>";
dispatch.invokeOneWay(new StreamSource(new StringReader(payload)));
+ //sleep 3 sec as invokeOneWay is supposed to be non-blocking subject to the capabilities of the underlying protocol
+ Thread.sleep(3000);
+
payload = "<ns1:feedback xmlns:ns1='http://oneway.samples.jaxws.ws.test.jboss.org/'/>";
Source retObj = (Source)dispatch.invoke(new StreamSource(new StringReader(payload)));
14 years, 9 months
JBossWS SVN: r10375 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP: src/main/java/org/jboss/ws/core and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-07-23 11:54:37 -0400 (Thu, 23 Jul 2009)
New Revision: 10375
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl
Removed:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/EndpointInvocation.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
Log:
[JBPAPP-2296] Unable to unmarshall attachment parts where the type is 'application/octet-stream'
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml 2009-07-23 12:49:57 UTC (rev 10374)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml 2009-07-23 15:54:37 UTC (rev 10375)
@@ -665,6 +665,18 @@
<webinf dir="${tests.output.dir}/resources/jaxws/jbws2698/WEB-INF">
<include name="jboss-web.xml"/>
</webinf>
+ </war>
+
+ <!-- jaxws-jbws2706 -->
+ <war warfile="${tests.output.dir}/libs/jaxws-jbws2706.war" webxml="${tests.output.dir}/resources/jaxws/jbws2706/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2706/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2698/JBWS2706TestCase.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/jbws2706/WEB-INF">
+ <include name="wsdl/SwaTestService.wsdl"/>
+ <include name="jboss-web.xml"/>
+ </webinf>
</war>
<!-- jaxws namespace -->
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2009-07-23 12:49:57 UTC (rev 10374)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -21,8 +21,10 @@
*/
package org.jboss.ws.core;
+
// $Id$
+import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
@@ -43,6 +45,7 @@
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.core.utils.MimeUtils.ByteArrayConverter;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.umdm.WrappedParameter;
@@ -247,7 +250,17 @@
{
Class valueType = retValue.getClass();
if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
- throw new SOAPException("javaType [" + javaType.getName() + "] is not assignable from attachment content: " + valueType.getName());
+ {
+ if (retValue instanceof InputStream)
+ {
+ ByteArrayConverter converter = MimeUtils.getConverterForJavaType(javaType);
+ retValue = converter.readFrom((InputStream)retValue);
+ }
+ else
+ {
+ throw new SOAPException("javaType [" + javaType.getName() + "] is not assignable from attachment content: " + valueType.getName());
+ }
+ }
}
}
}
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-07-23 12:49:57 UTC (rev 10374)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -23,10 +23,9 @@
// $Id$
-
-
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -190,7 +189,9 @@
converter = new StringConverter();
else if (JavaUtils.isAssignableFrom(java.io.InputStream.class, targetClazz))
converter = new StreamConverter();
-
+ else if (JavaUtils.isAssignableFrom(byte[].class, targetClazz))
+ converter = new RealByteArrayConverter();
+
if(null == converter)
throw new WSException("No ByteArrayConverter for class: " + targetClazz.getName());
@@ -330,6 +331,49 @@
}
}
+ public static class RealByteArrayConverter implements ByteArrayConverter
+ {
+ public Object readFrom(InputStream in)
+ {
+ Object converted = null;
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IOUtils.copyStream(baos, in);
+
+ in.close();
+
+ converted = baos.toByteArray();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to convert byte[]");
+ }
+
+ return converted;
+ }
+
+ public void writeTo(Object obj, OutputStream out)
+ {
+ if (obj instanceof byte[])
+ {
+ byte[] bytes = (byte[])obj;
+ try
+ {
+ out.write(bytes);
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to convert " + obj.getClass());
+ }
+ }
+ else
+ {
+ throw new WSException("Unable to convert " + obj.getClass());
+ }
+ }
+ }
+
public static class StreamConverter implements ByteArrayConverter
{
public Object readFrom(InputStream in) {
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706 (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for InputRequest complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="InputRequest">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "InputRequest", propOrder = {
- "message"
-})
-public class InputRequest {
-
- @XmlElement(required = true)
- protected String message;
-
- /**
- * Gets the value of the message property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Sets the value of the message property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setMessage(String value) {
- this.message = value;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for InputRequest complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="InputRequest">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "InputRequest", propOrder = {
+ "message"
+})
+public class InputRequest {
+
+ @XmlElement(required = true)
+ protected String message;
+
+ /**
+ * Gets the value of the message property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the value of the message property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMessage(String value) {
+ this.message = value;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Holder;
-import javax.xml.ws.Service;
-import javax.xml.ws.handler.Handler;
-
-import junit.framework.Test;
-
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- * [JBWS-2706] Unable to unmarshall attachment parts where the type is 'application/octet-stream'.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 22nd July 2009
- * @see https://jira.jboss.org/jira/browse/JBWS-2706
- */
-public class JBWS2706TestCase extends JBossWSTest
-{
-
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2706/";
-
- private static SwaTest port;
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS2706TestCase.class, "jaxws-jbws2706.war");
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- QName serviceName = new QName("http://SwaTestService.org/wsdl", "WSIDLSwaTestService");
-
- Service service = Service.create(wsdlURL, serviceName);
- port = service.getPort(SwaTest.class);
- }
-
- public void testCall() throws Exception
- {
- String message = "Howdy";
- InputRequest request = new InputRequest();
- request.setMessage(message);
-
- Holder<String> holderOne = new Holder<String>("One");
- Holder<byte[]> holderTwo = new Holder<byte[]>("Two".getBytes());
-
- OutputResponse response = port.echoMultipleAttachments(request, holderOne, holderTwo);
-
- assertEquals("Response", request.getMessage(), response.getMessage());
- assertEquals("Holder One", "One", holderOne.value);
- assertEquals("Holder Two", "Two", new String(holderTwo.value, "UTF-8"));
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2706] Unable to unmarshall attachment parts where the type is 'application/octet-stream'.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 22nd July 2009
+ * @see https://jira.jboss.org/jira/browse/JBWS-2706
+ */
+public class JBWS2706TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2706/";
+
+ private static SwaTest port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2706TestCase.class, "jaxws-jbws2706.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://SwaTestService.org/wsdl", "WSIDLSwaTestService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port = service.getPort(SwaTest.class);
+ }
+
+ public void testCall() throws Exception
+ {
+ String message = "Howdy";
+ InputRequest request = new InputRequest();
+ request.setMessage(message);
+
+ Holder<String> holderOne = new Holder<String>("One");
+ Holder<byte[]> holderTwo = new Holder<byte[]>("Two".getBytes());
+
+ OutputResponse response = port.echoMultipleAttachments(request, holderOne, holderTwo);
+
+ assertEquals("Response", request.getMessage(), response.getMessage());
+ assertEquals("Holder One", "One", holderOne.value.trim());
+ assertEquals("Holder Two", "Two", new String(holderTwo.value, "UTF-8"));
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the org.jboss.test.ws.jaxws.jbws2706 package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private final static QName _InputRequest_QNAME = new QName("http://SwaTestService.org/xsd", "InputRequest");
- private final static QName _OutputResponse_QNAME = new QName("http://SwaTestService.org/xsd", "OutputResponse");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.jaxws.jbws2706
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link OutputResponse }
- *
- */
- public OutputResponse createOutputResponse() {
- return new OutputResponse();
- }
-
- /**
- * Create an instance of {@link InputRequest }
- *
- */
- public InputRequest createInputRequest() {
- return new InputRequest();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link InputRequest }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "InputRequest")
- public JAXBElement<InputRequest> createInputRequest(InputRequest value) {
- return new JAXBElement<InputRequest>(_InputRequest_QNAME, InputRequest.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link OutputResponse }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "OutputResponse")
- public JAXBElement<OutputResponse> createOutputResponse(OutputResponse value) {
- return new JAXBElement<OutputResponse>(_OutputResponse_QNAME, OutputResponse.class, null, value);
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.test.ws.jaxws.jbws2706 package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _InputRequest_QNAME = new QName("http://SwaTestService.org/xsd", "InputRequest");
+ private final static QName _OutputResponse_QNAME = new QName("http://SwaTestService.org/xsd", "OutputResponse");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.jaxws.jbws2706
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link OutputResponse }
+ *
+ */
+ public OutputResponse createOutputResponse() {
+ return new OutputResponse();
+ }
+
+ /**
+ * Create an instance of {@link InputRequest }
+ *
+ */
+ public InputRequest createInputRequest() {
+ return new InputRequest();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link InputRequest }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "InputRequest")
+ public JAXBElement<InputRequest> createInputRequest(InputRequest value) {
+ return new JAXBElement<InputRequest>(_InputRequest_QNAME, InputRequest.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link OutputResponse }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "OutputResponse")
+ public JAXBElement<OutputResponse> createOutputResponse(OutputResponse value) {
+ return new JAXBElement<OutputResponse>(_OutputResponse_QNAME, OutputResponse.class, null, value);
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for OutputResponse complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="OutputResponse">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "OutputResponse", propOrder = {
- "message"
-})
-public class OutputResponse {
-
- @XmlElement(required = true)
- protected String message;
-
- /**
- * Gets the value of the message property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Sets the value of the message property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setMessage(String value) {
- this.message = value;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for OutputResponse complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="OutputResponse">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "OutputResponse", propOrder = {
+ "message"
+})
+public class OutputResponse {
+
+ @XmlElement(required = true)
+ protected String message;
+
+ /**
+ * Gets the value of the message property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the value of the message property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMessage(String value) {
+ this.message = value;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.ws.Holder;
-
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.1.1-b03-
- * Generated source version: 2.0
- *
- */
-@WebService(name = "SwaTest", targetNamespace = "http://SwaTestService.org/wsdl")
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-public interface SwaTest {
-
-
- /**
- *
- * @param attach1
- * @param attach2
- * @param request
- * @return
- * returns org.jboss.test.ws.jaxws.jbws2706.OutputResponse
- */
- @WebMethod
- @WebResult(name = "OutputResponse", targetNamespace = "http://SwaTestService.org/xsd", partName = "response")
- public OutputResponse echoMultipleAttachments(
- @WebParam(name = "InputRequest", targetNamespace = "http://SwaTestService.org/xsd", partName = "request")
- InputRequest request,
- @WebParam(name = "attach1", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach1")
- Holder<String> attach1,
- @WebParam(name = "attach2", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach2")
- Holder<byte[]> attach2);
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.Holder;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "SwaTest", targetNamespace = "http://SwaTestService.org/wsdl")
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface SwaTest {
+
+
+ /**
+ *
+ * @param attach1
+ * @param attach2
+ * @param request
+ * @return
+ * returns org.jboss.test.ws.jaxws.jbws2706.OutputResponse
+ */
+ @WebMethod
+ @WebResult(name = "OutputResponse", targetNamespace = "http://SwaTestService.org/xsd", partName = "response")
+ public OutputResponse echoMultipleAttachments(
+ @WebParam(name = "InputRequest", targetNamespace = "http://SwaTestService.org/xsd", partName = "request")
+ InputRequest request,
+ @WebParam(name = "attach1", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach1")
+ Holder<String> attach1,
+ @WebParam(name = "attach2", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach2")
+ Holder<byte[]> attach2);
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.jws.WebService;
-import javax.xml.ws.Holder;
-
-@WebService(name = "SwaTest", portName = "SwaTestOnePort", targetNamespace = "http://SwaTestService.org/wsdl", endpointInterface = "org.jboss.test.ws.jaxws.jbws2706.SwaTest", wsdlLocation = "WEB-INF/wsdl/SwaTestService.wsdl")
-public class SwaTestEndpoint implements SwaTest
-{
-
- public OutputResponse echoMultipleAttachments(InputRequest request, Holder<String> attach1, Holder<byte[]> attach2)
- {
- OutputResponse response = new OutputResponse();
- response.setMessage(request.message);
- return response;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+
+@WebService(name = "SwaTest", portName = "SwaTestOnePort", targetNamespace = "http://SwaTestService.org/wsdl", endpointInterface = "org.jboss.test.ws.jaxws.jbws2706.SwaTest", wsdlLocation = "WEB-INF/wsdl/SwaTestService.wsdl")
+public class SwaTestEndpoint implements SwaTest
+{
+
+ public OutputResponse echoMultipleAttachments(InputRequest request, Holder<String> attach1, Holder<byte[]> attach2)
+ {
+ OutputResponse response = new OutputResponse();
+ response.setMessage(request.message);
+ return response;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,23 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.
- */
-(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://SwaTestService.org/xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package org.jboss.test.ws.jaxws.jbws2706;
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,23 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.
+ */
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://SwaTestService.org/xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.jboss.test.ws.jaxws.jbws2706;
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706 (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706)
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
-
-<jboss-web>
- <context-root>/jaxws-jbws2706</context-root>
-</jboss-web>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <context-root>/jaxws-jbws2706</context-root>
+</jboss-web>
\ No newline at end of file
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <servlet>
- <servlet-name>Endpoint</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.jbws2706.SwaTestEndpoint</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>Endpoint</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-
-</web-app>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws2706.SwaTestEndpoint</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl 2009-07-23 15:54:37 UTC (rev 10375)
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions name="SwaTestService"
- targetNamespace="http://SwaTestService.org/wsdl"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://SwaTestService.org/wsdl"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
- xmlns:s="http://SwaTestService.org/xsd"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://SwaTestService.org/xsd"
- xmlns:tns="http://SwaTestService.org/xsd"
- xmlns="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <complexType name="InputRequest">
- <sequence>
- <element name="message" type="string"/>
- </sequence>
- </complexType>
-
- <complexType name="OutputResponse">
- <sequence>
- <element name="message" type="string"/>
- </sequence>
- </complexType>
-
- <element name="InputRequest" type="tns:InputRequest"/>
- <element name="OutputResponse" type="tns:OutputResponse"/>
- </schema>
- </types>
-
- <message name="messageInput">
- <part name="request" element="s:InputRequest"/>
- <part name="attach1" type="xsd:string"/>
- <part name="attach2" type="xsd:base64Binary"/>
- </message>
-
- <message name="messageOutput">
- <part name="response" element="s:OutputResponse"/>
- <part name="attach1" type="xsd:string"/>
- <part name="attach2" type="xsd:base64Binary"/>
- </message>
-
- <portType name="SwaTest">
-
- <operation name="echoMultipleAttachments">
- <input message="tns:messageInput"/>
- <output message="tns:messageOutput"/>
- </operation>
-
- </portType>
-
-
- <binding name="SwaTestSoapBinding" type="tns:SwaTest">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
-
- <operation name="echoMultipleAttachments">
- <soap:operation/>
- <input>
- <mime:multipartRelated>
- <mime:part>
- <soap:body parts="request" use="literal"/>
- </mime:part>
- <mime:part>
- <mime:content part="attach1" type="application/octet-stream"/>
- </mime:part>
- <mime:part>
- <mime:content part="attach2" type="application/octet-stream"/>
- </mime:part>
- </mime:multipartRelated>
- </input>
- <output>
- <mime:multipartRelated>
- <mime:part>
- <soap:body parts="response" use="literal"/>
- </mime:part>
- <mime:part>
- <mime:content part="attach1" type="application/octet-stream"/>
- </mime:part>
- <mime:part>
- <mime:content part="attach2" type="application/octet-stream"/>
- </mime:part>
- </mime:multipartRelated>
- </output>
- </operation>
-
- </binding>
-
- <service name="WSIDLSwaTestService">
-
- <port name="SwaTestOnePort" binding="tns:SwaTestSoapBinding">
- <soap:address location="http://localhost:8080/WSIDLSwaTest/jaxws/SwaTestOne"/>
- </port>
-
- </service>
-
-</definitions>
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl 2009-07-23 15:54:37 UTC (rev 10375)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SwaTestService"
+ targetNamespace="http://SwaTestService.org/wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://SwaTestService.org/wsdl"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:s="http://SwaTestService.org/xsd"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://SwaTestService.org/xsd"
+ xmlns:tns="http://SwaTestService.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <complexType name="InputRequest">
+ <sequence>
+ <element name="message" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="OutputResponse">
+ <sequence>
+ <element name="message" type="string"/>
+ </sequence>
+ </complexType>
+
+ <element name="InputRequest" type="tns:InputRequest"/>
+ <element name="OutputResponse" type="tns:OutputResponse"/>
+ </schema>
+ </types>
+
+ <message name="messageInput">
+ <part name="request" element="s:InputRequest"/>
+ <part name="attach1" type="xsd:string"/>
+ <part name="attach2" type="xsd:base64Binary"/>
+ </message>
+
+ <message name="messageOutput">
+ <part name="response" element="s:OutputResponse"/>
+ <part name="attach1" type="xsd:string"/>
+ <part name="attach2" type="xsd:base64Binary"/>
+ </message>
+
+ <portType name="SwaTest">
+
+ <operation name="echoMultipleAttachments">
+ <input message="tns:messageInput"/>
+ <output message="tns:messageOutput"/>
+ </operation>
+
+ </portType>
+
+
+ <binding name="SwaTestSoapBinding" type="tns:SwaTest">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+
+ <operation name="echoMultipleAttachments">
+ <soap:operation/>
+ <input>
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body parts="request" use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach1" type="application/octet-stream"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach2" type="application/octet-stream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </input>
+ <output>
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body parts="response" use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach1" type="application/octet-stream"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach2" type="application/octet-stream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </output>
+ </operation>
+
+ </binding>
+
+ <service name="WSIDLSwaTestService">
+
+ <port name="SwaTestOnePort" binding="tns:SwaTestSoapBinding">
+ <soap:address location="http://localhost:8080/WSIDLSwaTest/jaxws/SwaTestOne"/>
+ </port>
+
+ </service>
+
+</definitions>
14 years, 9 months
JBossWS SVN: r10374 - in stack/native/branches/jbossws-native-3.1.2/modules: core/src/main/java/org/jboss/ws/core/utils and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-07-23 08:49:57 -0400 (Thu, 23 Jul 2009)
New Revision: 10374
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl
Removed:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBPAPP-2296] Unable to unmarshall attachment parts where the type is 'application/octet-stream'
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2009-07-23 12:49:24 UTC (rev 10373)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.core;
+import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
@@ -41,6 +42,7 @@
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.core.utils.MimeUtils.ByteArrayConverter;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.umdm.WrappedParameter;
@@ -245,7 +247,17 @@
{
Class valueType = retValue.getClass();
if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
- throw new SOAPException("javaType [" + javaType.getName() + "] is not assignable from attachment content: " + valueType.getName());
+ {
+ if (retValue instanceof InputStream)
+ {
+ ByteArrayConverter converter = MimeUtils.getConverterForJavaType(javaType);
+ retValue = converter.readFrom((InputStream)retValue);
+ }
+ else
+ {
+ throw new SOAPException("javaType [" + javaType.getName() + "] is not assignable from attachment content: " + valueType.getName());
+ }
+ }
}
}
}
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-07-23 12:49:24 UTC (rev 10373)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -23,6 +23,7 @@
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -186,7 +187,9 @@
converter = new StringConverter();
else if (JavaUtils.isAssignableFrom(java.io.InputStream.class, targetClazz))
converter = new StreamConverter();
-
+ else if (JavaUtils.isAssignableFrom(byte[].class, targetClazz))
+ converter = new RealByteArrayConverter();
+
if(null == converter)
throw new WSException("No ByteArrayConverter for class: " + targetClazz.getName());
@@ -321,6 +324,49 @@
}
}
+ public static class RealByteArrayConverter implements ByteArrayConverter
+ {
+ public Object readFrom(InputStream in)
+ {
+ Object converted = null;
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IOUtils.copyStream(baos, in);
+
+ in.close();
+
+ converted = baos.toByteArray();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to convert byte[]");
+ }
+
+ return converted;
+ }
+
+ public void writeTo(Object obj, OutputStream out)
+ {
+ if (obj instanceof byte[])
+ {
+ byte[] bytes = (byte[])obj;
+ try
+ {
+ out.write(bytes);
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to convert " + obj.getClass());
+ }
+ }
+ else
+ {
+ throw new WSException("Unable to convert " + obj.getClass());
+ }
+ }
+ }
+
public static class StreamConverter implements ByteArrayConverter
{
public Object readFrom(InputStream in) {
Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-07-23 12:49:24 UTC (rev 10373)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-07-23 12:49:57 UTC (rev 10374)
@@ -571,6 +571,18 @@
<include name="jboss-web.xml"/>
</webinf>
</war>
+
+ <!-- jaxws-jbws2706 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2706.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2706/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2706/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2698/JBWS2706TestCase.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws2706/WEB-INF">
+ <include name="wsdl/SwaTestService.wsdl"/>
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-webserviceref -->
<war warfile="${tests.output.dir}/test-libs/jaxws-webserviceref.war" webxml="${tests.output.dir}/test-resources/jaxws/webserviceref/WEB-INF/web.xml">
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706 (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706)
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for InputRequest complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="InputRequest">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "InputRequest", propOrder = {
- "message"
-})
-public class InputRequest {
-
- @XmlElement(required = true)
- protected String message;
-
- /**
- * Gets the value of the message property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Sets the value of the message property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setMessage(String value) {
- this.message = value;
- }
-
-}
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for InputRequest complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="InputRequest">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "InputRequest", propOrder = {
+ "message"
+})
+public class InputRequest {
+
+ @XmlElement(required = true)
+ protected String message;
+
+ /**
+ * Gets the value of the message property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the value of the message property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMessage(String value) {
+ this.message = value;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Holder;
-import javax.xml.ws.Service;
-import javax.xml.ws.handler.Handler;
-
-import junit.framework.Test;
-
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- * [JBWS-2706] Unable to unmarshall attachment parts where the type is 'application/octet-stream'.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 22nd July 2009
- * @see https://jira.jboss.org/jira/browse/JBWS-2706
- */
-public class JBWS2706TestCase extends JBossWSTest
-{
-
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2706/";
-
- private static SwaTest port;
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS2706TestCase.class, "jaxws-jbws2706.war");
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- QName serviceName = new QName("http://SwaTestService.org/wsdl", "WSIDLSwaTestService");
-
- Service service = Service.create(wsdlURL, serviceName);
- port = service.getPort(SwaTest.class);
- }
-
- public void testCall() throws Exception
- {
- String message = "Howdy";
- InputRequest request = new InputRequest();
- request.setMessage(message);
-
- Holder<String> holderOne = new Holder<String>("One");
- Holder<byte[]> holderTwo = new Holder<byte[]>("Two".getBytes());
-
- OutputResponse response = port.echoMultipleAttachments(request, holderOne, holderTwo);
-
- assertEquals("Response", request.getMessage(), response.getMessage());
- assertEquals("Holder One", "One", holderOne.value);
- assertEquals("Holder Two", "Two", new String(holderTwo.value, "UTF-8"));
- }
-
-}
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Holder;
+import javax.xml.ws.Service;
+import javax.xml.ws.handler.Handler;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2706] Unable to unmarshall attachment parts where the type is 'application/octet-stream'.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 22nd July 2009
+ * @see https://jira.jboss.org/jira/browse/JBWS-2706
+ */
+public class JBWS2706TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2706/";
+
+ private static SwaTest port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2706TestCase.class, "jaxws-jbws2706.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://SwaTestService.org/wsdl", "WSIDLSwaTestService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port = service.getPort(SwaTest.class);
+ }
+
+ public void testCall() throws Exception
+ {
+ String message = "Howdy";
+ InputRequest request = new InputRequest();
+ request.setMessage(message);
+
+ Holder<String> holderOne = new Holder<String>("One");
+ Holder<byte[]> holderTwo = new Holder<byte[]>("Two".getBytes());
+
+ OutputResponse response = port.echoMultipleAttachments(request, holderOne, holderTwo);
+
+ assertEquals("Response", request.getMessage(), response.getMessage());
+ assertEquals("Holder One", "One", holderOne.value);
+ assertEquals("Holder Two", "Two", new String(holderTwo.value, "UTF-8"));
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the org.jboss.test.ws.jaxws.jbws2706 package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private final static QName _InputRequest_QNAME = new QName("http://SwaTestService.org/xsd", "InputRequest");
- private final static QName _OutputResponse_QNAME = new QName("http://SwaTestService.org/xsd", "OutputResponse");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.jaxws.jbws2706
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link OutputResponse }
- *
- */
- public OutputResponse createOutputResponse() {
- return new OutputResponse();
- }
-
- /**
- * Create an instance of {@link InputRequest }
- *
- */
- public InputRequest createInputRequest() {
- return new InputRequest();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link InputRequest }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "InputRequest")
- public JAXBElement<InputRequest> createInputRequest(InputRequest value) {
- return new JAXBElement<InputRequest>(_InputRequest_QNAME, InputRequest.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link OutputResponse }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "OutputResponse")
- public JAXBElement<OutputResponse> createOutputResponse(OutputResponse value) {
- return new JAXBElement<OutputResponse>(_OutputResponse_QNAME, OutputResponse.class, null, value);
- }
-
-}
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.test.ws.jaxws.jbws2706 package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _InputRequest_QNAME = new QName("http://SwaTestService.org/xsd", "InputRequest");
+ private final static QName _OutputResponse_QNAME = new QName("http://SwaTestService.org/xsd", "OutputResponse");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.jaxws.jbws2706
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link OutputResponse }
+ *
+ */
+ public OutputResponse createOutputResponse() {
+ return new OutputResponse();
+ }
+
+ /**
+ * Create an instance of {@link InputRequest }
+ *
+ */
+ public InputRequest createInputRequest() {
+ return new InputRequest();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link InputRequest }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "InputRequest")
+ public JAXBElement<InputRequest> createInputRequest(InputRequest value) {
+ return new JAXBElement<InputRequest>(_InputRequest_QNAME, InputRequest.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link OutputResponse }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "OutputResponse")
+ public JAXBElement<OutputResponse> createOutputResponse(OutputResponse value) {
+ return new JAXBElement<OutputResponse>(_OutputResponse_QNAME, OutputResponse.class, null, value);
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for OutputResponse complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="OutputResponse">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "OutputResponse", propOrder = {
- "message"
-})
-public class OutputResponse {
-
- @XmlElement(required = true)
- protected String message;
-
- /**
- * Gets the value of the message property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Sets the value of the message property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setMessage(String value) {
- this.message = value;
- }
-
-}
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for OutputResponse complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="OutputResponse">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "OutputResponse", propOrder = {
+ "message"
+})
+public class OutputResponse {
+
+ @XmlElement(required = true)
+ protected String message;
+
+ /**
+ * Gets the value of the message property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the value of the message property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMessage(String value) {
+ this.message = value;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.ws.Holder;
-
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.1.1-b03-
- * Generated source version: 2.0
- *
- */
-@WebService(name = "SwaTest", targetNamespace = "http://SwaTestService.org/wsdl")
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-public interface SwaTest {
-
-
- /**
- *
- * @param attach1
- * @param attach2
- * @param request
- * @return
- * returns org.jboss.test.ws.jaxws.jbws2706.OutputResponse
- */
- @WebMethod
- @WebResult(name = "OutputResponse", targetNamespace = "http://SwaTestService.org/xsd", partName = "response")
- public OutputResponse echoMultipleAttachments(
- @WebParam(name = "InputRequest", targetNamespace = "http://SwaTestService.org/xsd", partName = "request")
- InputRequest request,
- @WebParam(name = "attach1", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach1")
- Holder<String> attach1,
- @WebParam(name = "attach2", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach2")
- Holder<byte[]> attach2);
-
-}
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.Holder;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "SwaTest", targetNamespace = "http://SwaTestService.org/wsdl")
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface SwaTest {
+
+
+ /**
+ *
+ * @param attach1
+ * @param attach2
+ * @param request
+ * @return
+ * returns org.jboss.test.ws.jaxws.jbws2706.OutputResponse
+ */
+ @WebMethod
+ @WebResult(name = "OutputResponse", targetNamespace = "http://SwaTestService.org/xsd", partName = "response")
+ public OutputResponse echoMultipleAttachments(
+ @WebParam(name = "InputRequest", targetNamespace = "http://SwaTestService.org/xsd", partName = "request")
+ InputRequest request,
+ @WebParam(name = "attach1", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach1")
+ Holder<String> attach1,
+ @WebParam(name = "attach2", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach2")
+ Holder<byte[]> attach2);
+
+}
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
-
-import javax.jws.WebService;
-import javax.xml.ws.Holder;
-
-@WebService(name = "SwaTest", portName = "SwaTestOnePort", targetNamespace = "http://SwaTestService.org/wsdl", endpointInterface = "org.jboss.test.ws.jaxws.jbws2706.SwaTest", wsdlLocation = "WEB-INF/wsdl/SwaTestService.wsdl")
-public class SwaTestEndpoint implements SwaTest
-{
-
- public OutputResponse echoMultipleAttachments(InputRequest request, Holder<String> attach1, Holder<byte[]> attach2)
- {
- OutputResponse response = new OutputResponse();
- response.setMessage(request.message);
- return response;
- }
-
-}
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+
+@WebService(name = "SwaTest", portName = "SwaTestOnePort", targetNamespace = "http://SwaTestService.org/wsdl", endpointInterface = "org.jboss.test.ws.jaxws.jbws2706.SwaTest", wsdlLocation = "WEB-INF/wsdl/SwaTestService.wsdl")
+public class SwaTestEndpoint implements SwaTest
+{
+
+ public OutputResponse echoMultipleAttachments(InputRequest request, Holder<String> attach1, Holder<byte[]> attach2)
+ {
+ OutputResponse response = new OutputResponse();
+ response.setMessage(request.message);
+ return response;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,23 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.
- */
-(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://SwaTestService.org/xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package org.jboss.test.ws.jaxws.jbws2706;
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,23 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.
+ */
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://SwaTestService.org/xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.jboss.test.ws.jaxws.jbws2706;
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706 (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706)
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF)
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
-
-<jboss-web>
- <context-root>/jaxws-jbws2706</context-root>
-</jboss-web>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <context-root>/jaxws-jbws2706</context-root>
+</jboss-web>
\ No newline at end of file
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <servlet>
- <servlet-name>Endpoint</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.jbws2706.SwaTestEndpoint</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>Endpoint</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-
-</web-app>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws2706.SwaTestEndpoint</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl)
Deleted: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl 2009-07-23 10:25:07 UTC (rev 10372)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl 2009-07-23 12:49:57 UTC (rev 10374)
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions name="SwaTestService"
- targetNamespace="http://SwaTestService.org/wsdl"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://SwaTestService.org/wsdl"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
- xmlns:s="http://SwaTestService.org/xsd"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://SwaTestService.org/xsd"
- xmlns:tns="http://SwaTestService.org/xsd"
- xmlns="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <complexType name="InputRequest">
- <sequence>
- <element name="message" type="string"/>
- </sequence>
- </complexType>
-
- <complexType name="OutputResponse">
- <sequence>
- <element name="message" type="string"/>
- </sequence>
- </complexType>
-
- <element name="InputRequest" type="tns:InputRequest"/>
- <element name="OutputResponse" type="tns:OutputResponse"/>
- </schema>
- </types>
-
- <message name="messageInput">
- <part name="request" element="s:InputRequest"/>
- <part name="attach1" type="xsd:string"/>
- <part name="attach2" type="xsd:base64Binary"/>
- </message>
-
- <message name="messageOutput">
- <part name="response" element="s:OutputResponse"/>
- <part name="attach1" type="xsd:string"/>
- <part name="attach2" type="xsd:base64Binary"/>
- </message>
-
- <portType name="SwaTest">
-
- <operation name="echoMultipleAttachments">
- <input message="tns:messageInput"/>
- <output message="tns:messageOutput"/>
- </operation>
-
- </portType>
-
-
- <binding name="SwaTestSoapBinding" type="tns:SwaTest">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
-
- <operation name="echoMultipleAttachments">
- <soap:operation/>
- <input>
- <mime:multipartRelated>
- <mime:part>
- <soap:body parts="request" use="literal"/>
- </mime:part>
- <mime:part>
- <mime:content part="attach1" type="application/octet-stream"/>
- </mime:part>
- <mime:part>
- <mime:content part="attach2" type="application/octet-stream"/>
- </mime:part>
- </mime:multipartRelated>
- </input>
- <output>
- <mime:multipartRelated>
- <mime:part>
- <soap:body parts="response" use="literal"/>
- </mime:part>
- <mime:part>
- <mime:content part="attach1" type="application/octet-stream"/>
- </mime:part>
- <mime:part>
- <mime:content part="attach2" type="application/octet-stream"/>
- </mime:part>
- </mime:multipartRelated>
- </output>
- </operation>
-
- </binding>
-
- <service name="WSIDLSwaTestService">
-
- <port name="SwaTestOnePort" binding="tns:SwaTestSoapBinding">
- <soap:address location="http://localhost:8080/WSIDLSwaTest/jaxws/SwaTestOne"/>
- </port>
-
- </service>
-
-</definitions>
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl (from rev 10372, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl 2009-07-23 12:49:57 UTC (rev 10374)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SwaTestService"
+ targetNamespace="http://SwaTestService.org/wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://SwaTestService.org/wsdl"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:s="http://SwaTestService.org/xsd"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://SwaTestService.org/xsd"
+ xmlns:tns="http://SwaTestService.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <complexType name="InputRequest">
+ <sequence>
+ <element name="message" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="OutputResponse">
+ <sequence>
+ <element name="message" type="string"/>
+ </sequence>
+ </complexType>
+
+ <element name="InputRequest" type="tns:InputRequest"/>
+ <element name="OutputResponse" type="tns:OutputResponse"/>
+ </schema>
+ </types>
+
+ <message name="messageInput">
+ <part name="request" element="s:InputRequest"/>
+ <part name="attach1" type="xsd:string"/>
+ <part name="attach2" type="xsd:base64Binary"/>
+ </message>
+
+ <message name="messageOutput">
+ <part name="response" element="s:OutputResponse"/>
+ <part name="attach1" type="xsd:string"/>
+ <part name="attach2" type="xsd:base64Binary"/>
+ </message>
+
+ <portType name="SwaTest">
+
+ <operation name="echoMultipleAttachments">
+ <input message="tns:messageInput"/>
+ <output message="tns:messageOutput"/>
+ </operation>
+
+ </portType>
+
+
+ <binding name="SwaTestSoapBinding" type="tns:SwaTest">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+
+ <operation name="echoMultipleAttachments">
+ <soap:operation/>
+ <input>
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body parts="request" use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach1" type="application/octet-stream"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach2" type="application/octet-stream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </input>
+ <output>
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body parts="response" use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach1" type="application/octet-stream"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach2" type="application/octet-stream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </output>
+ </operation>
+
+ </binding>
+
+ <service name="WSIDLSwaTestService">
+
+ <port name="SwaTestOnePort" binding="tns:SwaTestSoapBinding">
+ <soap:address location="http://localhost:8080/WSIDLSwaTest/jaxws/SwaTestOne"/>
+ </port>
+
+ </service>
+
+</definitions>
14 years, 9 months
JBossWS SVN: r10373 - in container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration: metadata and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-23 08:49:24 -0400 (Thu, 23 Jul 2009)
New Revision: 10373
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java
Log:
[JBWS-2332] refactoring + fixing javadocs
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -122,5 +122,18 @@
this.aspect.stop( dep );
}
}
+
+ /**
+ * Displays also WS deployment aspect being used.
+ *
+ * @return deployer instance id including wrapped deployment aspect id.
+ */
+ @Override
+ public String toString()
+ {
+ final StringBuilder sb = new StringBuilder();
+ sb.append( super.toString() ).append( '(' ).append( this.aspect ).append( ')' );
+ return sb.toString();
+ }
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -92,6 +92,7 @@
* Creates new Web Service deployment and registers it with deployment unit.
*
* @param unit deployment unit
+ * @throws DeploymentException if error occurs
*/
@Override
protected void internalDeploy( final DeploymentUnit unit ) throws DeploymentException
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -44,6 +44,9 @@
/**
* Model factory generator.
+ *
+ * @param root object tree root
+ * @return object model factory
*/
@Override
protected ObjectModelFactory getObjectModelFactory( final WebservicesMetaData root )
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -70,26 +70,29 @@
/**
* Deploys WebServiceDeployment meta data.
+ *
+ * @param unit deployment unit
+ * @throws DeploymentException exception
*/
@Override
protected void internalDeploy( final DeploymentUnit unit ) throws DeploymentException
{
- final JBossMetaData mergedMD = ( JBossMetaData )unit.getAttachment(
+ final JBossMetaData mergedMD = ( JBossMetaData ) unit.getAttachment(
MergedJBossMetaDataDeployer.EJB_MERGED_ATTACHMENT_NAME
);
final Ejb3Deployment ejb3Deployment = unit.getAttachment( Ejb3Deployment.class );
- if( mergedMD != null )
+ if ( mergedMD != null )
{
final WebServiceDeploymentAdapter wsDeploymentAdapter = new WebServiceDeploymentAdapter();
final Iterator< JBossEnterpriseBeanMetaData > ejbIterator = mergedMD.getEnterpriseBeans().iterator();
- while( ejbIterator.hasNext() )
+ while ( ejbIterator.hasNext() )
{
final JBossEnterpriseBeanMetaData ejbMD = ejbIterator.next();
final EJBContainer ejbContainer = this.getContainer( ejb3Deployment, ejbMD );
- if( ejbMD.getEjbClass() != null )
+ if ( ejbMD.getEjbClass() != null )
{
wsDeploymentAdapter.getServiceEndpoints().add(
new WebServiceDeclarationAdapter( ejbMD, ejbContainer, unit.getClassLoader() )
@@ -114,9 +117,9 @@
* @throws DeploymentException if some error occurs
*/
private EJBContainer getContainer( final Ejb3Deployment ejb3Deployment, final JBossEnterpriseBeanMetaData ejbMD )
- throws DeploymentException
+ throws DeploymentException
{
- if ( ( ejb3Deployment != null ) && ( ejbMD.isEntity() == false ) )
+ if ( ( ejb3Deployment != null ) && ( !ejbMD.isEntity() ) )
{
try
{
@@ -136,11 +139,14 @@
* Adopts EJB3 bean meta data to a
* {@link org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration}.
*/
- private static class WebServiceDeclarationAdapter implements WebServiceDeclaration
+ private static final class WebServiceDeclarationAdapter implements WebServiceDeclaration
{
+ /** EJB meta data. */
private final JBossEnterpriseBeanMetaData ejbMetaData;
+ /** EJB container. */
private final EJBContainer ejbContainer;
+ /** Class loader. */
private final ClassLoader loader;
/**
@@ -187,7 +193,7 @@
/**
* Returns EJB name.
*
- * @returns name
+ * @return name
*/
public String getComponentName()
{
@@ -207,6 +213,8 @@
/**
* Returns requested annotation associated with EJB container or EJB bean.
*
+ * @param annotationType annotation type
+ * @param <T> annotation class type
* @return requested annotation or null if not found
*/
public < T extends Annotation > T getAnnotation( final Class<T> annotationType )
@@ -246,22 +254,30 @@
/**
* Adopts an EJB deployment to a
- * {@link org.jboss.wsf.spi.deployment.integration.WebServiceDeployment}
+ * {@link org.jboss.wsf.spi.deployment.integration.WebServiceDeployment}.
*/
- private static class WebServiceDeploymentAdapter implements WebServiceDeployment
+ private static final class WebServiceDeploymentAdapter implements WebServiceDeployment
{
/** List of endpoints. */
private final List< WebServiceDeclaration > endpoints = new ArrayList< WebServiceDeclaration >();
/**
+ * Constructor.
+ */
+ private WebServiceDeploymentAdapter()
+ {
+ super();
+ }
+
+ /**
* Returns endpoints list.
*
* @return endpoints list
*/
public List< WebServiceDeclaration > getServiceEndpoints()
{
- return endpoints;
+ return this.endpoints;
}
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -25,57 +25,64 @@
import org.jboss.virtual.VisitorAttributes;
/**
- * VirtualFileFilter that can be used to search/filter files with the
- * suffix ".wsdl" and ".xsd".
- * <p/>
+ * WS file filter for files with the '.wsdl', or '.xsd' or '.xml' suffix.
*
* @author <a href="mailto:dbevenius@jboss.com">Daniel Bevenius</a>
- *
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
-public class WSVirtualFileFilter implements VirtualFileFilterWithAttributes
+public final class WSVirtualFileFilter implements VirtualFileFilterWithAttributes
{
- /** The attributes */
+
+ /** The tree walking attributes. */
private VisitorAttributes attributes;
/**
- * No-args constructor.
- *
- * Will create a recursive filter by setting {@link VisitorAttributes#RECURSE_LEAVES_ONLY}.
+ * Constructor.
*/
public WSVirtualFileFilter()
{
- this(VisitorAttributes.RECURSE_LEAVES_ONLY);
+ this( VisitorAttributes.RECURSE_LEAVES_ONLY );
}
/**
+ * Constructor.
*
- * @param attributes The {@link VisitorAttributes} value which determines the recursive behaviour of this filter.
+ * @param attributes visit attributes
*/
- public WSVirtualFileFilter(final VisitorAttributes attributes)
+ public WSVirtualFileFilter( final VisitorAttributes attributes )
{
this.attributes = attributes;
}
/**
- * Retrieves the VisitorAttribute for this instance.
+ * Gets VisitorAttributes for this instance.
+ *
+ * @return visitor attributes
*/
public VisitorAttributes getAttributes()
{
- return attributes;
+ return this.attributes;
}
/**
- * Accepts files that end with .wsdl and .xsd.
- *
- * @return {@code true} If the file name ends with either .wsdl or .xsd. Otherwise returns false.
+ * Accepts files that end with '.wsdl' or '.xsd' or '.xml'.
+ *
+ * @param file to analyze
+ * @return true if expected file extension, false otherwise
*/
- public boolean accepts(final VirtualFile file)
+ public boolean accepts( final VirtualFile file )
{
- if (file == null)
+ if ( file == null )
+ {
return false;
+ }
- final String fileName = file.getName();
- return fileName.endsWith(".wsdl") || fileName.endsWith(".xsd") || fileName.endsWith(".xml");
+ final String fileName = file.getName().toLowerCase();
+ final boolean hasWsdlSuffix = fileName.endsWith( ".wsdl" );
+ final boolean hasXsdSuffix = fileName.endsWith( ".xsd" );
+ final boolean hasXmlSuffix = fileName.endsWith( ".xml" );
+
+ return hasWsdlSuffix || hasXsdSuffix || hasXmlSuffix;
}
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -35,26 +35,43 @@
*/
public final class ContainerMetaDataBuilder
{
-
+
+ /** JSE meta data builder. */
private JSEMetaDataBuilder jseMetaDataBuilder = new JSEMetaDataBuilder();
+ /** EJB3 meta data builder. */
private EJB3MetaDataBuilder ejb3MetaDataBuilder = new EJB3MetaDataBuilder();
+ /** EJB21 meta data builder. */
private EJB21MetaDataBuilder ejb21MetaDataBuilder = new EJB21MetaDataBuilder();
+ /**
+ * Constructor.
+ */
+ public ContainerMetaDataBuilder()
+ {
+ super();
+ }
+
+ /**
+ * Creates container independent meta data and deploys it to <b>dep</b>.
+ *
+ * @param dep webservice deployment
+ * @param unit deployment unit
+ */
public void create( final Deployment dep, final DeploymentUnit unit )
{
if ( Helper.isJseDeployment( unit ) )
{
- final JSEArchiveMetaData jseMetaData = jseMetaDataBuilder.create( dep, unit );
+ final JSEArchiveMetaData jseMetaData = this.jseMetaDataBuilder.create( dep, unit );
dep.addAttachment( JSEArchiveMetaData.class, jseMetaData );
}
else if ( Helper.isJaxwsEjbDeployment( unit ) )
{
- final EJBArchiveMetaData ejbMetaData = ejb3MetaDataBuilder.create( dep, unit );
+ final EJBArchiveMetaData ejbMetaData = this.ejb3MetaDataBuilder.create( dep, unit );
dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
}
else if ( Helper.isJaxrpcEjbDeployment( unit ) )
{
- final EJBArchiveMetaData ejbMetaData = ejb21MetaDataBuilder.create( dep, unit );
+ final EJBArchiveMetaData ejbMetaData = this.ejb21MetaDataBuilder.create( dep, unit );
dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
}
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -34,13 +34,32 @@
public final class ContainerMetaDataDeploymentAspect extends DeploymentAspect
{
+ /** Container independent meta data builder. */
private ContainerMetaDataBuilder metaDataBuilder;
+ /**
+ * Constructor.
+ */
+ public ContainerMetaDataDeploymentAspect()
+ {
+ super();
+ }
+
+ /**
+ * Sets container independent meta data builder via MC injection.
+ *
+ * @param builder meta data builder
+ */
public void setMetaDataBuilder( final ContainerMetaDataBuilder builder )
{
this.metaDataBuilder = builder;
}
+ /**
+ * Build container independent meta data.
+ *
+ * @param dep webservice deployment
+ */
@Override
public void start( final Deployment dep )
{
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -48,7 +48,6 @@
* Builds container independent meta data from EJB21 container meta data.
*
* @author Thomas.Diesler(a)jboss.org
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
final class EJB21MetaDataBuilder
{
@@ -160,8 +159,6 @@
targetBean.setEjbName(jbossMessageBean.getEjbName());
targetBean.setEjbClass(jbossMessageBean.getEjbClass());
- //targetBean.setServiceEndpointInterface(???);
- //targetBean.setJndiName(???);
targetBean.setLocalJndiName(jbossBeansMetaData.getLocalJndiName());
((MDBMetaData)targetBean).setDestinationJndiName(jbossMessageBean.getDestinationJndiName());
}
@@ -171,4 +168,5 @@
return targetBean;
}
+
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -43,7 +43,6 @@
* Builds container independent meta data from EJB3 container meta data.
*
* @author Thomas.Diesler(a)jboss.org
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
final class EJB3MetaDataBuilder
{
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java 2009-07-23 10:25:07 UTC (rev 10372)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java 2009-07-23 12:49:24 UTC (rev 10373)
@@ -51,7 +51,6 @@
* Builds container independent meta data from WEB container meta data.
*
* @author Thomas.Diesler(a)jboss.org
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
final class JSEMetaDataBuilder
{
14 years, 9 months
JBossWS SVN: r10372 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/core/utils and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-07-23 06:25:07 -0400 (Thu, 23 Jul 2009)
New Revision: 10372
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBWS-2706] Unable to unmarshall attachment parts where the type is 'application/octet-stream'
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2009-07-23 09:54:16 UTC (rev 10371)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2009-07-23 10:25:07 UTC (rev 10372)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.core;
+import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
@@ -41,6 +42,7 @@
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.core.utils.MimeUtils.ByteArrayConverter;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.umdm.WrappedParameter;
@@ -245,7 +247,17 @@
{
Class valueType = retValue.getClass();
if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
- throw new SOAPException("javaType [" + javaType.getName() + "] is not assignable from attachment content: " + valueType.getName());
+ {
+ if (retValue instanceof InputStream)
+ {
+ ByteArrayConverter converter = MimeUtils.getConverterForJavaType(javaType);
+ retValue = converter.readFrom((InputStream)retValue);
+ }
+ else
+ {
+ throw new SOAPException("javaType [" + javaType.getName() + "] is not assignable from attachment content: " + valueType.getName());
+ }
+ }
}
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-07-23 09:54:16 UTC (rev 10371)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-07-23 10:25:07 UTC (rev 10372)
@@ -22,6 +22,7 @@
package org.jboss.ws.core.utils;
import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -185,7 +186,9 @@
converter = new StringConverter();
else if (JavaUtils.isAssignableFrom(java.io.InputStream.class, targetClazz))
converter = new StreamConverter();
-
+ else if (JavaUtils.isAssignableFrom(byte[].class, targetClazz))
+ converter = new RealByteArrayConverter();
+
if(null == converter)
throw new WSException("No ByteArrayConverter for class: " + targetClazz.getName());
@@ -325,6 +328,49 @@
}
}
+ public static class RealByteArrayConverter implements ByteArrayConverter
+ {
+ public Object readFrom(InputStream in)
+ {
+ Object converted = null;
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IOUtils.copyStream(baos, in);
+
+ in.close();
+
+ converted = baos.toByteArray();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to convert byte[]");
+ }
+
+ return converted;
+ }
+
+ public void writeTo(Object obj, OutputStream out)
+ {
+ if (obj instanceof byte[])
+ {
+ byte[] bytes = (byte[])obj;
+ try
+ {
+ out.write(bytes);
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to convert " + obj.getClass());
+ }
+ }
+ else
+ {
+ throw new WSException("Unable to convert " + obj.getClass());
+ }
+ }
+ }
+
public static class StreamConverter implements ByteArrayConverter
{
public Object readFrom(InputStream in) {
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-07-23 09:54:16 UTC (rev 10371)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-07-23 10:25:07 UTC (rev 10372)
@@ -583,6 +583,18 @@
<include name="jboss-web.xml"/>
</webinf>
</war>
+
+ <!-- jaxws-jbws2706 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2706.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2706/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2706/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2698/JBWS2706TestCase.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws2706/WEB-INF">
+ <include name="wsdl/SwaTestService.wsdl"/>
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-webserviceref -->
<war warfile="${tests.output.dir}/test-libs/jaxws-webserviceref.war" webxml="${tests.output.dir}/test-resources/jaxws/webserviceref/WEB-INF/web.xml">
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for InputRequest complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="InputRequest">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "InputRequest", propOrder = {
+ "message"
+})
+public class InputRequest {
+
+ @XmlElement(required = true)
+ protected String message;
+
+ /**
+ * Gets the value of the message property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the value of the message property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMessage(String value) {
+ this.message = value;
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/InputRequest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Holder;
+import javax.xml.ws.Service;
+import javax.xml.ws.handler.Handler;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2706] Unable to unmarshall attachment parts where the type is 'application/octet-stream'.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 22nd July 2009
+ * @see https://jira.jboss.org/jira/browse/JBWS-2706
+ */
+public class JBWS2706TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2706/";
+
+ private static SwaTest port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2706TestCase.class, "jaxws-jbws2706.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://SwaTestService.org/wsdl", "WSIDLSwaTestService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port = service.getPort(SwaTest.class);
+ }
+
+ public void testCall() throws Exception
+ {
+ String message = "Howdy";
+ InputRequest request = new InputRequest();
+ request.setMessage(message);
+
+ Holder<String> holderOne = new Holder<String>("One");
+ Holder<byte[]> holderTwo = new Holder<byte[]>("Two".getBytes());
+
+ OutputResponse response = port.echoMultipleAttachments(request, holderOne, holderTwo);
+
+ assertEquals("Response", request.getMessage(), response.getMessage());
+ assertEquals("Holder One", "One", holderOne.value);
+ assertEquals("Holder Two", "Two", new String(holderTwo.value, "UTF-8"));
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/JBWS2706TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.test.ws.jaxws.jbws2706 package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _InputRequest_QNAME = new QName("http://SwaTestService.org/xsd", "InputRequest");
+ private final static QName _OutputResponse_QNAME = new QName("http://SwaTestService.org/xsd", "OutputResponse");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.jaxws.jbws2706
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link OutputResponse }
+ *
+ */
+ public OutputResponse createOutputResponse() {
+ return new OutputResponse();
+ }
+
+ /**
+ * Create an instance of {@link InputRequest }
+ *
+ */
+ public InputRequest createInputRequest() {
+ return new InputRequest();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link InputRequest }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "InputRequest")
+ public JAXBElement<InputRequest> createInputRequest(InputRequest value) {
+ return new JAXBElement<InputRequest>(_InputRequest_QNAME, InputRequest.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link OutputResponse }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://SwaTestService.org/xsd", name = "OutputResponse")
+ public JAXBElement<OutputResponse> createOutputResponse(OutputResponse value) {
+ return new JAXBElement<OutputResponse>(_OutputResponse_QNAME, OutputResponse.class, null, value);
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/ObjectFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for OutputResponse complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="OutputResponse">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "OutputResponse", propOrder = {
+ "message"
+})
+public class OutputResponse {
+
+ @XmlElement(required = true)
+ protected String message;
+
+ /**
+ * Gets the value of the message property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the value of the message property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMessage(String value) {
+ this.message = value;
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/OutputResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.Holder;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "SwaTest", targetNamespace = "http://SwaTestService.org/wsdl")
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface SwaTest {
+
+
+ /**
+ *
+ * @param attach1
+ * @param attach2
+ * @param request
+ * @return
+ * returns org.jboss.test.ws.jaxws.jbws2706.OutputResponse
+ */
+ @WebMethod
+ @WebResult(name = "OutputResponse", targetNamespace = "http://SwaTestService.org/xsd", partName = "response")
+ public OutputResponse echoMultipleAttachments(
+ @WebParam(name = "InputRequest", targetNamespace = "http://SwaTestService.org/xsd", partName = "request")
+ InputRequest request,
+ @WebParam(name = "attach1", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach1")
+ Holder<String> attach1,
+ @WebParam(name = "attach2", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "attach2")
+ Holder<byte[]> attach2);
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jbws2706;
+
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+
+@WebService(name = "SwaTest", portName = "SwaTestOnePort", targetNamespace = "http://SwaTestService.org/wsdl", endpointInterface = "org.jboss.test.ws.jaxws.jbws2706.SwaTest", wsdlLocation = "WEB-INF/wsdl/SwaTestService.wsdl")
+public class SwaTestEndpoint implements SwaTest
+{
+
+ public OutputResponse echoMultipleAttachments(InputRequest request, Holder<String> attach1, Holder<byte[]> attach2)
+ {
+ OutputResponse response = new OutputResponse();
+ response.setMessage(request.message);
+ return response;
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/SwaTestEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,23 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.
+ */
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://SwaTestService.org/xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.jboss.test.ws.jaxws.jbws2706;
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2706/package-info.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <context-root>/jaxws-jbws2706</context-root>
+</jboss-web>
\ No newline at end of file
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws2706.SwaTestEndpoint</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl 2009-07-23 10:25:07 UTC (rev 10372)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SwaTestService"
+ targetNamespace="http://SwaTestService.org/wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://SwaTestService.org/wsdl"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:s="http://SwaTestService.org/xsd"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://SwaTestService.org/xsd"
+ xmlns:tns="http://SwaTestService.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <complexType name="InputRequest">
+ <sequence>
+ <element name="message" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="OutputResponse">
+ <sequence>
+ <element name="message" type="string"/>
+ </sequence>
+ </complexType>
+
+ <element name="InputRequest" type="tns:InputRequest"/>
+ <element name="OutputResponse" type="tns:OutputResponse"/>
+ </schema>
+ </types>
+
+ <message name="messageInput">
+ <part name="request" element="s:InputRequest"/>
+ <part name="attach1" type="xsd:string"/>
+ <part name="attach2" type="xsd:base64Binary"/>
+ </message>
+
+ <message name="messageOutput">
+ <part name="response" element="s:OutputResponse"/>
+ <part name="attach1" type="xsd:string"/>
+ <part name="attach2" type="xsd:base64Binary"/>
+ </message>
+
+ <portType name="SwaTest">
+
+ <operation name="echoMultipleAttachments">
+ <input message="tns:messageInput"/>
+ <output message="tns:messageOutput"/>
+ </operation>
+
+ </portType>
+
+
+ <binding name="SwaTestSoapBinding" type="tns:SwaTest">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+
+ <operation name="echoMultipleAttachments">
+ <soap:operation/>
+ <input>
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body parts="request" use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach1" type="application/octet-stream"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach2" type="application/octet-stream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </input>
+ <output>
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body parts="response" use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach1" type="application/octet-stream"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="attach2" type="application/octet-stream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </output>
+ </operation>
+
+ </binding>
+
+ <service name="WSIDLSwaTestService">
+
+ <port name="SwaTestOnePort" binding="tns:SwaTestSoapBinding">
+ <soap:address location="http://localhost:8080/WSIDLSwaTest/jaxws/SwaTestOne"/>
+ </port>
+
+ </service>
+
+</definitions>
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2706/WEB-INF/wsdl/SwaTestService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
14 years, 9 months
JBossWS SVN: r10371 - in container/jboss50/branches/ropalka-jboss510/src/main: java/org/jboss/webservices/integration/config and 8 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-23 05:54:16 -0400 (Thu, 23 Jul 2009)
New Revision: 10371
Added:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/config/
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandler.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB21.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB3.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/WebAppGeneratorDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebAppDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifier.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifierImpl.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/ASIntegrationHelper.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/DeployerUtils.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/ServerConfigImpl.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataAdapter.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBArchiveMetaDataAdapterEJB21.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBArchiveMetaDataAdapterEJB3.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBBeanReferenceResolver.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEArchiveMetaDataAdapter.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandler.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandlerEJB21.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandlerEJB3.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifierImpl.java
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-2332] refactoring
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/ASIntegrationHelper.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/ASIntegrationHelper.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/ASIntegrationHelper.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,136 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-
-/**
- * JBoss AS integration helper class.
- *
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
- */
-public final class ASIntegrationHelper
-{
-
- /**
- * Forbidden constructor.
- */
- private ASIntegrationHelper()
- {
- super();
- }
-
- public static boolean isWebServiceDeployment( final DeploymentUnit unit )
- {
- return unit.getAttachment( DeploymentType.class ) != null;
- }
-
- public static boolean isPojoDeployment( final DeploymentUnit unit )
- {
- if ( ASIntegrationHelper.isWebServiceDeployment( unit ) )
- {
- final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
- final boolean isJaxrpcPojo = DeploymentType.JAXRPC_JSE.equals( deploymentType );
- final boolean isJaxwsPojo = DeploymentType.JAXWS_JSE.equals( deploymentType );
-
- return isJaxwsPojo || isJaxrpcPojo;
- }
-
- return false;
- }
-
- public static boolean isEjbDeployment( final DeploymentUnit unit )
- {
- if ( ASIntegrationHelper.isWebServiceDeployment( unit ) )
- {
- final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
- final boolean isJaxwsEjb3 = DeploymentType.JAXWS_EJB3.equals( deploymentType );
- final boolean isJaxrpcEjb21 = DeploymentType.JAXRPC_EJB21.equals( deploymentType );
-
- return isJaxwsEjb3 || isJaxrpcEjb21;
- }
-
- return false;
- }
-
- public static boolean isJaxwsDeployment( final DeploymentUnit unit )
- {
- if ( ASIntegrationHelper.isWebServiceDeployment( unit ) )
- {
- final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
- final boolean isJaxwsEjb3 = DeploymentType.JAXWS_EJB3.equals( deploymentType );
- final boolean isJaxwsPojo = DeploymentType.JAXWS_JSE.equals( deploymentType );
-
- return isJaxwsEjb3 || isJaxwsPojo;
- }
-
- return false;
- }
-
- public static boolean isJaxrpcDeployment( final DeploymentUnit unit )
- {
- if ( ASIntegrationHelper.isWebServiceDeployment( unit ) )
- {
- final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
- final boolean isJaxrpcEjb21 = DeploymentType.JAXRPC_EJB21.equals( deploymentType );
- final boolean isJaxrpcPojo = DeploymentType.JAXRPC_JSE.equals( deploymentType );
-
- return isJaxrpcEjb21 || isJaxrpcPojo;
- }
-
- return false;
- }
-
- public static boolean isJaxrpcPojoDeployment( final DeploymentUnit unit )
- {
- final boolean isJaxrpc = ASIntegrationHelper.isJaxrpcDeployment( unit );
- final boolean isPojo = ASIntegrationHelper.isPojoDeployment( unit );
-
- return isPojo && isJaxrpc;
- }
-
- public static boolean isJaxwsPojoDeployment( final DeploymentUnit unit )
- {
- final boolean isJaxws = ASIntegrationHelper.isJaxwsDeployment( unit );
- final boolean isPojo = ASIntegrationHelper.isPojoDeployment( unit );
-
- return isPojo && isJaxws;
- }
-
- public static boolean isJaxrpcEjbDeployment( final DeploymentUnit unit )
- {
- final boolean isJaxrpc = ASIntegrationHelper.isJaxrpcDeployment( unit );
- final boolean isEjb = ASIntegrationHelper.isEjbDeployment( unit );
-
- return isEjb && isJaxrpc;
- }
-
- public static boolean isJaxwsEjbDeployment( final DeploymentUnit unit )
- {
- final boolean isJaxws = ASIntegrationHelper.isJaxwsDeployment( unit );
- final boolean isEjb = ASIntegrationHelper.isEjbDeployment( unit );
-
- return isEjb && isJaxws;
- }
-
-}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.config;
+
+import java.io.File;
+
+import javax.management.JMException;
+import javax.management.ObjectName;
+
+import org.jboss.wsf.common.management.AbstractServerConfig;
+import org.jboss.wsf.common.management.AbstractServerConfigMBean;
+
+/**
+ * A ServerConfig for AS <= 5.1.0
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @author Thomas.Diesler(a)jboss.org
+ *
+ */
+public class ServerConfigImpl extends AbstractServerConfig implements AbstractServerConfigMBean
+{
+
+ public File getServerTempDir()
+ {
+ return this.getDirFromServerConfig("ServerTempDir");
+ }
+
+ public File getHomeDir()
+ {
+ return this.getDirFromServerConfig("HomeDir");
+ }
+
+ public File getServerDataDir()
+ {
+ return this.getDirFromServerConfig("ServerDataDir");
+ }
+
+ /**
+ * Obtains the specified attribute from the server configuration,
+ * represented as a {@link File}.
+ *
+ * @param attributeName
+ * @return
+ * @author ALR
+ */
+ protected File getDirFromServerConfig(final String attributeName)
+ {
+ // Define the ON to invoke upon
+ final ObjectName on = OBJECT_NAME_SERVER_CONFIG;
+
+ // Get the URL location
+ File location = null;
+ try
+ {
+ location = (File) getMbeanServer().getAttribute(on, attributeName);
+ }
+ catch (final JMException e)
+ {
+ throw new RuntimeException("Could not obtain attribute " + attributeName + " from " + on, e);
+ }
+ return location;
+ }
+
+}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/DeployerUtils.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/DeployerUtils.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/DeployerUtils.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,186 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.deployers;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.jws.WebService;
-import javax.servlet.Servlet;
-import javax.xml.ws.WebServiceProvider;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.javaee.spec.ParamValueMetaData;
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
-
-/**
- * TODO: javadoc
- *
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
- */
-final class DeployerUtils
-{
-
- /** Logger. */
- private static final Logger log = Logger.getLogger( DeployerUtils.class );
-
- /**
- * Forbidden constructor.
- */
- private DeployerUtils()
- {
- super();
- }
-
- static final boolean isWebServiceBean( final WebServiceDeclaration ejbContainerAdapter )
- {
- boolean isWebServiceBean = false;
- boolean isWebService = ejbContainerAdapter.getAnnotation(WebService.class) != null;
- boolean isWebServiceProvider = ejbContainerAdapter.getAnnotation(WebServiceProvider.class) != null;
- isWebServiceBean = isWebService || isWebServiceProvider;
-
- return isWebServiceBean;
- }
-
- static final boolean isEjb3Deployment( final DeploymentUnit unit )
- {
- final WebServiceDeployment wsDeployment = unit.getAttachment( WebServiceDeployment.class );
-
- Iterator<WebServiceDeclaration> it = wsDeployment.getServiceEndpoints().iterator();
- while (it.hasNext())
- {
- WebServiceDeclaration container = it.next();
- if (DeployerUtils.isWebServiceBean(container))
- {
- return true;
- }
- }
-
- return false;
- }
-
- static final List<ServletMetaData> getJaxwsServlets( final DeploymentUnit unit )
- {
- return DeployerUtils.getRelevantServlets( unit, true );
- }
-
- static List<ServletMetaData> getJaxrpcServlets( final DeploymentUnit unit )
- {
- return DeployerUtils.getRelevantServlets( unit, false );
- }
-
- private static final List< ServletMetaData > getRelevantServlets( final DeploymentUnit unit, final boolean jaxws )
- {
- try
- {
- final JBossWebMetaData jbossWebMD = unit.getAttachment(JBossWebMetaData.class);
- final ClassLoader loader = unit.getClassLoader();
-
- List<ServletMetaData> endpoints = new ArrayList<ServletMetaData>();
- for (ServletMetaData servlet : jbossWebMD.getServlets())
- {
- String servletClassName = getTargetBean(servlet);
-
- // Skip JSPs
- if (servletClassName == null || servletClassName.length() == 0)
- continue;
-
- try
- {
- Class<?> servletClass = loader.loadClass(servletClassName.trim());
- boolean isServlet = servletClass.isAssignableFrom(Servlet.class);
- if (false == isServlet)
- {
- boolean isWebService = servletClass.isAnnotationPresent(WebService.class);
- boolean isWebServiceProvider = servletClass.isAnnotationPresent(WebServiceProvider.class);
- if ( jaxws )
- {
- if (isWebService || isWebServiceProvider)
- {
- endpoints.add(servlet); // jaxws endpoint
- }
- }
- else
- {
- if (!isWebService && !isWebServiceProvider)
- {
- endpoints.add(servlet); // jaxrpc endpoint
- }
- }
- }
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + servletClassName);
- continue;
- }
- }
-
- return endpoints;
- }
- catch (Exception ex)
- {
- log.error("Cannot process web deployment", ex);
- return Collections.emptyList();
- }
- }
-
- static String getTargetBean(ServletMetaData servlet)
- {
- String endpointClass = servlet.getServletClass();
- List<ParamValueMetaData> initParams = servlet.getInitParam();
- if (initParams != null)
- {
- for (ParamValueMetaData param : initParams)
- {
- if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(param.getParamName()))
- {
- endpointClass = param.getParamValue();
- break;
- }
- }
- }
- return endpointClass;
- }
-
- static ServletMetaData getServletForName( final JBossWebMetaData jbossWebMD, final String servletName )
- {
- for ( JBossServletMetaData servlet : jbossWebMD.getServlets() )
- {
- if ( servlet.getName().equals( servletName ) )
- {
- return servlet;
- }
- }
-
- throw new IllegalStateException( "Cannot find servlet for link: " + servletName );
- }
-
-}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/ServerConfigImpl.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/ServerConfigImpl.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/ServerConfigImpl.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.deployers;
-
-import java.io.File;
-
-import javax.management.JMException;
-import javax.management.ObjectName;
-
-import org.jboss.wsf.common.management.AbstractServerConfig;
-import org.jboss.wsf.common.management.AbstractServerConfigMBean;
-
-/**
- * A ServerConfig for AS <= 5.1.0
- *
- * @author alessio.soldano(a)jboss.com
- * @author Thomas.Diesler(a)jboss.org
- *
- */
-public class ServerConfigImpl extends AbstractServerConfig implements AbstractServerConfigMBean
-{
-
- public File getServerTempDir()
- {
- return this.getDirFromServerConfig("ServerTempDir");
- }
-
- public File getHomeDir()
- {
- return this.getDirFromServerConfig("HomeDir");
- }
-
- public File getServerDataDir()
- {
- return this.getDirFromServerConfig("ServerDataDir");
- }
-
- /**
- * Obtains the specified attribute from the server configuration,
- * represented as a {@link File}.
- *
- * @param attributeName
- * @return
- * @author ALR
- */
- protected File getDirFromServerConfig(final String attributeName)
- {
- // Define the ON to invoke upon
- final ObjectName on = OBJECT_NAME_SERVER_CONFIG;
-
- // Get the URL location
- File location = null;
- try
- {
- location = (File) getMbeanServer().getAttribute(on, attributeName);
- }
- catch (final JMException e)
- {
- throw new RuntimeException("Could not obtain attribute " + attributeName + " from " + on, e);
- }
- return location;
- }
-}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -27,7 +27,7 @@
import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webservices.integration.ASIntegrationHelper;
+import org.jboss.webservices.integration.util.Helper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -98,7 +98,7 @@
@Override
public void internalDeploy( final DeploymentUnit unit ) throws DeploymentException
{
- if ( ASIntegrationHelper.isWebServiceDeployment( unit ) )
+ if ( Helper.isWebServiceDeployment( unit ) )
{
log.debug( this.aspect.getClass() + " deploy: " + unit.getName() );
final Deployment dep = unit.getAttachment( Deployment.class );
@@ -115,7 +115,7 @@
@Override
public void internalUndeploy( final DeploymentUnit unit )
{
- if ( ASIntegrationHelper.isWebServiceDeployment( unit ) )
+ if ( Helper.isWebServiceDeployment( unit ) )
{
log.debug( this.aspect.getClass() + " undeploy: " + unit.getName() );
final Deployment dep = unit.getAttachment( Deployment.class );
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -38,8 +38,8 @@
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.virtual.VirtualFile;
-import org.jboss.webservices.integration.ASIntegrationHelper;
import org.jboss.webservices.integration.invocation.InvocationHandlerEJB3;
+import org.jboss.webservices.integration.util.Helper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -96,19 +96,19 @@
@Override
protected void internalDeploy( final DeploymentUnit unit ) throws DeploymentException
{
- if ( ASIntegrationHelper.isJaxwsPojoDeployment( unit ) )
+ if ( Helper.isJaxwsJseDeployment( unit ) )
{
- this.newJaxwsPojoDeployment( unit );
+ this.newJaxwsJseDeployment( unit );
}
- else if ( ASIntegrationHelper.isJaxwsEjbDeployment( unit ) )
+ else if ( Helper.isJaxwsEjbDeployment( unit ) )
{
this.newJaxwsEjbDeployment( unit );
}
- else if ( ASIntegrationHelper.isJaxrpcPojoDeployment( unit ) )
+ else if ( Helper.isJaxrpcJseDeployment( unit ) )
{
- this.newJaxrpcPojoDeployment( unit );
+ this.newJaxrpcJseDeployment( unit );
}
- else if ( ASIntegrationHelper.isJaxrpcEjbDeployment( unit ) )
+ else if ( Helper.isJaxrpcEjbDeployment( unit ) )
{
this.newJaxrpcEjbDeployment( unit );
}
@@ -157,7 +157,7 @@
{
final WebServiceDeclaration container = it.next();
- if ( DeployerUtils.isWebServiceBean( container ) )
+ if ( Helper.isWebServiceBean( container ) )
{
final String ejbName = container.getComponentName();
final String ejbClass = container.getComponentClassName();
@@ -172,11 +172,11 @@
}
/**
- * Creates new JAXRPC POJO deployment and registers it with deployment unit.
+ * Creates new JAXRPC JSE deployment and registers it with deployment unit.
*
* @param unit deployment unit
*/
- private void newJaxrpcPojoDeployment( final DeploymentUnit unit )
+ private void newJaxrpcJseDeployment( final DeploymentUnit unit )
{
final ArchiveDeployment dep = this.newDeployment( unit );
final JBossWebMetaData webMetaData = this.getAttachment( JBossWebMetaData.class, unit, dep );
@@ -186,11 +186,11 @@
{
for ( PortComponentMetaData pcmd : wsd.getPortComponents() )
{
- final String pojoName = pcmd.getServletLink();
- final ServletMetaData servlet = DeployerUtils.getServletForName( webMetaData, pojoName );
- final String pojoClass = DeployerUtils.getTargetBean( servlet );
+ final String servletName = pcmd.getServletLink();
+ final ServletMetaData servletMD = Helper.getServletForName( webMetaData, servletName );
+ final String servletClass = Helper.getTargetBean( servletMD );
- this.createEndpoint( pojoClass, pojoName, dep );
+ this.createEndpoint( servletClass, servletName, dep );
}
}
@@ -199,22 +199,22 @@
}
/**
- * Creates new JAXWS POJO deployment and registers it with deployment unit.
+ * Creates new JAXWS JSE deployment and registers it with deployment unit.
*
* @param unit deployment unit
*/
- private void newJaxwsPojoDeployment( final DeploymentUnit unit )
+ private void newJaxwsJseDeployment( final DeploymentUnit unit )
{
final ArchiveDeployment dep = this.newDeployment( unit );
this.getAttachment( JBossWebMetaData.class, unit, dep );
- final List< ServletMetaData > servlets = DeployerUtils.getJaxwsServlets( unit );
+ final List< ServletMetaData > servlets = Helper.getJaxwsServlets( unit );
for ( ServletMetaData servlet : servlets )
{
- final String pojoName = servlet.getName();
- final String pojoClass = DeployerUtils.getTargetBean( servlet );
+ final String servletName = servlet.getName();
+ final String servletClass = Helper.getTargetBean( servlet );
- this.createEndpoint( pojoClass, pojoName, dep );
+ this.createEndpoint( servletClass, servletName, dep );
}
dep.addAttachment( DeploymentUnit.class, unit );
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -26,6 +26,7 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.webservices.integration.util.Helper;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -64,21 +65,21 @@
@Override
protected void internalDeploy( final DeploymentUnit unit ) throws DeploymentException
{
- if ( this.isJaxrpcEjbDeployment( unit ) )
+ if ( this.isJaxwsJseDeployment( unit ) )
{
- unit.addAttachment( DeploymentType.class, DeploymentType.JAXRPC_EJB21 );
+ unit.addAttachment( DeploymentType.class, DeploymentType.JAXWS_JSE );
}
else if ( this.isJaxwsEjbDeployment( unit ) )
{
unit.addAttachment( DeploymentType.class, DeploymentType.JAXWS_EJB3 );
}
- else if ( this.isJaxrpcPojoDeployment( unit ) )
+ else if ( this.isJaxrpcJseDeployment( unit ) )
{
unit.addAttachment( DeploymentType.class, DeploymentType.JAXRPC_JSE );
}
- else if ( this.isJaxwsPojoDeployment( unit ) )
+ else if ( this.isJaxrpcEjbDeployment( unit ) )
{
- unit.addAttachment( DeploymentType.class, DeploymentType.JAXWS_JSE );
+ unit.addAttachment( DeploymentType.class, DeploymentType.JAXRPC_EJB21 );
}
}
@@ -97,24 +98,22 @@
}
/**
- * Returns true if JAXRPC POJO deployment is detected.
+ * Returns true if JAXRPC JSE deployment is detected.
*
* @param unit deployment unit
- * @return true if JAXRPC POJO, false otherwise
+ * @return true if JAXRPC JSE, false otherwise
*/
- private boolean isJaxrpcPojoDeployment( final DeploymentUnit unit )
+ private boolean isJaxrpcJseDeployment( final DeploymentUnit unit )
{
final boolean isJaxrpc = unit.getAttachment( WebservicesMetaData.class ) != null;
final boolean hasJBossWebMD = unit.getAttachment( JBossWebMetaData.class ) != null;
if ( isJaxrpc && hasJBossWebMD )
{
- return DeployerUtils.getJaxrpcServlets( unit ).size() > 0;
+ return Helper.getJaxrpcServlets( unit ).size() > 0;
}
- else
- {
- return false;
- }
+
+ return false;
}
/**
@@ -129,32 +128,28 @@
if ( hasWSDeployment )
{
- return DeployerUtils.isEjb3Deployment( unit );
+ return Helper.isEjb3Deployment( unit );
}
- else
- {
- return false;
- }
+
+ return false;
}
/**
- * Returns true if JAXWS POJO deployment is detected.
+ * Returns true if JAXWS JSE deployment is detected.
*
* @param unit deployment unit
- * @return true if JAXWS POJO, false otherwise
+ * @return true if JAXWS JSE, false otherwise
*/
- private boolean isJaxwsPojoDeployment( final DeploymentUnit unit )
+ private boolean isJaxwsJseDeployment( final DeploymentUnit unit )
{
final boolean hasJBossWebMD = unit.getAttachment( JBossWebMetaData.class ) != null;
if ( hasJBossWebMD )
{
- return DeployerUtils.getJaxwsServlets( unit ).size() > 0;
+ return Helper.getJaxwsServlets( unit ).size() > 0;
}
- else
- {
- return false;
- }
+
+ return false;
}
}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.injection;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.ejb.EJB;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.ejb3.common.resolvers.spi.EjbReference;
+import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
+import org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver;
+
+/**
+ * EJB reference resolver.
+ *
+ * @author <a href="mailto:richard.opalka@jboss.org">Richard Opalka</a>
+ */
+final class EJBBeanReferenceResolver extends AbstractReferenceResolver<EJB>
+{
+
+ /**
+ * Deployment unit used for resolving process.
+ */
+ private final DeploymentUnit unit;
+ /**
+ * Delegate used to resolve JNDI names.
+ */
+ private final EjbReferenceResolver delegate;
+
+ /**
+ * Constructor.
+ */
+ public EJBBeanReferenceResolver(final DeploymentUnit unit, final EjbReferenceResolver delegate)
+ {
+ super(EJB.class);
+
+ if (unit == null)
+ {
+ throw new IllegalArgumentException("Deployment unit cannot be null");
+ }
+ if (delegate == null)
+ {
+ throw new IllegalArgumentException("Ejb reference resolver cannot be null");
+ }
+
+ this.unit = unit;
+ this.delegate = delegate;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveField(java.lang.reflect.Field)
+ */
+ @Override
+ protected String resolveField(final Field field)
+ {
+ final EJB ejbAnnotation = field.getAnnotation(EJB.class);
+ final Class<?> type = field.getType();
+ final EjbReference reference = getEjbReference(ejbAnnotation, type);
+
+ return this.delegate.resolveEjb(unit, reference);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveMethod(java.lang.reflect.Method)
+ */
+ @Override
+ protected String resolveMethod(final Method method)
+ {
+ final EJB ejbAnnotation = method.getAnnotation(EJB.class);
+ final Class<?> type = method.getParameterTypes()[0];
+ final EjbReference reference = getEjbReference(ejbAnnotation, type);
+
+ return this.delegate.resolveEjb(unit, reference);
+ }
+
+ /**
+ * Constructs EjbReference.
+ *
+ * @param ejbAnnotation ejb annotation
+ * @param type fall back type
+ * @return ejb reference instance
+ */
+ private EjbReference getEjbReference(EJB ejbAnnotation, Class<?> type)
+ {
+ String beanInterface = ejbAnnotation.beanInterface().getName();
+ if (java.lang.Object.class.getName().equals(beanInterface))
+ {
+ beanInterface = type.getName();
+ }
+ return new EjbReference(ejbAnnotation.beanName(), beanInterface, ejbAnnotation.mappedName());
+ }
+
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,235 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.injection;
+
+import java.lang.annotation.Annotation;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.jws.WebService;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
+import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
+import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.webservices.integration.util.Helper;
+import org.jboss.wsf.common.injection.resolvers.ResourceReferenceResolver;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
+import org.jboss.wsf.spi.metadata.injection.InjectionMetaData;
+import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
+import org.jboss.wsf.spi.metadata.injection.ReferenceResolver;
+
+/**
+ * Deployment aspect that builds injection meta data.
+ *
+ * @author <a href="mailto:richard.opalka@jboss.org">Richard Opalka</a>
+ */
+public final class InjectionMetaDataDeploymentAspect extends DeploymentAspect
+{
+
+ private static final ReferenceResolver RESOURCE_REFERENCE_RESOLVER = new ResourceReferenceResolver();
+ private static final String EJB3_JNDI_PREFIX = "java:env/";
+ private EjbReferenceResolver ejbReferenceResolver;
+
+ @Override
+ public void start(Deployment dep)
+ {
+ super.start(dep);
+
+ DeploymentUnit unit = dep.getAttachment(DeploymentUnit.class);
+ if (unit == null)
+ throw new IllegalStateException("DeploymentUnit not found");
+
+ JBossWebMetaData webMD = dep.getAttachment(JBossWebMetaData.class);
+ if (webMD == null)
+ throw new IllegalStateException("JBossWebMetaData not found");
+
+ List<InjectionMetaData> injectionMD = new LinkedList<InjectionMetaData>();
+ Map<Class<? extends Annotation>, ReferenceResolver> resolvers = createResolvers(unit);
+
+ try
+ {
+
+ if ( Helper.isJaxwsJseDeployment( unit ) )
+ {
+ injectionMD.addAll(buildInjectionMetaData(webMD.getEnvironmentEntries()));
+ for (Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ InjectionsMetaData injectionsMD = new InjectionsMetaData(injectionMD, resolvers, null);
+ endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
+ }
+ }
+ else if ( Helper.isJaxwsEjbDeployment( unit ) )
+ {
+ JBossMetaData jbossMD = unit.getAttachment(JBossMetaData.class);
+ JBossEnterpriseBeansMetaData jebMDs = jbossMD.getEnterpriseBeans();
+
+ WebServiceDeployment webServiceDeployment = unit.getAttachment(WebServiceDeployment.class);
+
+ Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
+ while (it.hasNext())
+ {
+ WebServiceDeclaration container = it.next();
+ if (isWebServiceBean(container))
+ {
+ final Context ctx = (Context)container.getContext().lookup(EJB3_JNDI_PREFIX);
+ String ejbName = container.getComponentName();
+ EnvironmentEntriesMetaData ejbEnvEntries = jebMDs.get(ejbName).getEnvironmentEntries();
+ injectionMD.addAll(buildInjectionMetaData(ejbEnvEntries));
+ Endpoint endpoint = dep.getService().getEndpointByName(ejbName);
+ InjectionsMetaData injectionsMD = new InjectionsMetaData(injectionMD, resolvers, ctx);
+ endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
+ }
+ }
+ }
+ }
+ catch (NamingException ne)
+ {
+ throw new RuntimeException(ne);
+ }
+ }
+
+ @Override
+ public void stop(Deployment dep)
+ {
+ dep.getService().removeAttachment(InjectionMetaData.class);
+
+ super.stop(dep);
+ }
+
+ /**
+ * Builds reference resolvers container.
+ *
+ * @param unit deployment unit
+ * @return reference resolvers
+ */
+ private Map<Class<? extends Annotation>, ReferenceResolver> createResolvers(DeploymentUnit unit)
+ {
+ final Map<Class<? extends Annotation>, ReferenceResolver> resolvers = new HashMap<Class<? extends Annotation>, ReferenceResolver>();
+ resolvers.put(Resource.class, RESOURCE_REFERENCE_RESOLVER);
+ resolvers.put(EJB.class, new EJBBeanReferenceResolver(unit, getEjbReferenceResolver()));
+ return resolvers;
+ }
+
+ /**
+ * Builds JBossWS specific injection metadata from JBoss metadata.
+ *
+ * @param envEntries environment entries
+ * @return JBossWS specific injection metadata
+ */
+ private List<InjectionMetaData> buildInjectionMetaData(EnvironmentEntriesMetaData envEntries)
+ {
+ if ((envEntries == null) || (envEntries.size() == 0))
+ {
+ return Collections.emptyList();
+ }
+
+ EnvironmentEntryMetaData eeMD = null;
+ LinkedList<InjectionMetaData> retVal = new LinkedList<InjectionMetaData>();
+ String envEntryName = null;
+ String envEntryValue = null;
+ String targetClass = null;
+ String targetName = null;
+ String valueClass = null;
+
+ for (Iterator<EnvironmentEntryMetaData> i = envEntries.iterator(); i.hasNext();)
+ {
+ eeMD = i.next();
+ envEntryName = eeMD.getEnvEntryName();
+ envEntryValue = eeMD.getValue();
+ valueClass = eeMD.getType();
+
+ Set<ResourceInjectionTargetMetaData> injectionTargets = eeMD.getInjectionTargets();
+ if ((injectionTargets != null) && (injectionTargets.size() > 0))
+ {
+ for (Iterator<ResourceInjectionTargetMetaData> j = injectionTargets.iterator(); j.hasNext(); )
+ {
+ ResourceInjectionTargetMetaData ritMD = j.next();
+ targetClass = ritMD.getInjectionTargetClass();
+ targetName = ritMD.getInjectionTargetName();
+ InjectionMetaData injectionMD = new InjectionMetaData(targetClass, targetName, valueClass, envEntryName, envEntryValue != null);
+ retVal.add(injectionMD);
+ }
+ }
+ }
+
+ return retVal;
+ }
+
+ /**
+ * Returns true if EJB represents webservice endpoint, false otherwise.
+ *
+ * @param container to analyze
+ * @return true if webservice endpoint, false otherwise
+ */
+ private boolean isWebServiceBean(WebServiceDeclaration container)
+ {
+ boolean isWebService = container.getAnnotation(WebService.class) != null;
+ boolean isWebServiceProvider = container.getAnnotation(WebServiceProvider.class) != null;
+
+ return isWebService || isWebServiceProvider;
+ }
+
+ /**
+ * Sets ejb reference resolver. This method is invoked by MC.
+ *
+ * @param resolver ejb reference resolver
+ */
+ public void setEjbReferenceResolver(final EjbReferenceResolver resolver)
+ {
+ this.ejbReferenceResolver = resolver;
+ }
+
+ /**
+ * Gets ejb reference resolver.
+ *
+ * @return ejb reference resolver
+ */
+ public EjbReferenceResolver getEjbReferenceResolver()
+ {
+ if (this.ejbReferenceResolver == null)
+ {
+ throw new IllegalStateException("No EjbReferenceResolver set by MC");
+ }
+
+ return this.ejbReferenceResolver;
+ }
+
+}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataAdapter.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataAdapter.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataAdapter.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.webservices.integration.ASIntegrationHelper;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
-
-/**
- * Build container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
- */
-public class ContainerMetaDataAdapter
-{
-
- private EJBArchiveMetaDataAdapterEJB3 ejbMetaDataAdapterEJB3 = new EJBArchiveMetaDataAdapterEJB3();
- private EJBArchiveMetaDataAdapterEJB21 ejbMetaDataAdapterEJB21 = new EJBArchiveMetaDataAdapterEJB21();
- private JSEArchiveMetaDataAdapter webMetaDataAdapter = new JSEArchiveMetaDataAdapter();
-
- public void setEjbMetaDataAdapterEJB21(EJBArchiveMetaDataAdapterEJB21 adapter)
- {
- this.ejbMetaDataAdapterEJB21 = adapter;
- }
-
- public void setEjbMetaDataAdapterEJB3(EJBArchiveMetaDataAdapterEJB3 adapter)
- {
- this.ejbMetaDataAdapterEJB3 = adapter;
- }
-
- public void setWebMetaDataAdapter(JSEArchiveMetaDataAdapter adapter)
- {
- this.webMetaDataAdapter = adapter;
- }
-
- public void buildContainerMetaData(Deployment dep, DeploymentUnit unit)
- {
- try
- {
- if ( ASIntegrationHelper.isPojoDeployment( unit ) )
- {
- JSEArchiveMetaData webMetaData = webMetaDataAdapter.buildMetaData(dep, unit);
- dep.addAttachment(JSEArchiveMetaData.class, webMetaData);
- }
- else if ( ASIntegrationHelper.isJaxwsEjbDeployment(unit) )
- {
- EJBArchiveMetaData ejbMetaData = ejbMetaDataAdapterEJB3.buildMetaData(dep, unit);
- dep.addAttachment(EJBArchiveMetaData.class, ejbMetaData);
- }
- else if ( ASIntegrationHelper.isJaxrpcEjbDeployment(unit) )
- {
- EJBArchiveMetaData ejbMetaData = ejbMetaDataAdapterEJB21.buildMetaData(dep, unit);
- dep.addAttachment(EJBArchiveMetaData.class, ejbMetaData);
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new IllegalStateException(ex);
- }
- }
-
-}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.webservices.integration.util.Helper;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
+
+/**
+ * Builds container independent deployment meta data.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+public final class ContainerMetaDataBuilder
+{
+
+ private JSEMetaDataBuilder jseMetaDataBuilder = new JSEMetaDataBuilder();
+ private EJB3MetaDataBuilder ejb3MetaDataBuilder = new EJB3MetaDataBuilder();
+ private EJB21MetaDataBuilder ejb21MetaDataBuilder = new EJB21MetaDataBuilder();
+
+ public void create( final Deployment dep, final DeploymentUnit unit )
+ {
+ if ( Helper.isJseDeployment( unit ) )
+ {
+ final JSEArchiveMetaData jseMetaData = jseMetaDataBuilder.create( dep, unit );
+ dep.addAttachment( JSEArchiveMetaData.class, jseMetaData );
+ }
+ else if ( Helper.isJaxwsEjbDeployment( unit ) )
+ {
+ final EJBArchiveMetaData ejbMetaData = ejb3MetaDataBuilder.create( dep, unit );
+ dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
+ }
+ else if ( Helper.isJaxrpcEjbDeployment( unit ) )
+ {
+ final EJBArchiveMetaData ejbMetaData = ejb21MetaDataBuilder.create( dep, unit );
+ dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
+ }
+ }
+
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+
+/**
+ * An aspect that builds container independent meta data.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+public final class ContainerMetaDataDeploymentAspect extends DeploymentAspect
+{
+
+ private ContainerMetaDataBuilder metaDataBuilder;
+
+ public void setMetaDataBuilder( final ContainerMetaDataBuilder builder )
+ {
+ this.metaDataBuilder = builder;
+ }
+
+ @Override
+ public void start( final Deployment dep )
+ {
+ final DeploymentUnit unit = dep.getAttachment( DeploymentUnit.class );
+
+ this.metaDataBuilder.create( dep, unit );
+ }
+
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,174 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.common.jboss.WebserviceDescriptionMetaData;
+import org.jboss.metadata.common.jboss.WebserviceDescriptionsMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
+import org.jboss.metadata.javaee.spec.PortComponent;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.MDBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.SLSBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData.PublishLocationAdapter;
+
+/**
+ * Builds container independent meta data from EJB21 container meta data.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+final class EJB21MetaDataBuilder
+{
+
+ private static Logger log = Logger.getLogger(EJB21MetaDataBuilder.class);
+
+ EJBArchiveMetaData create(Deployment dep, DeploymentUnit unit)
+ {
+ JBossMetaData jbossMetaData = unit.getAttachment(JBossMetaData.class);
+ dep.addAttachment(JBossMetaData.class, jbossMetaData);
+
+ EJBArchiveMetaData ejbMetaData = new EJBArchiveMetaData();
+ buildEnterpriseBeansMetaData(ejbMetaData, jbossMetaData);
+ buildWebservicesMetaData(ejbMetaData, jbossMetaData);
+ ejbMetaData.setSecurityDomain(jbossMetaData.getSecurityDomain());
+
+ return ejbMetaData;
+ }
+
+ private void buildEnterpriseBeansMetaData(EJBArchiveMetaData ejbMetaData, JBossMetaData jbossMetaData)
+ {
+ List<EJBMetaData> targetBeans = new ArrayList<EJBMetaData>();
+ JBossEnterpriseBeansMetaData sourceBeans = jbossMetaData.getEnterpriseBeans();
+ Iterator<JBossEnterpriseBeanMetaData> it = sourceBeans.iterator();
+ while (it.hasNext())
+ {
+ JBossEnterpriseBeanMetaData bmd = it.next();
+ buildBeanMetaData(targetBeans, bmd);
+ }
+ ejbMetaData.setEnterpriseBeans(targetBeans);
+ }
+
+ private void buildWebservicesMetaData(EJBArchiveMetaData ejbMetaData, JBossMetaData jbossMetaData)
+ {
+ WebservicesMetaData webservices = jbossMetaData.getWebservices();
+ if (webservices != null)
+ {
+ String contextRoot = webservices.getContextRoot();
+ ejbMetaData.setWebServiceContextRoot(contextRoot);
+
+ ejbMetaData.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
+
+ WebserviceDescriptionsMetaData wsDescriptions = webservices.getWebserviceDescriptions();
+ if (wsDescriptions != null)
+ {
+ if (wsDescriptions.size() > 1)
+ log.warn("Multiple <webservice-description> elements not supported");
+
+ if (wsDescriptions.size() > 0)
+ {
+ WebserviceDescriptionMetaData wsd = wsDescriptions.iterator().next();
+ ejbMetaData.setConfigName(wsd.getConfigName());
+ ejbMetaData.setConfigFile(wsd.getConfigFile());
+ }
+ }
+ }
+ }
+
+ private PublishLocationAdapter getPublishLocationAdpater(final WebservicesMetaData wsMetaData)
+ {
+ return new PublishLocationAdapter()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String wsdlPublishLocation = null;
+ WebserviceDescriptionsMetaData wsDescriptions = wsMetaData.getWebserviceDescriptions();
+ if (wsDescriptions != null && wsDescriptions.get(name) != null)
+ {
+ WebserviceDescriptionMetaData wsdMetaData = wsDescriptions.get(name);
+ wsdlPublishLocation = wsdMetaData.getWsdlPublishLocation();
+ }
+ return wsdlPublishLocation;
+ }
+ };
+ }
+
+ private EJBMetaData buildBeanMetaData(List<EJBMetaData> ejbBeans, JBossEnterpriseBeanMetaData jbossBeansMetaData)
+ {
+ EJBMetaData targetBean = null;
+ if (jbossBeansMetaData.isSession())
+ {
+ targetBean = new SLSBMetaData();
+ JBossSessionBeanMetaData jbossSessionBean = (JBossSessionBeanMetaData)jbossBeansMetaData;
+
+ targetBean.setEjbName(jbossSessionBean.getEjbName());
+ targetBean.setEjbClass(jbossSessionBean.getEjbClass());
+ targetBean.setServiceEndpointInterface(jbossSessionBean.getServiceEndpoint());
+ targetBean.setHome(jbossSessionBean.getHome());
+ targetBean.setLocalHome(jbossSessionBean.getLocalHome());
+ targetBean.setJndiName(jbossSessionBean.determineJndiName());
+ targetBean.setLocalJndiName(jbossBeansMetaData.determineLocalJndiName());
+
+ PortComponent pcmd = jbossSessionBean.getPortComponent();
+ if (pcmd != null)
+ {
+ targetBean.setPortComponentName(pcmd.getPortComponentName());
+ targetBean.setPortComponentURI(pcmd.getPortComponentURI());
+ EJBSecurityMetaData smd = new EJBSecurityMetaData();
+ smd.setAuthMethod(pcmd.getAuthMethod());
+ smd.setTransportGuarantee(pcmd.getTransportGuarantee());
+ smd.setSecureWSDLAccess(pcmd.getSecureWSDLAccess());
+ targetBean.setSecurityMetaData(smd);
+ }
+ }
+ else if (jbossBeansMetaData.isMessageDriven())
+ {
+ targetBean = new MDBMetaData();
+ JBossMessageDrivenBeanMetaData jbossMessageBean = (JBossMessageDrivenBeanMetaData)jbossBeansMetaData;
+
+ targetBean.setEjbName(jbossMessageBean.getEjbName());
+ targetBean.setEjbClass(jbossMessageBean.getEjbClass());
+ //targetBean.setServiceEndpointInterface(???);
+ //targetBean.setJndiName(???);
+ targetBean.setLocalJndiName(jbossBeansMetaData.getLocalJndiName());
+ ((MDBMetaData)targetBean).setDestinationJndiName(jbossMessageBean.getDestinationJndiName());
+ }
+
+ if (targetBean != null)
+ ejbBeans.add(targetBean);
+
+ return targetBean;
+ }
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.common.jboss.WebserviceDescriptionMetaData;
+import org.jboss.metadata.common.jboss.WebserviceDescriptionsMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
+import org.jboss.wsf.spi.metadata.j2ee.*;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData.PublishLocationAdapter;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Builds container independent meta data from EJB3 container meta data.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+final class EJB3MetaDataBuilder
+{
+
+ private static Logger log = Logger.getLogger(EJB3MetaDataBuilder.class);
+
+ EJBArchiveMetaData create(Deployment dep, DeploymentUnit unit)
+ {
+ EJBArchiveMetaData umd = new EJBArchiveMetaData();
+
+ WebServiceDeployment webServiceDeployment = dep.getAttachment(WebServiceDeployment.class);
+ buildEnterpriseBeansMetaData(umd, webServiceDeployment);
+
+ JBossMetaData jbMetaData = unit.getAttachment(JBossMetaData.class);
+ if (jbMetaData != null)
+ buildWebservicesMetaData(umd, jbMetaData);
+
+ return umd;
+ }
+
+ private void buildWebservicesMetaData(EJBArchiveMetaData ejbMetaData, JBossMetaData jbMetaData)
+ {
+ WebservicesMetaData wsMetaData = jbMetaData.getWebservices();
+ if (wsMetaData != null)
+ {
+ String contextRoot = wsMetaData.getContextRoot();
+ ejbMetaData.setWebServiceContextRoot(contextRoot);
+
+ ejbMetaData.setPublishLocationAdapter(getPublishLocationAdpater(wsMetaData));
+
+ WebserviceDescriptionsMetaData wsDescriptions = wsMetaData.getWebserviceDescriptions();
+ if (wsDescriptions != null)
+ {
+ if (wsDescriptions.size() > 1)
+ log.warn("Multiple <webservice-description> elements not supported");
+
+ if (wsDescriptions.size() > 0)
+ {
+ WebserviceDescriptionMetaData wsd = wsDescriptions.iterator().next();
+ ejbMetaData.setConfigName(wsd.getConfigName());
+ ejbMetaData.setConfigFile(wsd.getConfigFile());
+ }
+ }
+ }
+ }
+
+ private void buildEnterpriseBeansMetaData(EJBArchiveMetaData jarMetaData, WebServiceDeployment ejb3Deployment)
+ {
+ List<EJBMetaData> ejbMetaDataList = new ArrayList<EJBMetaData>();
+ Iterator<WebServiceDeclaration> it = ejb3Deployment.getServiceEndpoints().iterator();
+ while (it.hasNext())
+ {
+ WebServiceDeclaration container = it.next();
+
+ PortComponentSpec pcMetaData = container.getAnnotation(PortComponentSpec.class);
+ MessageDriven mdbMetaData = container.getAnnotation(MessageDriven.class);
+
+ EJBMetaData ejbMetaData = null;
+
+ if(mdbMetaData!=null)
+ {
+ ejbMetaData = new MDBMetaData();
+
+ ActivationConfigProperty[] props = mdbMetaData.activationConfig();
+ if (props != null)
+ {
+ String destination = getActivationProperty("destination", props);
+ if (destination != null)
+ {
+ ((MDBMetaData)ejbMetaData).setDestinationJndiName(destination);
+ }
+ }
+ }
+ else
+ {
+ ejbMetaData = new SLSBMetaData();
+ }
+
+ if (ejbMetaData != null)
+ {
+ ejbMetaData.setEjbName(container.getComponentName());
+ ejbMetaData.setEjbClass(container.getComponentClassName());
+
+ if (pcMetaData != null)
+ {
+ ejbMetaData.setPortComponentName(pcMetaData.portComponentName());
+ ejbMetaData.setPortComponentURI(pcMetaData.portComponentURI());
+ EJBSecurityMetaData smd = new EJBSecurityMetaData();
+ smd.setAuthMethod(pcMetaData.authMethod());
+ smd.setTransportGuarantee(pcMetaData.transportGuarantee());
+ smd.setSecureWSDLAccess(pcMetaData.secureWSDLAccess());
+ ejbMetaData.setSecurityMetaData(smd);
+ }
+
+ ejbMetaDataList.add(ejbMetaData);
+ }
+ }
+
+ jarMetaData.setEnterpriseBeans(ejbMetaDataList);
+ }
+
+ private String getActivationProperty(String name, ActivationConfigProperty[] props)
+ {
+ String result = null;
+ for(ActivationConfigProperty p : props)
+ {
+ if(p.propertyName().equals(name))
+ {
+ result = p.propertyValue();
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ private PublishLocationAdapter getPublishLocationAdpater(final WebservicesMetaData wsMetaData)
+ {
+ return new PublishLocationAdapter() {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String wsdlPublishLocation = null;
+ WebserviceDescriptionsMetaData wsDescriptions = wsMetaData.getWebserviceDescriptions();
+ if (wsDescriptions != null && wsDescriptions.get(name) != null)
+ {
+ WebserviceDescriptionMetaData wsdMetaData = wsDescriptions.get(name);
+ wsdlPublishLocation = wsdMetaData.getWsdlPublishLocation();
+ }
+ return wsdlPublishLocation;
+ }
+ };
+ }
+
+}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBArchiveMetaDataAdapterEJB21.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBArchiveMetaDataAdapterEJB21.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBArchiveMetaDataAdapterEJB21.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,174 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.common.jboss.WebserviceDescriptionMetaData;
-import org.jboss.metadata.common.jboss.WebserviceDescriptionsMetaData;
-import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
-import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
-import org.jboss.metadata.javaee.spec.PortComponent;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.MDBMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.SLSBMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData.PublishLocationAdapter;
-
-/**
- * Build container independent application meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class EJBArchiveMetaDataAdapterEJB21
-{
- // logging support
- private static Logger log = Logger.getLogger(EJBArchiveMetaDataAdapterEJB21.class);
-
- public EJBArchiveMetaData buildMetaData(Deployment dep, DeploymentUnit unit)
- {
- JBossMetaData jbossMetaData = unit.getAttachment(JBossMetaData.class);
- dep.addAttachment(JBossMetaData.class, jbossMetaData);
-
- EJBArchiveMetaData ejbMetaData = new EJBArchiveMetaData();
- buildEnterpriseBeansMetaData(ejbMetaData, jbossMetaData);
- buildWebservicesMetaData(ejbMetaData, jbossMetaData);
- ejbMetaData.setSecurityDomain(jbossMetaData.getSecurityDomain());
-
- return ejbMetaData;
- }
-
- private void buildEnterpriseBeansMetaData(EJBArchiveMetaData ejbMetaData, JBossMetaData jbossMetaData)
- {
- List<EJBMetaData> targetBeans = new ArrayList<EJBMetaData>();
- JBossEnterpriseBeansMetaData sourceBeans = jbossMetaData.getEnterpriseBeans();
- Iterator<JBossEnterpriseBeanMetaData> it = sourceBeans.iterator();
- while (it.hasNext())
- {
- JBossEnterpriseBeanMetaData bmd = it.next();
- buildBeanMetaData(targetBeans, bmd);
- }
- ejbMetaData.setEnterpriseBeans(targetBeans);
- }
-
- private void buildWebservicesMetaData(EJBArchiveMetaData ejbMetaData, JBossMetaData jbossMetaData)
- {
- WebservicesMetaData webservices = jbossMetaData.getWebservices();
- if (webservices != null)
- {
- String contextRoot = webservices.getContextRoot();
- ejbMetaData.setWebServiceContextRoot(contextRoot);
-
- ejbMetaData.setPublishLocationAdapter(getPublishLocationAdpater(webservices));
-
- WebserviceDescriptionsMetaData wsDescriptions = webservices.getWebserviceDescriptions();
- if (wsDescriptions != null)
- {
- if (wsDescriptions.size() > 1)
- log.warn("Multiple <webservice-description> elements not supported");
-
- if (wsDescriptions.size() > 0)
- {
- WebserviceDescriptionMetaData wsd = wsDescriptions.iterator().next();
- ejbMetaData.setConfigName(wsd.getConfigName());
- ejbMetaData.setConfigFile(wsd.getConfigFile());
- }
- }
- }
- }
-
- private PublishLocationAdapter getPublishLocationAdpater(final WebservicesMetaData wsMetaData)
- {
- return new PublishLocationAdapter()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- String wsdlPublishLocation = null;
- WebserviceDescriptionsMetaData wsDescriptions = wsMetaData.getWebserviceDescriptions();
- if (wsDescriptions != null && wsDescriptions.get(name) != null)
- {
- WebserviceDescriptionMetaData wsdMetaData = wsDescriptions.get(name);
- wsdlPublishLocation = wsdMetaData.getWsdlPublishLocation();
- }
- return wsdlPublishLocation;
- }
- };
- }
-
- private EJBMetaData buildBeanMetaData(List<EJBMetaData> ejbBeans, JBossEnterpriseBeanMetaData jbossBeansMetaData)
- {
- EJBMetaData targetBean = null;
- if (jbossBeansMetaData.isSession())
- {
- targetBean = new SLSBMetaData();
- JBossSessionBeanMetaData jbossSessionBean = (JBossSessionBeanMetaData)jbossBeansMetaData;
-
- targetBean.setEjbName(jbossSessionBean.getEjbName());
- targetBean.setEjbClass(jbossSessionBean.getEjbClass());
- targetBean.setServiceEndpointInterface(jbossSessionBean.getServiceEndpoint());
- targetBean.setHome(jbossSessionBean.getHome());
- targetBean.setLocalHome(jbossSessionBean.getLocalHome());
- targetBean.setJndiName(jbossSessionBean.determineJndiName());
- targetBean.setLocalJndiName(jbossBeansMetaData.determineLocalJndiName());
-
- PortComponent pcmd = jbossSessionBean.getPortComponent();
- if (pcmd != null)
- {
- targetBean.setPortComponentName(pcmd.getPortComponentName());
- targetBean.setPortComponentURI(pcmd.getPortComponentURI());
- EJBSecurityMetaData smd = new EJBSecurityMetaData();
- smd.setAuthMethod(pcmd.getAuthMethod());
- smd.setTransportGuarantee(pcmd.getTransportGuarantee());
- smd.setSecureWSDLAccess(pcmd.getSecureWSDLAccess());
- targetBean.setSecurityMetaData(smd);
- }
- }
- else if (jbossBeansMetaData.isMessageDriven())
- {
- targetBean = new MDBMetaData();
- JBossMessageDrivenBeanMetaData jbossMessageBean = (JBossMessageDrivenBeanMetaData)jbossBeansMetaData;
-
- targetBean.setEjbName(jbossMessageBean.getEjbName());
- targetBean.setEjbClass(jbossMessageBean.getEjbClass());
- //targetBean.setServiceEndpointInterface(???);
- //targetBean.setJndiName(???);
- targetBean.setLocalJndiName(jbossBeansMetaData.getLocalJndiName());
- ((MDBMetaData)targetBean).setDestinationJndiName(jbossMessageBean.getDestinationJndiName());
- }
-
- if (targetBean != null)
- ejbBeans.add(targetBean);
-
- return targetBean;
- }
-}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBArchiveMetaDataAdapterEJB3.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBArchiveMetaDataAdapterEJB3.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBArchiveMetaDataAdapterEJB3.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,180 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.common.jboss.WebserviceDescriptionMetaData;
-import org.jboss.metadata.common.jboss.WebserviceDescriptionsMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
-import org.jboss.wsf.spi.metadata.j2ee.*;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData.PublishLocationAdapter;
-
-import javax.ejb.ActivationConfigProperty;
-import javax.ejb.MessageDriven;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Build container independent application meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Apr-2007
- */
-public class EJBArchiveMetaDataAdapterEJB3
-{
- // logging support
- private static Logger log = Logger.getLogger(EJBArchiveMetaDataAdapterEJB3.class);
-
- public EJBArchiveMetaData buildMetaData(Deployment dep, DeploymentUnit unit)
- {
- EJBArchiveMetaData umd = new EJBArchiveMetaData();
-
- WebServiceDeployment webServiceDeployment = dep.getAttachment(WebServiceDeployment.class);
- buildEnterpriseBeansMetaData(umd, webServiceDeployment);
-
- JBossMetaData jbMetaData = unit.getAttachment(JBossMetaData.class);
- if (jbMetaData != null)
- buildWebservicesMetaData(umd, jbMetaData);
-
- return umd;
- }
-
- private void buildWebservicesMetaData(EJBArchiveMetaData ejbMetaData, JBossMetaData jbMetaData)
- {
- WebservicesMetaData wsMetaData = jbMetaData.getWebservices();
- if (wsMetaData != null)
- {
- String contextRoot = wsMetaData.getContextRoot();
- ejbMetaData.setWebServiceContextRoot(contextRoot);
-
- ejbMetaData.setPublishLocationAdapter(getPublishLocationAdpater(wsMetaData));
-
- WebserviceDescriptionsMetaData wsDescriptions = wsMetaData.getWebserviceDescriptions();
- if (wsDescriptions != null)
- {
- if (wsDescriptions.size() > 1)
- log.warn("Multiple <webservice-description> elements not supported");
-
- if (wsDescriptions.size() > 0)
- {
- WebserviceDescriptionMetaData wsd = wsDescriptions.iterator().next();
- ejbMetaData.setConfigName(wsd.getConfigName());
- ejbMetaData.setConfigFile(wsd.getConfigFile());
- }
- }
- }
- }
-
- private void buildEnterpriseBeansMetaData(EJBArchiveMetaData jarMetaData, WebServiceDeployment ejb3Deployment)
- {
- List<EJBMetaData> ejbMetaDataList = new ArrayList<EJBMetaData>();
- Iterator<WebServiceDeclaration> it = ejb3Deployment.getServiceEndpoints().iterator();
- while (it.hasNext())
- {
- WebServiceDeclaration container = it.next();
-
- PortComponentSpec pcMetaData = container.getAnnotation(PortComponentSpec.class);
- MessageDriven mdbMetaData = container.getAnnotation(MessageDriven.class);
-
- EJBMetaData ejbMetaData = null;
-
- if(mdbMetaData!=null)
- {
- ejbMetaData = new MDBMetaData();
-
- ActivationConfigProperty[] props = mdbMetaData.activationConfig();
- if (props != null)
- {
- String destination = getActivationProperty("destination", props);
- if (destination != null)
- {
- ((MDBMetaData)ejbMetaData).setDestinationJndiName(destination);
- }
- }
- }
- else
- {
- ejbMetaData = new SLSBMetaData();
- }
-
- if (ejbMetaData != null)
- {
- ejbMetaData.setEjbName(container.getComponentName());
- ejbMetaData.setEjbClass(container.getComponentClassName());
-
- if (pcMetaData != null)
- {
- ejbMetaData.setPortComponentName(pcMetaData.portComponentName());
- ejbMetaData.setPortComponentURI(pcMetaData.portComponentURI());
- EJBSecurityMetaData smd = new EJBSecurityMetaData();
- smd.setAuthMethod(pcMetaData.authMethod());
- smd.setTransportGuarantee(pcMetaData.transportGuarantee());
- smd.setSecureWSDLAccess(pcMetaData.secureWSDLAccess());
- ejbMetaData.setSecurityMetaData(smd);
- }
-
- ejbMetaDataList.add(ejbMetaData);
- }
- }
-
- jarMetaData.setEnterpriseBeans(ejbMetaDataList);
- }
-
- private String getActivationProperty(String name, ActivationConfigProperty[] props)
- {
- String result = null;
- for(ActivationConfigProperty p : props)
- {
- if(p.propertyName().equals(name))
- {
- result = p.propertyValue();
- break;
- }
- }
-
- return result;
- }
-
- private PublishLocationAdapter getPublishLocationAdpater(final WebservicesMetaData wsMetaData)
- {
- return new PublishLocationAdapter() {
- public String getWsdlPublishLocationByName(String name)
- {
- String wsdlPublishLocation = null;
- WebserviceDescriptionsMetaData wsDescriptions = wsMetaData.getWebserviceDescriptions();
- if (wsDescriptions != null && wsDescriptions.get(name) != null)
- {
- WebserviceDescriptionMetaData wsdMetaData = wsDescriptions.get(name);
- wsdlPublishLocation = wsdMetaData.getWsdlPublishLocation();
- }
- return wsdlPublishLocation;
- }
- };
- }
-
-}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBBeanReferenceResolver.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBBeanReferenceResolver.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJBBeanReferenceResolver.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,114 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.ejb.EJB;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.ejb3.common.resolvers.spi.EjbReference;
-import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
-import org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver;
-
-/**
- * EJB reference resolver.
- *
- * @author <a href="mailto:richard.opalka@jboss.org">Richard Opalka</a>
- */
-public final class EJBBeanReferenceResolver extends AbstractReferenceResolver<EJB>
-{
-
- /**
- * Deployment unit used for resolving process.
- */
- private final DeploymentUnit unit;
- /**
- * Delegate used to resolve JNDI names.
- */
- private final EjbReferenceResolver delegate;
-
- /**
- * Constructor.
- */
- public EJBBeanReferenceResolver(final DeploymentUnit unit, final EjbReferenceResolver delegate)
- {
- super(EJB.class);
-
- if (unit == null)
- {
- throw new IllegalArgumentException("Deployment unit cannot be null");
- }
- if (delegate == null)
- {
- throw new IllegalArgumentException("Ejb reference resolver cannot be null");
- }
-
- this.unit = unit;
- this.delegate = delegate;
- }
-
- /* (non-Javadoc)
- * @see org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveField(java.lang.reflect.Field)
- */
- @Override
- protected String resolveField(final Field field)
- {
- final EJB ejbAnnotation = field.getAnnotation(EJB.class);
- final Class<?> type = field.getType();
- final EjbReference reference = getEjbReference(ejbAnnotation, type);
-
- return this.delegate.resolveEjb(unit, reference);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveMethod(java.lang.reflect.Method)
- */
- @Override
- protected String resolveMethod(final Method method)
- {
- final EJB ejbAnnotation = method.getAnnotation(EJB.class);
- final Class<?> type = method.getParameterTypes()[0];
- final EjbReference reference = getEjbReference(ejbAnnotation, type);
-
- return this.delegate.resolveEjb(unit, reference);
- }
-
- /**
- * Constructs EjbReference.
- *
- * @param ejbAnnotation ejb annotation
- * @param type fall back type
- * @return ejb reference instance
- */
- private EjbReference getEjbReference(EJB ejbAnnotation, Class<?> type)
- {
- String beanInterface = ejbAnnotation.beanInterface().getName();
- if (java.lang.Object.class.getName().equals(beanInterface))
- {
- beanInterface = type.getName();
- }
- return new EjbReference(ejbAnnotation.beanName(), beanInterface, ejbAnnotation.mappedName());
- }
-
-}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEArchiveMetaDataAdapter.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEArchiveMetaDataAdapter.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEArchiveMetaDataAdapter.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,204 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.common.jboss.WebserviceDescriptionMetaData;
-import org.jboss.metadata.common.jboss.WebserviceDescriptionsMetaData;
-import org.jboss.metadata.ear.jboss.JBossAppMetaData;
-import org.jboss.metadata.ear.spec.ModuleMetaData;
-import org.jboss.metadata.ear.spec.WebModuleMetaData;
-import org.jboss.metadata.javaee.spec.ParamValueMetaData;
-import org.jboss.metadata.web.jboss.JBossServletsMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
-import org.jboss.metadata.web.spec.ServletMappingMetaData;
-import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData.PublishLocationAdapter;
-import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData.JSEResourceCollection;
-
-/**
- * Build container independent web meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class JSEArchiveMetaDataAdapter
-{
- // logging support
- private static Logger log = Logger.getLogger(JSEArchiveMetaDataAdapter.class);
-
- public JSEArchiveMetaData buildMetaData(Deployment dep, DeploymentUnit unit)
- {
- String contextRoot = null;
-
- JBossWebMetaData jbossWebMetaData = unit.getAttachment(JBossWebMetaData.class);
- dep.addAttachment(JBossWebMetaData.class, jbossWebMetaData);
-
- if (unit.getParent() != null)
- {
- JBossAppMetaData appmd = unit.getParent().getAttachment(JBossAppMetaData.class);
- if (appmd != null)
- {
- ModuleMetaData module = appmd.getModule(dep.getSimpleName());
- if (module != null)
- {
- WebModuleMetaData web = (WebModuleMetaData) module.getValue();
- contextRoot = web.getContextRoot();
- }
- }
- }
-
- if (contextRoot == null)
- contextRoot = jbossWebMetaData.getContextRoot();
-
- JSEArchiveMetaData umd = new JSEArchiveMetaData();
- umd.setContextRoot(contextRoot);
- umd.setServletMappings(getServletMappings(jbossWebMetaData));
- umd.setServletClassNames(getServletClassMap(jbossWebMetaData));
- umd.setSecurityDomain(jbossWebMetaData.getSecurityDomain());
- umd.setPublishLocationAdapter(getPublishLocationAdpater(jbossWebMetaData));
- umd.setSecurityMetaData(getSecurityMetaData(jbossWebMetaData.getSecurityContraints()));
-
- setConfigNameAndFile(umd, jbossWebMetaData);
-
- return umd;
- }
-
- private void setConfigNameAndFile(JSEArchiveMetaData umd, JBossWebMetaData jbossWebMetaData)
- {
- String configName = null;
- String configFile = null;
-
- WebserviceDescriptionsMetaData wsDescriptions = jbossWebMetaData.getWebserviceDescriptions();
- if (wsDescriptions != null && wsDescriptions.size() > 1)
- log.warn("Multiple <webservice-description> elements not supported");
-
- if (wsDescriptions != null && wsDescriptions.size() > 0)
- {
- WebserviceDescriptionMetaData wsd = wsDescriptions.iterator().next();
- configName = wsd.getConfigName();
- configFile = wsd.getConfigFile();
- }
-
- List<ParamValueMetaData> contextParams = jbossWebMetaData.getContextParams();
- if (contextParams != null)
- {
- for (ParamValueMetaData ctxParam : contextParams)
- {
- if (ctxParam.getParamName().equals("jbossws-config-name"))
- configName = ctxParam.getParamValue();
- if (ctxParam.getParamName().equals("jbossws-config-file"))
- configFile = ctxParam.getParamValue();
- }
- }
-
- umd.setConfigName(configName);
- umd.setConfigFile(configFile);
- }
-
- private PublishLocationAdapter getPublishLocationAdpater(final JBossWebMetaData wmd)
- {
- return new PublishLocationAdapter()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- WebserviceDescriptionsMetaData wsdmd = wmd.getWebserviceDescriptions();
- WebserviceDescriptionMetaData wsmd = wsdmd.get(name);
- String location = null;
- if (wsmd != null)
- location = wsmd.getWsdlPublishLocation();
- return location;
- }
- };
- }
-
- protected List<JSESecurityMetaData> getSecurityMetaData(final List<SecurityConstraintMetaData> securityConstraints)
- {
- ArrayList<JSESecurityMetaData> unifiedsecurityMetaData = new ArrayList<JSESecurityMetaData>();
- if (securityConstraints != null)
- {
- for (SecurityConstraintMetaData securityMetaData : securityConstraints)
- {
- JSESecurityMetaData current = new JSESecurityMetaData();
- unifiedsecurityMetaData.add(current);
-
- current.setTransportGuarantee(securityMetaData.getTransportGuarantee().name());
-
- WebResourceCollectionsMetaData resources = securityMetaData.getResourceCollections();
- for (WebResourceCollectionMetaData webResource : resources)
- {
- JSEResourceCollection currentResource = current.addWebResource(webResource.getName());
- for (String currentPattern : webResource.getUrlPatterns())
- {
- currentResource.addPattern(currentPattern);
- }
- }
- }
- }
- return unifiedsecurityMetaData;
- }
-
- private Map<String, String> getServletMappings(JBossWebMetaData wmd)
- {
- Map<String, String> mappings = new HashMap<String, String>();
- List<ServletMappingMetaData> smappings = wmd.getServletMappings();
- if (smappings != null)
- {
- for(ServletMappingMetaData mapping : smappings)
- {
- // FIXME - Add support for multiple mappings
- mappings.put(mapping.getServletName(), mapping.getUrlPatterns().get(0));
- }
- }
- return mappings;
- }
-
- private Map<String, String> getServletClassMap(JBossWebMetaData wmd)
- {
- Map<String, String> mappings = new HashMap<String, String>();
- JBossServletsMetaData servlets = wmd.getServlets();
- if (servlets != null)
- {
- for (ServletMetaData servlet : servlets)
- {
- // Skip JSPs
- if (servlet.getServletClass() == null || servlet.getServletClass().length() == 0)
- continue;
-
- mappings.put(servlet.getName(), servlet.getServletClass());
- }
- }
- return mappings;
- }
-}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,205 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.metadata;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.common.jboss.WebserviceDescriptionMetaData;
+import org.jboss.metadata.common.jboss.WebserviceDescriptionsMetaData;
+import org.jboss.metadata.ear.jboss.JBossAppMetaData;
+import org.jboss.metadata.ear.spec.ModuleMetaData;
+import org.jboss.metadata.ear.spec.WebModuleMetaData;
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
+import org.jboss.metadata.web.jboss.JBossServletsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
+import org.jboss.metadata.web.spec.ServletMappingMetaData;
+import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData.PublishLocationAdapter;
+import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData.JSEResourceCollection;
+
+/**
+ * Builds container independent meta data from WEB container meta data.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+final class JSEMetaDataBuilder
+{
+
+ private static Logger log = Logger.getLogger(JSEMetaDataBuilder.class);
+
+ JSEArchiveMetaData create(Deployment dep, DeploymentUnit unit)
+ {
+ String contextRoot = null;
+
+ JBossWebMetaData jbossWebMetaData = unit.getAttachment(JBossWebMetaData.class);
+ dep.addAttachment(JBossWebMetaData.class, jbossWebMetaData);
+
+ if (unit.getParent() != null)
+ {
+ JBossAppMetaData appmd = unit.getParent().getAttachment(JBossAppMetaData.class);
+ if (appmd != null)
+ {
+ ModuleMetaData module = appmd.getModule(dep.getSimpleName());
+ if (module != null)
+ {
+ WebModuleMetaData web = (WebModuleMetaData) module.getValue();
+ contextRoot = web.getContextRoot();
+ }
+ }
+ }
+
+ if (contextRoot == null)
+ contextRoot = jbossWebMetaData.getContextRoot();
+
+ JSEArchiveMetaData umd = new JSEArchiveMetaData();
+ umd.setContextRoot(contextRoot);
+ umd.setServletMappings(getServletMappings(jbossWebMetaData));
+ umd.setServletClassNames(getServletClassMap(jbossWebMetaData));
+ umd.setSecurityDomain(jbossWebMetaData.getSecurityDomain());
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(jbossWebMetaData));
+ umd.setSecurityMetaData(getSecurityMetaData(jbossWebMetaData.getSecurityContraints()));
+
+ setConfigNameAndFile(umd, jbossWebMetaData);
+
+ return umd;
+ }
+
+ private void setConfigNameAndFile(JSEArchiveMetaData umd, JBossWebMetaData jbossWebMetaData)
+ {
+ String configName = null;
+ String configFile = null;
+
+ WebserviceDescriptionsMetaData wsDescriptions = jbossWebMetaData.getWebserviceDescriptions();
+ if (wsDescriptions != null && wsDescriptions.size() > 1)
+ log.warn("Multiple <webservice-description> elements not supported");
+
+ if (wsDescriptions != null && wsDescriptions.size() > 0)
+ {
+ WebserviceDescriptionMetaData wsd = wsDescriptions.iterator().next();
+ configName = wsd.getConfigName();
+ configFile = wsd.getConfigFile();
+ }
+
+ List<ParamValueMetaData> contextParams = jbossWebMetaData.getContextParams();
+ if (contextParams != null)
+ {
+ for (ParamValueMetaData ctxParam : contextParams)
+ {
+ if (ctxParam.getParamName().equals("jbossws-config-name"))
+ configName = ctxParam.getParamValue();
+ if (ctxParam.getParamName().equals("jbossws-config-file"))
+ configFile = ctxParam.getParamValue();
+ }
+ }
+
+ umd.setConfigName(configName);
+ umd.setConfigFile(configFile);
+ }
+
+ private PublishLocationAdapter getPublishLocationAdpater(final JBossWebMetaData wmd)
+ {
+ return new PublishLocationAdapter()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ WebserviceDescriptionsMetaData wsdmd = wmd.getWebserviceDescriptions();
+ WebserviceDescriptionMetaData wsmd = wsdmd.get(name);
+ String location = null;
+ if (wsmd != null)
+ location = wsmd.getWsdlPublishLocation();
+ return location;
+ }
+ };
+ }
+
+ private List<JSESecurityMetaData> getSecurityMetaData(final List<SecurityConstraintMetaData> securityConstraints)
+ {
+ ArrayList<JSESecurityMetaData> unifiedsecurityMetaData = new ArrayList<JSESecurityMetaData>();
+ if (securityConstraints != null)
+ {
+ for (SecurityConstraintMetaData securityMetaData : securityConstraints)
+ {
+ JSESecurityMetaData current = new JSESecurityMetaData();
+ unifiedsecurityMetaData.add(current);
+
+ current.setTransportGuarantee(securityMetaData.getTransportGuarantee().name());
+
+ WebResourceCollectionsMetaData resources = securityMetaData.getResourceCollections();
+ for (WebResourceCollectionMetaData webResource : resources)
+ {
+ JSEResourceCollection currentResource = current.addWebResource(webResource.getName());
+ for (String currentPattern : webResource.getUrlPatterns())
+ {
+ currentResource.addPattern(currentPattern);
+ }
+ }
+ }
+ }
+ return unifiedsecurityMetaData;
+ }
+
+ private Map<String, String> getServletMappings(JBossWebMetaData wmd)
+ {
+ Map<String, String> mappings = new HashMap<String, String>();
+ List<ServletMappingMetaData> smappings = wmd.getServletMappings();
+ if (smappings != null)
+ {
+ for(ServletMappingMetaData mapping : smappings)
+ {
+ // FIXME - Add support for multiple mappings
+ mappings.put(mapping.getServletName(), mapping.getUrlPatterns().get(0));
+ }
+ }
+ return mappings;
+ }
+
+ private Map<String, String> getServletClassMap(JBossWebMetaData wmd)
+ {
+ Map<String, String> mappings = new HashMap<String, String>();
+ JBossServletsMetaData servlets = wmd.getServlets();
+ if (servlets != null)
+ {
+ for (ServletMetaData servlet : servlets)
+ {
+ // Skip JSPs
+ if (servlet.getServletClass() == null || servlet.getServletClass().length() == 0)
+ continue;
+
+ mappings.put(servlet.getName(), servlet.getServletClass());
+ }
+ }
+ return mappings;
+ }
+
+}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandler.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandler.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandler.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat;
-
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-
-/**
- * Handle web app security meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public interface SecurityHandler
-{
- /** Add the security domain to jboss-web.xml */
- void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep);
-
- /** Add the security roles to web.xml */
- void addSecurityRoles(JBossWebMetaData webApp, Deployment dep);
-}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandlerEJB21.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandlerEJB21.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandlerEJB21.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat;
-
-import org.jboss.metadata.common.ejb.IAssemblyDescriptorMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-
-/**
- * Handle web app security meta data for EJB21
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class SecurityHandlerEJB21 implements SecurityHandler
-{
- public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
- {
- EJBArchiveMetaData ejbMetaData = dep.getAttachment(EJBArchiveMetaData.class);
- if (ejbMetaData == null)
- throw new IllegalStateException("Cannot obtain application meta data");
-
- String securityDomain = ejbMetaData.getSecurityDomain();
- if (securityDomain != null)
- {
- if (securityDomain.startsWith("java:/jaas/") == false)
- securityDomain = "java:/jaas/" + securityDomain;
-
- jbossWeb.setSecurityDomain(securityDomain);
- }
- }
-
- public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
- {
- JBossMetaData jbmd = dep.getAttachment(JBossMetaData.class);
- IAssemblyDescriptorMetaData assemblyDescriptor = jbmd.getAssemblyDescriptor();
- if (assemblyDescriptor != null)
- {
- SecurityRolesMetaData securityRoles = assemblyDescriptor.getSecurityRoles();
- if (securityRoles != null)
- webApp.setSecurityRoles(securityRoles);
- }
- }
-}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandlerEJB3.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandlerEJB3.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/SecurityHandlerEJB3.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat;
-
-import org.jboss.ejb3.annotation.SecurityDomain;
-import org.jboss.metadata.javaee.spec.SecurityRoleMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
-
-import javax.annotation.security.RolesAllowed;
-import java.util.Iterator;
-
-/**
- * Handle web app security meta data for EJB3
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class SecurityHandlerEJB3 implements SecurityHandler
-{
- public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
- {
- String securityDomain = null;
-
- WebServiceDeployment webServiceDeployment = dep.getAttachment(WebServiceDeployment.class);
- if (webServiceDeployment != null)
- {
- Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
- while (it.hasNext())
- {
- WebServiceDeclaration container = it.next();
- SecurityDomain anSecurityDomain = container.getAnnotation(SecurityDomain.class);
- if (anSecurityDomain != null)
- {
- if (securityDomain != null && !securityDomain.equals(anSecurityDomain.value()))
- throw new IllegalStateException("Multiple security domains not supported");
-
- securityDomain = anSecurityDomain.value();
- }
- }
- }
-
- if (securityDomain != null)
- {
- if (securityDomain.startsWith("java:/jaas/") == false)
- securityDomain = "java:/jaas/" + securityDomain;
-
- jbossWeb.setSecurityDomain(securityDomain);
- }
- }
-
- public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
- {
- WebServiceDeployment webServiceDeployment = dep.getAttachment(WebServiceDeployment.class);
- if (webServiceDeployment != null)
- {
- Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
- while (it.hasNext())
- {
- WebServiceDeclaration container = it.next();
- RolesAllowed anRolesAllowed = container.getAnnotation(RolesAllowed.class);
- if (anRolesAllowed != null)
- {
- SecurityRolesMetaData securityRoles = webApp.getSecurityRoles();
- for (String roleName : anRolesAllowed.value())
- {
- SecurityRoleMetaData role = new SecurityRoleMetaData();
- role.setRoleName(roleName);
- securityRoles.add(role);
- }
- }
- }
- }
- }
-}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat;
-
-import org.jboss.wsf.spi.deployment.Deployment;
-
-/**
- * Modifies the web app according to the stack requirements.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public interface WebMetaDataModifier
-{
- static String PROPERTY_WEBAPP_CONTEXT_PARAMETERS = "org.jboss.ws.webapp.ContextParameterMap";
- static String PROPERTY_WEBAPP_SERVLET_CLASS = "org.jboss.ws.webapp.ServletClass";
-
- void modifyMetaData( Deployment dep );
-}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifierImpl.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifierImpl.java 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifierImpl.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -1,178 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat;
-
-import org.jboss.logging.Logger;
-import org.jboss.metadata.javaee.spec.ParamValueMetaData;
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.ListenerMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-import javax.xml.ws.WebServiceException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The rewriter for web.xml
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public class WebMetaDataModifierImpl implements WebMetaDataModifier
-{
- // logging support
- private static Logger log = Logger.getLogger(WebMetaDataModifierImpl.class);
-
- public void modifyMetaData(Deployment dep)
- {
- JBossWebMetaData jbwmd = dep.getAttachment(JBossWebMetaData.class);
- if (jbwmd == null)
- throw new WebServiceException("Cannot find web meta data");
-
- try
- {
- modifyMetaData(dep, jbwmd);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WebServiceException(e);
- }
- }
-
- private void modifyMetaData(Deployment dep, JBossWebMetaData jbwmd) throws ClassNotFoundException
- {
- String servletClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CLASS);
- if (servletClass == null)
- throw new IllegalStateException("Cannot obtain context property: " + PROPERTY_WEBAPP_SERVLET_CLASS);
-
- Map<String, String> depCtxParams = (Map<String, String>)dep.getProperty(PROPERTY_WEBAPP_CONTEXT_PARAMETERS);
- if (depCtxParams != null)
- {
- List<ParamValueMetaData> contextParams = jbwmd.getContextParams();
- if (contextParams == null)
- {
- contextParams = new ArrayList<ParamValueMetaData>();
- jbwmd.setContextParams(contextParams);
- }
-
- for (Map.Entry<String, String> entry : depCtxParams.entrySet())
- {
- ParamValueMetaData param = new ParamValueMetaData();
- param.setParamName(entry.getKey());
- param.setParamValue(entry.getValue());
- contextParams.add(param);
- }
- }
-
- for (Iterator it = jbwmd.getServlets().iterator(); it.hasNext();)
- {
- JBossServletMetaData servlet = (JBossServletMetaData)it.next();
- List<ParamValueMetaData> initParams = servlet.getInitParam();
- if (initParams == null)
- {
- initParams = new ArrayList<ParamValueMetaData>();
- servlet.setInitParam(initParams);
- }
-
- String linkName = servlet.getServletName();
-
- // find the servlet-class
- String orgServletClassName = servlet.getServletClass();
-
- // JSP
- if (orgServletClassName == null)
- continue;
-
- // Get the servlet class
- Class orgServletClass = null;
- try
- {
- ClassLoader loader = dep.getInitialClassLoader();
- orgServletClass = loader.loadClass(orgServletClassName);
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + orgServletClassName);
- }
-
- String targetBeanName = null;
-
- // Nothing to do if we have an <init-param>
- if (isAlreadyModified(servlet))
- {
- for (ParamValueMetaData initParam : initParams)
- {
- String paramName = initParam.getParamName();
- String paramValue = initParam.getParamValue();
- if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
- {
- targetBeanName = paramValue;
- }
- }
- }
- else
- {
- // Check if it is a real servlet that we can ignore
- if (orgServletClass != null && javax.servlet.Servlet.class.isAssignableFrom(orgServletClass))
- {
- log.info("Ignore servlet: " + orgServletClassName);
- continue;
- }
-
- servlet.setServletClass(servletClass);
-
- // add additional init params
- if (orgServletClassName.equals(servletClass) == false)
- {
- targetBeanName = orgServletClassName;
- ParamValueMetaData initParam = new ParamValueMetaData();
- initParam.setParamName(Endpoint.SEPID_DOMAIN_ENDPOINT);
- initParam.setParamValue(targetBeanName);
- initParams.add(initParam);
- }
- }
-
- if (targetBeanName == null)
- throw new IllegalStateException("Cannot obtain service endpoint bean for: " + linkName);
- }
- }
-
- // Return true if the web.xml is already modified
- private boolean isAlreadyModified(JBossServletMetaData servlet)
- {
- for (ParamValueMetaData initParam : servlet.getInitParam())
- {
- String paramName = initParam.getParamName();
- if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
- return true;
- }
- return false;
- }
-}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandler.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandler.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandler.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat.ejb;
+
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+
+/**
+ * Handle web app security meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public interface SecurityHandler
+{
+ /** Add the security domain to jboss-web.xml */
+ void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep);
+
+ /** Add the security roles to web.xml */
+ void addSecurityRoles(JBossWebMetaData webApp, Deployment dep);
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB21.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB21.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB21.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat.ejb;
+
+import org.jboss.metadata.common.ejb.IAssemblyDescriptorMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+
+/**
+ * Handle web app security meta data for EJB21
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class SecurityHandlerEJB21 implements SecurityHandler
+{
+ public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
+ {
+ EJBArchiveMetaData ejbMetaData = dep.getAttachment(EJBArchiveMetaData.class);
+ if (ejbMetaData == null)
+ throw new IllegalStateException("Cannot obtain application meta data");
+
+ String securityDomain = ejbMetaData.getSecurityDomain();
+ if (securityDomain != null)
+ {
+ if (securityDomain.startsWith("java:/jaas/") == false)
+ securityDomain = "java:/jaas/" + securityDomain;
+
+ jbossWeb.setSecurityDomain(securityDomain);
+ }
+ }
+
+ public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
+ {
+ JBossMetaData jbmd = dep.getAttachment(JBossMetaData.class);
+ IAssemblyDescriptorMetaData assemblyDescriptor = jbmd.getAssemblyDescriptor();
+ if (assemblyDescriptor != null)
+ {
+ SecurityRolesMetaData securityRoles = assemblyDescriptor.getSecurityRoles();
+ if (securityRoles != null)
+ webApp.setSecurityRoles(securityRoles);
+ }
+ }
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB3.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB3.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB3.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat.ejb;
+
+import org.jboss.ejb3.annotation.SecurityDomain;
+import org.jboss.metadata.javaee.spec.SecurityRoleMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
+
+import javax.annotation.security.RolesAllowed;
+import java.util.Iterator;
+
+/**
+ * Handle web app security meta data for EJB3
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class SecurityHandlerEJB3 implements SecurityHandler
+{
+ public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
+ {
+ String securityDomain = null;
+
+ WebServiceDeployment webServiceDeployment = dep.getAttachment(WebServiceDeployment.class);
+ if (webServiceDeployment != null)
+ {
+ Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
+ while (it.hasNext())
+ {
+ WebServiceDeclaration container = it.next();
+ SecurityDomain anSecurityDomain = container.getAnnotation(SecurityDomain.class);
+ if (anSecurityDomain != null)
+ {
+ if (securityDomain != null && !securityDomain.equals(anSecurityDomain.value()))
+ throw new IllegalStateException("Multiple security domains not supported");
+
+ securityDomain = anSecurityDomain.value();
+ }
+ }
+ }
+
+ if (securityDomain != null)
+ {
+ if (securityDomain.startsWith("java:/jaas/") == false)
+ securityDomain = "java:/jaas/" + securityDomain;
+
+ jbossWeb.setSecurityDomain(securityDomain);
+ }
+ }
+
+ public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
+ {
+ WebServiceDeployment webServiceDeployment = dep.getAttachment(WebServiceDeployment.class);
+ if (webServiceDeployment != null)
+ {
+ Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
+ while (it.hasNext())
+ {
+ WebServiceDeclaration container = it.next();
+ RolesAllowed anRolesAllowed = container.getAnnotation(RolesAllowed.class);
+ if (anRolesAllowed != null)
+ {
+ SecurityRolesMetaData securityRoles = webApp.getSecurityRoles();
+ for (String roleName : anRolesAllowed.value())
+ {
+ SecurityRoleMetaData role = new SecurityRoleMetaData();
+ role.setRoleName(roleName);
+ securityRoles.add(role);
+ }
+ }
+ }
+ }
+ }
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/WebAppGeneratorDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/WebAppGeneratorDeploymentAspect.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/WebAppGeneratorDeploymentAspect.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,285 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat.ejb;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossServletsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.AuthConstraintMetaData;
+import org.jboss.metadata.web.spec.LoginConfigMetaData;
+import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
+import org.jboss.metadata.web.spec.ServletMappingMetaData;
+import org.jboss.metadata.web.spec.TransportGuaranteeType;
+import org.jboss.metadata.web.spec.UserDataConstraintMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
+import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.WSFDeploymentException;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
+
+/**
+ * A deployment aspect that generates a webapp for an EJB endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 13-Oct-2007
+ */
+public class WebAppGeneratorDeploymentAspect extends DeploymentAspect
+{
+ private SecurityHandler securityHandlerEJB21;
+ private SecurityHandler securityHandlerEJB3;
+
+ public void setSecurityHandlerEJB21(SecurityHandler handler)
+ {
+ this.securityHandlerEJB21 = handler;
+ }
+
+ public void setSecurityHandlerEJB3(SecurityHandler handler)
+ {
+ this.securityHandlerEJB3 = handler;
+ }
+
+ @Override
+ public void start(Deployment dep)
+ {
+ final DeploymentType deploymentType = dep.getType();
+
+ if (DeploymentType.JAXRPC_EJB21.equals(deploymentType))
+ {
+ JBossWebMetaData jbwmd = generateWebDeployment(dep, securityHandlerEJB21);
+ dep.addAttachment(JBossWebMetaData.class, jbwmd);
+ }
+ else if (DeploymentType.JAXWS_EJB3.equals(deploymentType))
+ {
+ JBossWebMetaData jbwmd = generateWebDeployment(dep, securityHandlerEJB3);
+ dep.addAttachment(JBossWebMetaData.class, jbwmd);
+ }
+ }
+
+ protected JBossWebMetaData generateWebDeployment(Deployment dep, SecurityHandler securityHandler)
+ {
+ JBossWebMetaData jbwmd = new JBossWebMetaData();
+ createWebAppDescriptor(dep, jbwmd, securityHandler);
+ createJBossWebAppDescriptor(dep, jbwmd, securityHandler);
+ return jbwmd;
+ }
+
+ protected void createWebAppDescriptor(Deployment dep, JBossWebMetaData jbwmd, SecurityHandler securityHandler)
+ {
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ JBossServletsMetaData servlets = jbwmd.getServlets();
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ JBossServletMetaData servlet = new JBossServletMetaData();
+ servlet.setServletName(ep.getShortName());
+ servlet.setServletClass(ep.getTargetBeanName());
+ servlets.add(servlet);
+ }
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ List<ServletMappingMetaData> servletMappings = jbwmd.getServletMappings();
+ if (servletMappings == null)
+ {
+ servletMappings = new ArrayList<ServletMappingMetaData>();
+ jbwmd.setServletMappings(servletMappings);
+ }
+ ServletMappingMetaData servletMapping = new ServletMappingMetaData();
+ servletMapping.setServletName(ep.getShortName());
+ servletMapping.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
+ servletMappings.add(servletMapping);
+ }
+
+ String authMethod = null;
+
+ // Add web-app/security-constraint for each port component
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ String ejbName = ep.getShortName();
+
+ Boolean secureWSDLAccess = null;
+ String transportGuarantee = null;
+ String beanAuthMethod = null;
+
+ WebContext anWebContext = (WebContext)ep.getTargetBeanClass().getAnnotation(WebContext.class);
+ if (anWebContext != null)
+ {
+ if (anWebContext.authMethod().length() > 0)
+ beanAuthMethod = anWebContext.authMethod();
+ if (anWebContext.transportGuarantee().length() > 0)
+ transportGuarantee = anWebContext.transportGuarantee();
+ if (anWebContext.secureWSDLAccess())
+ secureWSDLAccess = anWebContext.secureWSDLAccess();
+ }
+
+ EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
+ if (appMetaData != null && appMetaData.getBeanByEjbName(ejbName) != null)
+ {
+ EJBMetaData bmd = appMetaData.getBeanByEjbName(ejbName);
+ EJBSecurityMetaData smd = bmd.getSecurityMetaData();
+ if (smd != null)
+ {
+ beanAuthMethod = smd.getAuthMethod();
+ transportGuarantee = smd.getTransportGuarantee();
+ secureWSDLAccess = smd.getSecureWSDLAccess();
+ }
+ }
+
+ if (beanAuthMethod != null || transportGuarantee != null)
+ {
+ /*
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>TestUnAuthPort</web-resource-name>
+ <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>*</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ */
+ List<SecurityConstraintMetaData> securityContraints = jbwmd.getSecurityContraints();
+ if (securityContraints == null)
+ {
+ securityContraints = new ArrayList<SecurityConstraintMetaData>();
+ jbwmd.setSecurityContraints(securityContraints);
+ }
+ SecurityConstraintMetaData securityConstraint = new SecurityConstraintMetaData();
+ securityContraints.add(securityConstraint);
+
+ WebResourceCollectionsMetaData resourceCollections = securityConstraint.getResourceCollections();
+ if (resourceCollections == null)
+ {
+ resourceCollections = new WebResourceCollectionsMetaData();
+ securityConstraint.setResourceCollections(resourceCollections);
+ }
+ WebResourceCollectionMetaData resourceCollection = new WebResourceCollectionMetaData();
+ resourceCollections.add(resourceCollection);
+
+ resourceCollection.setWebResourceName(ejbName);
+ resourceCollection.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
+ ArrayList<String> httpMethods = new ArrayList<String>();
+ resourceCollection.setHttpMethods(httpMethods);
+ if (Boolean.TRUE.equals(secureWSDLAccess))
+ {
+ httpMethods.add("GET");
+ }
+ httpMethods.add("POST");
+
+ // Optional auth-constraint
+ if (beanAuthMethod != null)
+ {
+ // Only the first auth-method gives the war login-config/auth-method
+ if (authMethod == null)
+ authMethod = beanAuthMethod;
+
+ AuthConstraintMetaData authConstraint = new AuthConstraintMetaData();
+ authConstraint.setRoleNames(Arrays.asList(new String[] { "*" }));
+ securityConstraint.setAuthConstraint(authConstraint);
+ }
+ // Optional user-data-constraint
+ if (transportGuarantee != null)
+ {
+ UserDataConstraintMetaData userDataConstraint = new UserDataConstraintMetaData();
+ userDataConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(transportGuarantee));
+ securityConstraint.setUserDataConstraint(userDataConstraint);
+ }
+ }
+ }
+
+ // Optional login-config/auth-method
+ if (authMethod != null && securityHandler != null)
+ {
+ LoginConfigMetaData loginConfig = jbwmd.getLoginConfig();
+ if (loginConfig == null)
+ {
+ loginConfig = new LoginConfigMetaData();
+ jbwmd.setLoginConfig(loginConfig);
+ }
+ loginConfig.setAuthMethod(authMethod);
+ loginConfig.setRealmName("EJBServiceEndpointServlet Realm");
+
+ securityHandler.addSecurityRoles(jbwmd, dep);
+ }
+ }
+
+ /**
+ * Creates jboss-web meta data.
+ *
+ * <jboss-web>
+ * <security-domain>java:/jaas/custom-security-domain</security-domain>
+ * <context-root>/custom-context-root</context-root>
+ * <virtual-host>custom-virtual-host</virtual-host>
+ * </jboss-web>
+ *
+ * @param dep
+ * @param jbwmd
+ * @param securityHandler
+ */
+ protected void createJBossWebAppDescriptor
+ (
+ final Deployment dep, final JBossWebMetaData jbossWebMD, final SecurityHandler securityHandler
+ )
+ {
+ // Set security domain
+ if (securityHandler != null)
+ {
+ securityHandler.addSecurityDomain(jbossWebMD, dep);
+ }
+
+ // Set context root
+ String contextRoot = dep.getService().getContextRoot();
+ jbossWebMD.setContextRoot(contextRoot);
+
+ // Set virtual hosts
+ String[] virtualHosts = dep.getService().getVirtualHosts();
+ if (virtualHosts != null && virtualHosts.length > 0)
+ {
+ jbossWebMD.setVirtualHosts(Arrays.asList(virtualHosts));
+ }
+ }
+
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebAppDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebAppDeploymentAspect.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebAppDeploymentAspect.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat.jse;
+
+import javax.security.jacc.PolicyConfiguration;
+import javax.security.jacc.PolicyConfigurationFactory;
+import org.jboss.web.WebPermissionMapping;
+
+import javax.xml.ws.WebServiceException;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.WSFDeploymentException;
+
+/**
+ * Deploy the generated webapp to JBoss
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.com
+ * @since 12-May-2006
+ */
+public class WebAppDeploymentAspect extends DeploymentAspect
+{
+ private WebMetaDataModifier webMetaDataModifier;
+
+ public void setWebMetaDataModifier(WebMetaDataModifier webMetaDataModifier)
+ {
+ this.webMetaDataModifier = webMetaDataModifier;
+ }
+
+ public void start(Deployment dep)
+ {
+ JBossWebMetaData jbwmd = dep.getAttachment(JBossWebMetaData.class);
+ if (jbwmd == null)
+ throw new WebServiceException("Cannot find web meta data");
+
+ DeploymentUnit unit = dep.getAttachment(DeploymentUnit.class);
+ if (unit != null)
+ {
+ try
+ {
+ webMetaDataModifier.modifyMetaData(dep);
+
+ try
+ {
+ generateJACCPermissions(dep.getSimpleName(), jbwmd); // TODO: make it another deployment aspect
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Exception generating JACC perms:",e);
+ }
+
+ // Attaching it to the DeploymentUnit will cause a new webapp deployment
+ unit.addAttachment(JBossWebMetaData.class, jbwmd);
+ }
+ catch (Exception ex)
+ {
+ WSFDeploymentException.rethrow(ex);
+ }
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot obtain deployment unit");
+ }
+ }
+
+ /**
+ * JBAS-5935: The dynamic web application generated by the JBossWS
+ * does not go through the war security deployer. Hence the JACC
+ * permissions are not created. There is a need to explicitly create
+ * the war jacc permissions.
+ * @param depName
+ * @param jbwmd
+ * @throws Exception
+ */
+ protected void generateJACCPermissions(String depName, JBossWebMetaData jbwmd)
+ throws Exception
+ {
+ PolicyConfigurationFactory policyConfigurationFactory =
+ PolicyConfigurationFactory.getPolicyConfigurationFactory();
+ PolicyConfiguration policyConfiguration =
+ policyConfigurationFactory.getPolicyConfiguration(depName, false);
+ WebPermissionMapping.createPermissions(jbwmd, policyConfiguration);
+ policyConfiguration.commit();
+ }
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifier.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifier.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifier.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat.jse;
+
+import org.jboss.wsf.spi.deployment.Deployment;
+
+/**
+ * Modifies the web app according to the stack requirements.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public interface WebMetaDataModifier
+{
+ static String PROPERTY_WEBAPP_CONTEXT_PARAMETERS = "org.jboss.ws.webapp.ContextParameterMap";
+ static String PROPERTY_WEBAPP_SERVLET_CLASS = "org.jboss.ws.webapp.ServletClass";
+
+ void modifyMetaData( Deployment dep );
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifierImpl.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifierImpl.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifierImpl.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.tomcat.jse;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.ListenerMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+import javax.xml.ws.WebServiceException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The rewriter for web.xml
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public class WebMetaDataModifierImpl implements WebMetaDataModifier
+{
+ // logging support
+ private static Logger log = Logger.getLogger(WebMetaDataModifierImpl.class);
+
+ public void modifyMetaData(Deployment dep)
+ {
+ JBossWebMetaData jbwmd = dep.getAttachment(JBossWebMetaData.class);
+ if (jbwmd == null)
+ throw new WebServiceException("Cannot find web meta data");
+
+ try
+ {
+ modifyMetaData(dep, jbwmd);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WebServiceException(e);
+ }
+ }
+
+ private void modifyMetaData(Deployment dep, JBossWebMetaData jbwmd) throws ClassNotFoundException
+ {
+ String servletClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CLASS);
+ if (servletClass == null)
+ throw new IllegalStateException("Cannot obtain context property: " + PROPERTY_WEBAPP_SERVLET_CLASS);
+
+ Map<String, String> depCtxParams = (Map<String, String>)dep.getProperty(PROPERTY_WEBAPP_CONTEXT_PARAMETERS);
+ if (depCtxParams != null)
+ {
+ List<ParamValueMetaData> contextParams = jbwmd.getContextParams();
+ if (contextParams == null)
+ {
+ contextParams = new ArrayList<ParamValueMetaData>();
+ jbwmd.setContextParams(contextParams);
+ }
+
+ for (Map.Entry<String, String> entry : depCtxParams.entrySet())
+ {
+ ParamValueMetaData param = new ParamValueMetaData();
+ param.setParamName(entry.getKey());
+ param.setParamValue(entry.getValue());
+ contextParams.add(param);
+ }
+ }
+
+ for (Iterator it = jbwmd.getServlets().iterator(); it.hasNext();)
+ {
+ JBossServletMetaData servlet = (JBossServletMetaData)it.next();
+ List<ParamValueMetaData> initParams = servlet.getInitParam();
+ if (initParams == null)
+ {
+ initParams = new ArrayList<ParamValueMetaData>();
+ servlet.setInitParam(initParams);
+ }
+
+ String linkName = servlet.getServletName();
+
+ // find the servlet-class
+ String orgServletClassName = servlet.getServletClass();
+
+ // JSP
+ if (orgServletClassName == null)
+ continue;
+
+ // Get the servlet class
+ Class orgServletClass = null;
+ try
+ {
+ ClassLoader loader = dep.getInitialClassLoader();
+ orgServletClass = loader.loadClass(orgServletClassName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + orgServletClassName);
+ }
+
+ String targetBeanName = null;
+
+ // Nothing to do if we have an <init-param>
+ if (isAlreadyModified(servlet))
+ {
+ for (ParamValueMetaData initParam : initParams)
+ {
+ String paramName = initParam.getParamName();
+ String paramValue = initParam.getParamValue();
+ if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
+ {
+ targetBeanName = paramValue;
+ }
+ }
+ }
+ else
+ {
+ // Check if it is a real servlet that we can ignore
+ if (orgServletClass != null && javax.servlet.Servlet.class.isAssignableFrom(orgServletClass))
+ {
+ log.info("Ignore servlet: " + orgServletClassName);
+ continue;
+ }
+
+ servlet.setServletClass(servletClass);
+
+ // add additional init params
+ if (orgServletClassName.equals(servletClass) == false)
+ {
+ targetBeanName = orgServletClassName;
+ ParamValueMetaData initParam = new ParamValueMetaData();
+ initParam.setParamName(Endpoint.SEPID_DOMAIN_ENDPOINT);
+ initParam.setParamValue(targetBeanName);
+ initParams.add(initParam);
+ }
+ }
+
+ if (targetBeanName == null)
+ throw new IllegalStateException("Cannot obtain service endpoint bean for: " + linkName);
+ }
+ }
+
+ // Return true if the web.xml is already modified
+ private boolean isAlreadyModified(JBossServletMetaData servlet)
+ {
+ for (ParamValueMetaData initParam : servlet.getInitParam())
+ {
+ String paramName = initParam.getParamName();
+ if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
+ return true;
+ }
+ return false;
+ }
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java 2009-07-23 09:54:16 UTC (rev 10371)
@@ -0,0 +1,290 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.util;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.jws.WebService;
+import javax.servlet.Servlet;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
+
+/**
+ * JBoss AS integration helper class.
+ *
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+public final class Helper
+{
+
+ /*
+ * TODO: implement methods
+ * * getRequiredAttachment( DeploymentUnit unit, Class<?> attachmentType )
+ * * getRequiredAttachment( Deployment dep, Class<?> attachmentType )
+ * both methods should throw exception if attachment not found
+ * * getOptionalAttachment( DeploymentUnit unit, Class<?> attachmentType )
+ * * getOptionalAttachment( Deployment dep, Class<?> attachmentType )
+ * both methods will return null if attachment will not be found.
+ */
+
+ /** Logger. */
+ private static final Logger log = Logger.getLogger( Helper.class );
+
+ /**
+ * Forbidden constructor.
+ */
+ private Helper()
+ {
+ super();
+ }
+
+ public static boolean isWebServiceDeployment( final DeploymentUnit unit )
+ {
+ return unit.getAttachment( DeploymentType.class ) != null;
+ }
+
+ public static boolean isJseDeployment( final DeploymentUnit unit )
+ {
+ if ( Helper.isWebServiceDeployment( unit ) )
+ {
+ final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
+ final boolean isJaxrpcJse = DeploymentType.JAXRPC_JSE.equals( deploymentType );
+ final boolean isJaxwsJse = DeploymentType.JAXWS_JSE.equals( deploymentType );
+
+ return isJaxwsJse || isJaxrpcJse;
+ }
+
+ return false;
+ }
+
+ public static boolean isEjbDeployment( final DeploymentUnit unit )
+ {
+ if ( Helper.isWebServiceDeployment( unit ) )
+ {
+ final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
+ final boolean isJaxwsEjb3 = DeploymentType.JAXWS_EJB3.equals( deploymentType );
+ final boolean isJaxrpcEjb21 = DeploymentType.JAXRPC_EJB21.equals( deploymentType );
+
+ return isJaxwsEjb3 || isJaxrpcEjb21;
+ }
+
+ return false;
+ }
+
+ public static boolean isJaxwsDeployment( final DeploymentUnit unit )
+ {
+ if ( Helper.isWebServiceDeployment( unit ) )
+ {
+ final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
+ final boolean isJaxwsEjb3 = DeploymentType.JAXWS_EJB3.equals( deploymentType );
+ final boolean isJaxwsJse = DeploymentType.JAXWS_JSE.equals( deploymentType );
+
+ return isJaxwsEjb3 || isJaxwsJse;
+ }
+
+ return false;
+ }
+
+ public static boolean isJaxrpcDeployment( final DeploymentUnit unit )
+ {
+ if ( Helper.isWebServiceDeployment( unit ) )
+ {
+ final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
+ final boolean isJaxrpcEjb21 = DeploymentType.JAXRPC_EJB21.equals( deploymentType );
+ final boolean isJaxrpcJse = DeploymentType.JAXRPC_JSE.equals( deploymentType );
+
+ return isJaxrpcEjb21 || isJaxrpcJse;
+ }
+
+ return false;
+ }
+
+ public static boolean isJaxrpcJseDeployment( final DeploymentUnit unit )
+ {
+ final boolean isJaxrpc = Helper.isJaxrpcDeployment( unit );
+ final boolean isJse = Helper.isJseDeployment( unit );
+
+ return isJse && isJaxrpc;
+ }
+
+ public static boolean isJaxwsJseDeployment( final DeploymentUnit unit )
+ {
+ final boolean isJaxws = Helper.isJaxwsDeployment( unit );
+ final boolean isJse = Helper.isJseDeployment( unit );
+
+ return isJse && isJaxws;
+ }
+
+ public static boolean isJaxrpcEjbDeployment( final DeploymentUnit unit )
+ {
+ final boolean isJaxrpc = Helper.isJaxrpcDeployment( unit );
+ final boolean isEjb = Helper.isEjbDeployment( unit );
+
+ return isEjb && isJaxrpc;
+ }
+
+ public static boolean isJaxwsEjbDeployment( final DeploymentUnit unit )
+ {
+ final boolean isJaxws = Helper.isJaxwsDeployment( unit );
+ final boolean isEjb = Helper.isEjbDeployment( unit );
+
+ return isEjb && isJaxws;
+ }
+
+ public static final boolean isWebServiceBean( final WebServiceDeclaration ejbContainerAdapter )
+ {
+ boolean isWebServiceBean = false;
+ boolean isWebService = ejbContainerAdapter.getAnnotation(WebService.class) != null;
+ boolean isWebServiceProvider = ejbContainerAdapter.getAnnotation(WebServiceProvider.class) != null;
+ isWebServiceBean = isWebService || isWebServiceProvider;
+
+ return isWebServiceBean;
+ }
+
+ public static final boolean isEjb3Deployment( final DeploymentUnit unit )
+ {
+ final WebServiceDeployment wsDeployment = unit.getAttachment( WebServiceDeployment.class );
+
+ Iterator<WebServiceDeclaration> it = wsDeployment.getServiceEndpoints().iterator();
+ while (it.hasNext())
+ {
+ WebServiceDeclaration container = it.next();
+ if (Helper.isWebServiceBean(container))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static final List<ServletMetaData> getJaxwsServlets( final DeploymentUnit unit )
+ {
+ return Helper.getRelevantServlets( unit, true );
+ }
+
+ public static List<ServletMetaData> getJaxrpcServlets( final DeploymentUnit unit )
+ {
+ return Helper.getRelevantServlets( unit, false );
+ }
+
+ private static final List< ServletMetaData > getRelevantServlets( final DeploymentUnit unit, final boolean jaxws )
+ {
+ try
+ {
+ final JBossWebMetaData jbossWebMD = unit.getAttachment(JBossWebMetaData.class);
+ final ClassLoader loader = unit.getClassLoader();
+
+ List<ServletMetaData> endpoints = new ArrayList<ServletMetaData>();
+ for (ServletMetaData servlet : jbossWebMD.getServlets())
+ {
+ String servletClassName = getTargetBean(servlet);
+
+ // Skip JSPs
+ if (servletClassName == null || servletClassName.length() == 0)
+ continue;
+
+ try
+ {
+ Class<?> servletClass = loader.loadClass(servletClassName.trim());
+ boolean isServlet = servletClass.isAssignableFrom(Servlet.class);
+ if (false == isServlet)
+ {
+ boolean isWebService = servletClass.isAnnotationPresent(WebService.class);
+ boolean isWebServiceProvider = servletClass.isAnnotationPresent(WebServiceProvider.class);
+ if ( jaxws )
+ {
+ if (isWebService || isWebServiceProvider)
+ {
+ endpoints.add(servlet); // jaxws endpoint
+ }
+ }
+ else
+ {
+ if (!isWebService && !isWebServiceProvider)
+ {
+ endpoints.add(servlet); // jaxrpc endpoint
+ }
+ }
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ continue;
+ }
+ }
+
+ return endpoints;
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot process web deployment", ex);
+ return Collections.emptyList();
+ }
+ }
+
+ public static String getTargetBean(ServletMetaData servlet)
+ {
+ String endpointClass = servlet.getServletClass();
+ List<ParamValueMetaData> initParams = servlet.getInitParam();
+ if (initParams != null)
+ {
+ for (ParamValueMetaData param : initParams)
+ {
+ if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(param.getParamName()))
+ {
+ endpointClass = param.getParamValue();
+ break;
+ }
+ }
+ }
+ return endpointClass;
+ }
+
+ public static ServletMetaData getServletForName( final JBossWebMetaData jbossWebMD, final String servletName )
+ {
+ for ( JBossServletMetaData servlet : jbossWebMD.getServlets() )
+ {
+ if ( servlet.getName().equals( servletName ) )
+ {
+ return servlet;
+ }
+ }
+
+ throw new IllegalStateException( "Cannot find servlet for link: " + servletName );
+ }
+
+}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-22 09:40:52 UTC (rev 10370)
+++ container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-23 09:54:16 UTC (rev 10371)
@@ -13,7 +13,7 @@
</bean>
<!-- An abstraction of server configuration aspects. -->
- <bean name="WSServerConfig" class="org.jboss.webservices.integration.deployers.ServerConfigImpl">
+ <bean name="WSServerConfig" class="org.jboss.webservices.integration.config.ServerConfigImpl">
<property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
<!--
@@ -53,13 +53,30 @@
<property name="relativeOrder">2</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
+ <!-- WSDeploymentAspectDeployers factory -->
+ <bean name="WSDeployersFactory" class="org.jboss.webservices.integration.deployers.WSDeployersFactory">
+ <constructor>
+ <parameter>
+ <inject bean="Deployers"/>
+ </parameter>
+ </constructor>
+ <incallback method="newDeployer"/>
+ </bean>
+
+ <!-- Deployment aspect helper beans -->
+ <bean name="WSSecurityHandlerEJB21" class="org.jboss.webservices.integration.tomcat.ejb.SecurityHandlerEJB21"/>
+ <bean name="WSSecurityHandlerEJB3" class="org.jboss.webservices.integration.tomcat.ejb.SecurityHandlerEJB3"/>
+ <bean name="WSWebMetaDataModifier" class="org.jboss.webservices.integration.tomcat.jse.WebMetaDataModifierImpl"/>
+ <bean name="WSContainerMetaDataBuilder" class="org.jboss.webservices.integration.metadata.ContainerMetaDataBuilder"/>
+
<!-- The AS specific deployment aspects -->
- <bean name="WSContainerMetaDataDeploymentAspect" class="org.jboss.webservices.integration.aspects.ContainerMetaDataDeploymentAspect">
+ <bean name="WSContainerMetaDataDeploymentAspect" class="org.jboss.webservices.integration.metadata.ContainerMetaDataDeploymentAspect">
<property name="provides">ContainerMetaData, VFSRoot</property>
+ <property name="metaDataBuilder"><inject bean="WSContainerMetaDataBuilder"/></property>
<property name="relativeOrder">12</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSInjectionMetaDataDeploymentAspect" class="org.jboss.webservices.integration.aspects.InjectionMetaDataDeploymentAspect">
+ <bean name="WSInjectionMetaDataDeploymentAspect" class="org.jboss.webservices.integration.injection.InjectionMetaDataDeploymentAspect">
<property name="requires">WebMetaData</property>
<property name="provides">InjectionMetaData</property>
<property name="ejbReferenceResolver"><inject bean="org.jboss.ejb3.EjbReferenceResolver"/></property>
@@ -86,8 +103,8 @@
<bean name="WSEndpointLifecycleDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointLifecycleDeploymentAspect">
<property name="provides">LifecycleHandler</property>
+ <property name="last">true</property>
<property name="relativeOrder">37</property> <!-- [JBDEPLOY-201] workaround -->
- <property name="last">true</property>
</bean>
<bean name="WSEndpointMetricsDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointMetricsDeploymentAspect">
@@ -113,14 +130,14 @@
<property name="relativeOrder">15</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSWebAppDeploymentAspect" class="org.jboss.webservices.integration.aspects.WebAppDeploymentAspect">
+ <bean name="WSWebAppDeploymentAspect" class="org.jboss.webservices.integration.tomcat.jse.WebAppDeploymentAspect">
<property name="requires">WebMetaData, ContextProperties, StackDescriptor</property>
<property name="provides">WebMetaData</property>
<property name="webMetaDataModifier"><inject bean="WSWebMetaDataModifier"/></property>
<property name="relativeOrder">33</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSWebAppGeneratorDeploymentAspect" class="org.jboss.webservices.integration.aspects.WebAppGeneratorDeploymentAspect">
+ <bean name="WSWebAppGeneratorDeploymentAspect" class="org.jboss.webservices.integration.tomcat.ejb.WebAppGeneratorDeploymentAspect">
<property name="requires">VirtualHosts,URLPattern</property>
<property name="provides">WebMetaData</property>
<property name="securityHandlerEJB21"><inject bean="WSSecurityHandlerEJB21"/></property>
@@ -128,19 +145,4 @@
<property name="relativeOrder">32</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <!-- WSDeploymentAspectDeployers factory -->
- <bean name="WSDeployersFactory" class="org.jboss.webservices.integration.deployers.WSDeployersFactory">
- <constructor>
- <parameter class="org.jboss.deployers.plugins.deployers.DeployersImpl">
- <inject bean="Deployers"/>
- </parameter>
- </constructor>
- <incallback method="newDeployer"/>
- </bean>
-
- <!-- Deployment aspect helper beans -->
- <bean name="WSSecurityHandlerEJB21" class="org.jboss.webservices.integration.tomcat.SecurityHandlerEJB21"/>
- <bean name="WSSecurityHandlerEJB3" class="org.jboss.webservices.integration.tomcat.SecurityHandlerEJB3"/>
- <bean name="WSWebMetaDataModifier" class="org.jboss.webservices.integration.tomcat.WebMetaDataModifierImpl"/>
-
</deployment>
14 years, 9 months
JBossWS SVN: r10370 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-22 05:40:52 -0400 (Wed, 22 Jul 2009)
New Revision: 10370
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java
Removed:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyServiceDelegate.java
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
Log:
[JBWS-2521] Configuring ServiceRef stub properties the proper way
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2009-07-21 16:46:23 UTC (rev 10369)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2009-07-22 09:40:52 UTC (rev 10370)
@@ -23,6 +23,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.apache.cxf.configuration.Configurer;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
@@ -59,6 +60,7 @@
*
* @author Thomas.Diesler(a)jboss.com
* @author Richard.Opalka(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
*/
public class ServiceObjectFactory implements ObjectFactory
{
@@ -89,8 +91,6 @@
{
try
{
- BusFactory.setThreadDefaultBus(null); // cleanup thread locals before constructing Service
-
Reference ref = (Reference)obj;
// Get the target class name
@@ -98,6 +98,14 @@
// Unmarshall the UnifiedServiceRef
UnifiedServiceRefMetaData serviceRef = unmarshallServiceRef(ref);
+
+ //Reset bus before constructing Service
+ BusFactory.setThreadDefaultBus(null);
+ Bus bus = BusFactory.getThreadDefaultBus();
+ //Add extension to configure stub properties using the UnifiedServiceRefMetaData
+ Configurer configurer = bus.getExtension(Configurer.class);
+ bus.setExtension(new ServiceRefStubPropertyConfigurer(serviceRef, configurer), Configurer.class);
+
String serviceRefName = serviceRef.getServiceRefName();
QName serviceQName = serviceRef.getServiceQName();
@@ -151,9 +159,6 @@
}
}
- // Configure the service
- configureService((Service)target, serviceRef);
-
if (targetClassName != null && targetClassName.equals(serviceImplClass) == false)
{
try
@@ -189,11 +194,9 @@
if ((serviceRef.getHandlerChain() != null) && (target instanceof Service))
{
- Bus bus = BusFactory.getThreadDefaultBus();
((Service)target).setHandlerResolver(new HandlerResolverImpl(bus, serviceRef.getHandlerChain(), target.getClass()));
}
- hackServiceDelegate(target, serviceRef);
return target;
}
@@ -204,68 +207,6 @@
}
}
- // TODO: ugly hack that should be removed in the future
- private Object hackServiceDelegate(final Object service, final UnifiedServiceRefMetaData serviceRef) throws Throwable
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- try
- {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>()
- {
- public Object run() throws Exception
- {
- Field delegateField = findServiceDelegateField(service.getClass());
- if (delegateField != null)
- {
- delegateField.setAccessible(true);
- ServiceDelegate delegate = (ServiceDelegate)delegateField.get(service);
- delegateField.set(service, new ServiceRefStubPropertyServiceDelegate(delegate, serviceRef));
- return delegate;
- } else {
- return null;
- }
- }
- });
- }
- catch (PrivilegedActionException e)
- {
- throw e.getCause();
- }
- }
- Field delegateField = findServiceDelegateField(service.getClass());
- if (delegateField != null)
- {
- delegateField.setAccessible(true);
- ServiceDelegate delegate = (ServiceDelegate)delegateField.get(service);
- delegateField.set(service, new ServiceRefStubPropertyServiceDelegate(delegate, serviceRef));
- return delegate;
- } else {
- return null;
- }
- }
-
- private static Field findServiceDelegateField(Class<?> clazz)
- {
- while (clazz != null)
- {
- for (Field f : clazz.getDeclaredFields())
- {
- if (f.getType().equals(ServiceDelegate.class))
- return f;
- }
- clazz = clazz.getSuperclass();
- }
- return null;
- }
-
-
- private void configureService(Service service, UnifiedServiceRefMetaData serviceRef)
- {
- log.warn("Service configuration not available in Apache-CXF");
- }
-
private UnifiedServiceRefMetaData unmarshallServiceRef(Reference ref) throws ClassNotFoundException, NamingException
{
UnifiedServiceRefMetaData sref;
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java 2009-07-22 09:40:52 UTC (rev 10370)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.stack.cxf.client;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
+
+/**
+ * A CXF configurer that sets the serviceref stub properties in the JaxWsProxyFactoryBean
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 21-Jul-2009
+ */
+public class ServiceRefStubPropertyConfigurer implements Configurer
+{
+ private UnifiedServiceRefMetaData serviceRefMD;
+ private Configurer delegate;
+
+ public ServiceRefStubPropertyConfigurer(UnifiedServiceRefMetaData serviceRefMD, Configurer delegate)
+ {
+ this.serviceRefMD = serviceRefMD;
+ this.delegate = delegate;
+ }
+
+ public void configureBean(Object beanInstance)
+ {
+ if (beanInstance instanceof JaxWsProxyFactoryBean)
+ {
+ configureJaxWsProxyFactoryBean((JaxWsProxyFactoryBean)beanInstance);
+ }
+ if (delegate != null)
+ {
+ delegate.configureBean(beanInstance);
+ }
+ }
+
+ public void configureBean(String name, Object beanInstance)
+ {
+ if (beanInstance instanceof JaxWsProxyFactoryBean)
+ {
+ configureJaxWsProxyFactoryBean((JaxWsProxyFactoryBean)beanInstance);
+ }
+ if (delegate != null)
+ {
+ delegate.configureBean(name, beanInstance);
+ }
+ }
+
+ private synchronized void configureJaxWsProxyFactoryBean(JaxWsProxyFactoryBean proxyFactory)
+ {
+ Map<String, Object> properties = new HashMap<String, Object>();
+ for (UnifiedPortComponentRefMetaData pcRef : serviceRefMD.getPortComponentRefs())
+ {
+ String sei = pcRef.getServiceEndpointInterface();
+ if (sei != null && sei.equals(proxyFactory.getServiceClass().getName()))
+ {
+ for (UnifiedStubPropertyMetaData prop : pcRef.getStubProperties())
+ {
+ properties.put(prop.getPropName(), prop.getPropValue());
+ }
+ }
+ }
+ proxyFactory.setProperties(properties);
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyServiceDelegate.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyServiceDelegate.java 2009-07-21 16:46:23 UTC (rev 10369)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyServiceDelegate.java 2009-07-22 09:40:52 UTC (rev 10370)
@@ -1,247 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.wsf.stack.cxf.client;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.concurrent.Executor;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceFeature;
-import javax.xml.ws.Service.Mode;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.spi.ServiceDelegate;
-
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
-
-/**
- * ServiceDelegate that propagates service ref stub properties
- *
- * @author richard.opalka(a)jboss.com
- */
-public final class ServiceRefStubPropertyServiceDelegate extends ServiceDelegate
-{
-
- private ServiceDelegate delegate;
- private UnifiedServiceRefMetaData serviceRefMD;
-
- ServiceRefStubPropertyServiceDelegate(ServiceDelegate delegate, UnifiedServiceRefMetaData serviceRefMD)
- {
- this.delegate = delegate;
- this.serviceRefMD = serviceRefMD;
- }
-
- private <T> T propagateProps(T proxy, Class<T> serviceEndpointInterface)
- {
- for (UnifiedPortComponentRefMetaData pcRef : serviceRefMD.getPortComponentRefs())
- {
- String sei = pcRef.getServiceEndpointInterface();
- if (sei != null && sei.equals(serviceEndpointInterface.getName()) && proxy instanceof BindingProvider)
- {
- BindingProvider bp = (BindingProvider)proxy;
- for (UnifiedStubPropertyMetaData prop : pcRef.getStubProperties())
- {
- bp.getRequestContext().put(prop.getPropName(), prop.getPropValue());
- }
- }
- }
- return proxy;
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#addPort(javax.xml.namespace.QName, java.lang.String, java.lang.String)
- */
- @Override
- public void addPort(QName portName, String bindingId, String endpointAddress)
- {
- this.delegate.addPort(portName, bindingId, endpointAddress);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.ws.EndpointReference, java.lang.Class, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> Dispatch<T> createDispatch(EndpointReference endpointReference, Class<T> type, Mode mode, WebServiceFeature... features)
- {
- return this.delegate.createDispatch(endpointReference, type, mode, features);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.ws.EndpointReference, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Mode mode, WebServiceFeature... features)
- {
- return this.delegate.createDispatch(endpointReference, context, mode, features);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.namespace.QName, java.lang.Class, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode, WebServiceFeature... features)
- {
- return this.delegate.createDispatch(portName, type, mode, features);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.namespace.QName, java.lang.Class, javax.xml.ws.Service.Mode)
- */
- @Override
- public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode)
- {
- return this.delegate.createDispatch(portName, type, mode);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.namespace.QName, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Mode mode, WebServiceFeature... features)
- {
- return this.delegate.createDispatch(portName, context, mode, features);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.namespace.QName, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode)
- */
- @Override
- public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Mode mode)
- {
- return this.delegate.createDispatch(portName, context, mode);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getExecutor()
- */
- @Override
- public Executor getExecutor()
- {
- return this.delegate.getExecutor();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getHandlerResolver()
- */
- @Override
- public HandlerResolver getHandlerResolver()
- {
- return this.delegate.getHandlerResolver();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(java.lang.Class, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return this.propagateProps(this.delegate.getPort(serviceEndpointInterface, features), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(java.lang.Class)
- */
- @Override
- public <T> T getPort(Class<T> serviceEndpointInterface)
- {
- return this.propagateProps(this.delegate.getPort(serviceEndpointInterface), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(javax.xml.ws.EndpointReference, java.lang.Class, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return this.propagateProps(this.delegate.getPort(endpointReference, serviceEndpointInterface, features), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(javax.xml.namespace.QName, java.lang.Class, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> T getPort(QName portName, Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return this.propagateProps(this.delegate.getPort(portName, serviceEndpointInterface, features), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(javax.xml.namespace.QName, java.lang.Class)
- */
- @Override
- public <T> T getPort(QName portName, Class<T> serviceEndpointInterface)
- {
- return this.propagateProps(this.delegate.getPort(portName, serviceEndpointInterface), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPorts()
- */
- @Override
- public Iterator<QName> getPorts()
- {
- return this.delegate.getPorts();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getServiceName()
- */
- @Override
- public QName getServiceName()
- {
- return this.delegate.getServiceName();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getWSDLDocumentLocation()
- */
- @Override
- public URL getWSDLDocumentLocation()
- {
- return this.delegate.getWSDLDocumentLocation();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#setExecutor(java.util.concurrent.Executor)
- */
- @Override
- public void setExecutor(Executor executor)
- {
- this.delegate.setExecutor(executor);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#setHandlerResolver(javax.xml.ws.handler.HandlerResolver)
- */
- @Override
- public void setHandlerResolver(HandlerResolver handlerResolver)
- {
- this.delegate.setHandlerResolver(handlerResolver);
- }
-
-}
14 years, 9 months
JBossWS SVN: r10369 - in stack/native/branches/dlofthouse/JBWS-2706/src/main/java/org/jboss/ws/core: utils and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-07-21 12:46:23 -0400 (Tue, 21 Jul 2009)
New Revision: 10369
Modified:
stack/native/branches/dlofthouse/JBWS-2706/src/main/java/org/jboss/ws/core/EndpointInvocation.java
stack/native/branches/dlofthouse/JBWS-2706/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
Log:
Prototype fix
Modified: stack/native/branches/dlofthouse/JBWS-2706/src/main/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2706/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2009-07-21 16:44:12 UTC (rev 10368)
+++ stack/native/branches/dlofthouse/JBWS-2706/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2009-07-21 16:46:23 UTC (rev 10369)
@@ -23,6 +23,7 @@
// $Id$
+import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
@@ -43,6 +44,7 @@
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.core.utils.MimeUtils.ByteArrayConverter;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.umdm.WrappedParameter;
@@ -247,7 +249,17 @@
{
Class valueType = retValue.getClass();
if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
- throw new SOAPException("javaType [" + javaType.getName() + "] is not assignable from attachment content: " + valueType.getName());
+ {
+ if (retValue instanceof InputStream)
+ {
+ ByteArrayConverter converter = MimeUtils.getConverterForJavaType(javaType);
+ retValue = converter.readFrom((InputStream)retValue);
+ }
+ else
+ {
+ throw new SOAPException("javaType [" + javaType.getName() + "] is not assignable from attachment content: " + valueType.getName());
+ }
+ }
}
}
}
Modified: stack/native/branches/dlofthouse/JBWS-2706/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2706/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-07-21 16:44:12 UTC (rev 10368)
+++ stack/native/branches/dlofthouse/JBWS-2706/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-07-21 16:46:23 UTC (rev 10369)
@@ -27,6 +27,7 @@
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -190,7 +191,9 @@
converter = new StringConverter();
else if (JavaUtils.isAssignableFrom(java.io.InputStream.class, targetClazz))
converter = new StreamConverter();
-
+ else if (JavaUtils.isAssignableFrom(byte[].class, targetClazz))
+ converter = new RealByteArrayConverter();
+
if(null == converter)
throw new WSException("No ByteArrayConverter for class: " + targetClazz.getName());
@@ -330,6 +333,49 @@
}
}
+ public static class RealByteArrayConverter implements ByteArrayConverter
+ {
+ public Object readFrom(InputStream in)
+ {
+ Object converted = null;
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IOUtils.copyStream(baos, in);
+
+ in.close();
+
+ converted = baos.toByteArray();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to convert byte[]");
+ }
+
+ return converted;
+ }
+
+ public void writeTo(Object obj, OutputStream out)
+ {
+ if (obj instanceof byte[])
+ {
+ byte[] bytes = (byte[])obj;
+ try
+ {
+ out.write(bytes);
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to convert " + obj.getClass());
+ }
+ }
+ else
+ {
+ throw new WSException("Unable to convert " + obj.getClass());
+ }
+ }
+ }
+
public static class StreamConverter implements ByteArrayConverter
{
public Object readFrom(InputStream in) {
14 years, 9 months
JBossWS SVN: r10368 - stack/native/branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-07-21 12:44:12 -0400 (Tue, 21 Jul 2009)
New Revision: 10368
Added:
stack/native/branches/dlofthouse/JBWS-2706/
Log:
Branch to hold prototype fix
Copied: stack/native/branches/dlofthouse/JBWS-2706 (from rev 10367, stack/native/branches/jbossws-native-2.0.1.SP2_CP)
14 years, 9 months