JBossWS SVN: r3277 - in trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws: samples/wsaddressing and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-29 06:29:48 -0400 (Tue, 29 May 2007)
New Revision: 3277
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpoint.java
Log:
Merged from Branch_2_0
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java 2007-05-29 10:20:21 UTC (rev 3276)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java 2007-05-29 10:29:48 UTC (rev 3277)
@@ -27,6 +27,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.StringTokenizer;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -51,7 +52,7 @@
public static Test suite()
{
- return JBossWSTestSetup.newTestSetup(HandlerLifecycleTestCase.class, "jaxws-handlerlifecycle.war");
+ return JBossWSTestSetup.newTestSetup(HandlerLifecycleTestCase.class, "jaxws-handlerlifecycle.war, jaxws-handlerlifecycle-client.jar");
}
public void setUp() throws Exception
@@ -85,25 +86,43 @@
* All handlers return true
*/
public void testHandleMessageTrue() throws Exception
- {
- System.out.println("FIXME: [JBWS-1579] @EndpointConfig ignored on SEI");
-
+ {
String testResponse = port.runTest(getName());
String trackerMessages = HandlerTracker.getListMessages();
List<String> expMessages = new ArrayList<String>();
+
+ expMessages.add("PreClientHandler1:PostConstruct");
+ expMessages.add("PreClientHandler2:PostConstruct");
expMessages.add("ClientHandler1:PostConstruct");
expMessages.add("ClientHandler2:PostConstruct");
expMessages.add("ClientHandler3:PostConstruct");
+ expMessages.add("PostClientHandler1:PostConstruct");
+ expMessages.add("PostClientHandler2:PostConstruct");
+
+ expMessages.add("PreClientHandler1:Message:OutBound");
+ expMessages.add("PreClientHandler2:Message:OutBound");
expMessages.add("ClientHandler1:Message:OutBound");
expMessages.add("ClientHandler2:Message:OutBound");
expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("PostClientHandler1:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:OutBound");
+
+ expMessages.add("PostClientHandler2:Message:InBound");
+ expMessages.add("PostClientHandler1:Message:InBound");
expMessages.add("ClientHandler3:Message:InBound");
expMessages.add("ClientHandler2:Message:InBound");
expMessages.add("ClientHandler1:Message:InBound");
+ expMessages.add("PreClientHandler2:Message:InBound");
+ expMessages.add("PreClientHandler1:Message:InBound");
+
+ expMessages.add("PostClientHandler2:Close");
+ expMessages.add("PostClientHandler1:Close");
expMessages.add("ClientHandler3:Close");
expMessages.add("ClientHandler2:Close");
expMessages.add("ClientHandler1:Close");
+ expMessages.add("PreClientHandler2:Close");
+ expMessages.add("PreClientHandler1:Close");
assertEquals(expMessages.toString(), trackerMessages);
trackerMessages = trackerPort.getListMessages();
@@ -159,10 +178,18 @@
String trackerMessages = HandlerTracker.getListMessages();
List<String> expMessages = new ArrayList<String>();
+
+ expMessages.add("PreClientHandler1:Message:OutBound");
+ expMessages.add("PreClientHandler2:Message:OutBound");
expMessages.add("ClientHandler1:Message:OutBound");
expMessages.add("ClientHandler2:Message:OutBound:false");
+ expMessages.add("PostClientHandler2:Close");
+ expMessages.add("PostClientHandler1:Close");
expMessages.add("ClientHandler2:Close");
expMessages.add("ClientHandler1:Close");
+ expMessages.add("PreClientHandler2:Close");
+ expMessages.add("PreClientHandler1:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
trackerMessages = trackerPort.getListMessages();
@@ -172,6 +199,20 @@
assertNull(testResponse);
}
+ private void dumpTracker(String trackerMessages)
+ {
+ StringTokenizer tok = new StringTokenizer(trackerMessages, ",");
+ while(tok.hasMoreTokens())
+ {
+ System.out.print("expMessages.add(\"");
+ String s = tok.nextToken().trim();
+ if(s.startsWith("[")) s = s.substring(1);
+ if(s.endsWith("]")) s = s.substring(0, s.length()-1);
+ System.out.print(s);
+ System.out.print("\");\n");
+ }
+ }
+
/**
* ClientHandler2 throws a RuntimeException on outbound
*/
@@ -190,11 +231,25 @@
String trackerMessages = HandlerTracker.getListMessages();
List<String> expMessages = new ArrayList<String>();
+
+ expMessages.add("PreClientHandler1:Message:OutBound");
+ expMessages.add("PreClientHandler2:Message:OutBound");
expMessages.add("ClientHandler1:Message:OutBound");
expMessages.add("ClientHandler2:Message:OutBound:ErrorInClientHandler2");
+
+ expMessages.add("PostClientHandler2:Fault:InBound");
+ expMessages.add("PostClientHandler1:Fault:InBound");
expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("PreClientHandler2:Fault:InBound");
+ expMessages.add("PreClientHandler1:Fault:InBound");
+
+ expMessages.add("PostClientHandler2:Close");
+ expMessages.add("PostClientHandler1:Close");
expMessages.add("ClientHandler2:Close");
expMessages.add("ClientHandler1:Close");
+ expMessages.add("PreClientHandler2:Close");
+ expMessages.add("PreClientHandler1:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
trackerMessages = trackerPort.getListMessages();
@@ -224,19 +279,34 @@
expMessages.add("ServerHandler3:Close");
expMessages.add("PostServerHandler1:Close");
expMessages.add("PostServerHandler2:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
trackerMessages = HandlerTracker.getListMessages();
expMessages = new ArrayList<String>();
+
+ expMessages.add("PreClientHandler1:Message:OutBound");
+ expMessages.add("PreClientHandler2:Message:OutBound");
expMessages.add("ClientHandler1:Message:OutBound");
expMessages.add("ClientHandler2:Message:OutBound");
expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("PostClientHandler1:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:InBound");
+ expMessages.add("PostClientHandler1:Message:InBound");
expMessages.add("ClientHandler3:Message:InBound");
expMessages.add("ClientHandler2:Message:InBound");
expMessages.add("ClientHandler1:Message:InBound");
+ expMessages.add("PreClientHandler2:Message:InBound");
+ expMessages.add("PreClientHandler1:Message:InBound");
+ expMessages.add("PostClientHandler2:Close");
+ expMessages.add("PostClientHandler1:Close");
expMessages.add("ClientHandler3:Close");
expMessages.add("ClientHandler2:Close");
expMessages.add("ClientHandler1:Close");
+ expMessages.add("PreClientHandler2:Close");
+ expMessages.add("PreClientHandler1:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
assertEquals("testServerHandler2Response", testResponse);
@@ -271,19 +341,34 @@
expMessages.add("ServerHandler3:Close");
expMessages.add("PostServerHandler1:Close");
expMessages.add("PostServerHandler2:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
trackerMessages = HandlerTracker.getListMessages();
expMessages = new ArrayList<String>();
+
+ expMessages.add("PreClientHandler1:Message:OutBound");
+ expMessages.add("PreClientHandler2:Message:OutBound");
expMessages.add("ClientHandler1:Message:OutBound");
expMessages.add("ClientHandler2:Message:OutBound");
expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("PostClientHandler1:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:InBound");
+ expMessages.add("PostClientHandler1:Message:InBound");
expMessages.add("ClientHandler3:Fault:InBound");
expMessages.add("ClientHandler2:Fault:InBound");
expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("PreClientHandler2:Fault:InBound");
+ expMessages.add("PreClientHandler1:Fault:InBound");
+ expMessages.add("PostClientHandler2:Close");
+ expMessages.add("PostClientHandler1:Close");
expMessages.add("ClientHandler3:Close");
expMessages.add("ClientHandler2:Close");
expMessages.add("ClientHandler1:Close");
+ expMessages.add("PreClientHandler2:Close");
+ expMessages.add("PreClientHandler1:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
assertEquals("ErrorInServerHandler2", testResponse);
@@ -320,15 +405,29 @@
trackerMessages = HandlerTracker.getListMessages();
expMessages = new ArrayList<String>();
+
+ expMessages.add("PreClientHandler1:Message:OutBound");
+ expMessages.add("PreClientHandler2:Message:OutBound");
expMessages.add("ClientHandler1:Message:OutBound");
expMessages.add("ClientHandler2:Message:OutBound");
expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("PostClientHandler1:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:InBound");
+ expMessages.add("PostClientHandler1:Message:InBound");
expMessages.add("ClientHandler3:Message:InBound");
expMessages.add("ClientHandler2:Message:InBound");
expMessages.add("ClientHandler1:Message:InBound");
+ expMessages.add("PreClientHandler2:Message:InBound");
+ expMessages.add("PreClientHandler1:Message:InBound");
+ expMessages.add("PostClientHandler2:Close");
+ expMessages.add("PostClientHandler1:Close");
expMessages.add("ClientHandler3:Close");
expMessages.add("ClientHandler2:Close");
expMessages.add("ClientHandler1:Close");
+ expMessages.add("PreClientHandler2:Close");
+ expMessages.add("PreClientHandler1:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
assertEquals(getName() + "Response", testResponse);
@@ -377,15 +476,29 @@
trackerMessages = HandlerTracker.getListMessages();
expMessages = new ArrayList<String>();
+
+ expMessages.add("PreClientHandler1:Message:OutBound");
+ expMessages.add("PreClientHandler2:Message:OutBound");
expMessages.add("ClientHandler1:Message:OutBound");
expMessages.add("ClientHandler2:Message:OutBound");
expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("PostClientHandler1:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:InBound");
+ expMessages.add("PostClientHandler1:Message:InBound");
expMessages.add("ClientHandler3:Fault:InBound");
expMessages.add("ClientHandler2:Fault:InBound");
expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("PreClientHandler2:Fault:InBound");
+ expMessages.add("PreClientHandler1:Fault:InBound");
+ expMessages.add("PostClientHandler2:Close");
+ expMessages.add("PostClientHandler1:Close");
expMessages.add("ClientHandler3:Close");
expMessages.add("ClientHandler2:Close");
expMessages.add("ClientHandler1:Close");
+ expMessages.add("PreClientHandler2:Close");
+ expMessages.add("PreClientHandler1:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
assertEquals("ErrorInServerHandler2", testResponse);
@@ -400,14 +513,26 @@
String trackerMessages = HandlerTracker.getListMessages();
List<String> expMessages = new ArrayList<String>();
+
+ expMessages.add("PreClientHandler1:Message:OutBound");
+ expMessages.add("PreClientHandler2:Message:OutBound");
expMessages.add("ClientHandler1:Message:OutBound");
expMessages.add("ClientHandler2:Message:OutBound");
expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("PostClientHandler1:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:InBound");
+ expMessages.add("PostClientHandler1:Message:InBound");
expMessages.add("ClientHandler3:Message:InBound");
expMessages.add("ClientHandler2:Message:InBound:false");
+ expMessages.add("PostClientHandler2:Close");
+ expMessages.add("PostClientHandler1:Close");
expMessages.add("ClientHandler3:Close");
expMessages.add("ClientHandler2:Close");
expMessages.add("ClientHandler1:Close");
+ expMessages.add("PreClientHandler2:Close");
+ expMessages.add("PreClientHandler1:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
trackerMessages = trackerPort.getListMessages();
@@ -456,15 +581,29 @@
String trackerMessages = HandlerTracker.getListMessages();
List<String> expMessages = new ArrayList<String>();
+
+ expMessages.add("PreClientHandler1:Message:OutBound");
+ expMessages.add("PreClientHandler2:Message:OutBound");
expMessages.add("ClientHandler1:Message:OutBound");
expMessages.add("ClientHandler2:Message:OutBound");
expMessages.add("ClientHandler3:Message:OutBound");
+ expMessages.add("PostClientHandler1:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:OutBound");
+ expMessages.add("PostClientHandler2:Message:InBound");
+ expMessages.add("PostClientHandler1:Message:InBound");
expMessages.add("ClientHandler3:Message:InBound");
expMessages.add("ClientHandler2:Message:InBound:ErrorInClientHandler2");
expMessages.add("ClientHandler1:Fault:InBound");
+ expMessages.add("PreClientHandler2:Fault:InBound");
+ expMessages.add("PreClientHandler1:Fault:InBound");
+ expMessages.add("PostClientHandler2:Close");
+ expMessages.add("PostClientHandler1:Close");
expMessages.add("ClientHandler3:Close");
expMessages.add("ClientHandler2:Close");
expMessages.add("ClientHandler1:Close");
+ expMessages.add("PreClientHandler2:Close");
+ expMessages.add("PreClientHandler1:Close");
+
assertEquals(expMessages.toString(), trackerMessages);
trackerMessages = trackerPort.getListMessages();
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-05-29 10:20:21 UTC (rev 3276)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-05-29 10:29:48 UTC (rev 3277)
@@ -22,12 +22,14 @@
package org.jboss.test.ws.jaxws.handlerlifecycle;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
@@ -186,8 +188,32 @@
String testMethod;
try
{
- SOAPElement soapElement = (SOAPElement)((SOAPMessageContext)msgContext).getMessage().getSOAPBody().getChildElements().next();
- soapElement = (SOAPElement)soapElement.getChildElements().next();
+
+ SOAPMessage message = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPElement soapElement = null;
+ Iterator it = message.getSOAPBody().getChildElements();
+
+ while (soapElement == null && it.hasNext())
+ {
+ Object current = it.next();
+ if (current instanceof SOAPElement)
+ {
+ soapElement = (SOAPElement)current;
+ }
+ }
+
+ it = soapElement.getChildElements();
+ soapElement = null;
+
+ while (soapElement == null && it.hasNext())
+ {
+ Object current = it.next();
+ if (current instanceof SOAPElement)
+ {
+ soapElement = (SOAPElement)current;
+ }
+ }
+
testMethod = soapElement.getValue();
}
catch (SOAPException e)
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2007-05-29 10:20:21 UTC (rev 3276)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2007-05-29 10:29:48 UTC (rev 3277)
@@ -61,7 +61,7 @@
String clientid = null;
EndpointReference replyTo = addrProps.getReplyTo();
- ReferenceParameters refParams = replyTo.getReferenceParameters();
+ ReferenceParameters refParams = replyTo!=null ? replyTo.getReferenceParameters() : null;
if (refParams != null)
{
for (Object obj : refParams.getElements())
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpoint.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpoint.java 2007-05-29 10:20:21 UTC (rev 3276)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpoint.java 2007-05-29 10:29:48 UTC (rev 3277)
@@ -41,7 +41,6 @@
*/
@WebService(name = "StatefulEndpoint", targetNamespace = "http://org.jboss.ws/samples/wsaddressing", serviceName = "TestService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@EndpointConfig(configName = "Standard WSAddressing Endpoint")
public interface StatefulEndpoint extends Remote
{
@WebMethod
17 years, 8 months
JBossWS SVN: r3276 - in trunk: integration/sunri/src/main/java/org/jboss/wsf/stack/sunri and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-29 06:20:21 -0400 (Tue, 29 May 2007)
New Revision: 3276
Added:
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java
Modified:
trunk/integration/sunri/ant-import/build-thirdparty.xml
trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl
trunk/jbossws-core/ant-import/build-thirdparty.xml
Log:
Added SunRIConsumer impl
Modified: trunk/integration/sunri/ant-import/build-thirdparty.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-thirdparty.xml 2007-05-29 09:44:14 UTC (rev 3275)
+++ trunk/integration/sunri/ant-import/build-thirdparty.xml 2007-05-29 10:20:21 UTC (rev 3276)
@@ -58,6 +58,8 @@
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/saaj-api.jar" dest="${thirdparty.dir}/saaj-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/saaj-impl.jar" dest="${thirdparty.dir}/saaj-impl.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/sjsxp.jar" dest="${thirdparty.dir}/sjsxp.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-rt.jar" dest="${thirdparty.dir}/jaxws-rt.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-tools.jar" dest="${thirdparty.dir}/jaxws-tools.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/stax-ex.jar" dest="${thirdparty.dir}/stax-ex.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/streambuffer.jar" dest="${thirdparty.dir}/streambuffer.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-ri-src.jar" dest="${thirdparty.dir}/jaxws-ri-src.jar" usetimestamp="true" verbose="true"/>
@@ -78,7 +80,9 @@
<pathelement location="${spi.dir}/thirdparty/jboss-javaee.jar"/>
<pathelement location="${thirdparty.dir}/http.jar"/>
<pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
- <pathelement location="${thirdparty.dir}/jaxws-api.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxb-xjc.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxws-api.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxws-tools.jar"/>
<pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
<pathelement location="${thirdparty.dir}/jsr181-api.jar"/>
<pathelement location="${thirdparty.dir}/servlet-api.jar"/>
Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java 2007-05-29 10:20:21 UTC (rev 3276)
@@ -0,0 +1,209 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.sunri.tools;
+
+import java.io.PrintStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Locale;
+
+class NullPrintStream extends PrintStream
+{
+ NullPrintStream()
+ {
+ // Doesn't actually do anything
+ super(new ByteArrayOutputStream());
+ }
+
+ @Override
+ public PrintStream append(char c)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq, int start, int end)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq)
+ {
+ return this;
+ }
+
+ @Override
+ public boolean checkError()
+ {
+ return false;
+ }
+
+ @Override
+ public void close()
+ {
+ }
+
+ @Override
+ public void flush()
+ {
+ }
+
+ @Override
+ public PrintStream format(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream format(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void print(boolean b)
+ {
+ }
+
+ @Override
+ public void print(char c)
+ {
+ }
+
+ @Override
+ public void print(char[] s)
+ {
+ }
+
+ @Override
+ public void print(double d)
+ {
+ }
+
+ @Override
+ public void print(float f)
+ {
+ }
+
+ @Override
+ public void print(int i)
+ {
+ }
+
+ @Override
+ public void print(long l)
+ {
+ }
+
+ @Override
+ public void print(Object obj)
+ {
+ }
+
+ @Override
+ public void print(String s)
+ {
+ }
+
+ @Override
+ public PrintStream printf(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream printf(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void println()
+ {
+ }
+
+ @Override
+ public void println(boolean x)
+ {
+ }
+
+ @Override
+ public void println(char x)
+ {
+ }
+
+ @Override
+ public void println(char[] x)
+ {
+ }
+
+ @Override
+ public void println(double x)
+ {
+ }
+
+ @Override
+ public void println(float x)
+ {
+ }
+
+ @Override
+ public void println(int x)
+ {
+ }
+
+ @Override
+ public void println(long x)
+ {
+ }
+
+ @Override
+ public void println(Object x)
+ {
+ }
+
+ @Override
+ public void println(String x)
+ {
+ }
+
+ @Override
+ protected void setError()
+ {
+ }
+
+ @Override
+ public void write(byte[] buf, int off, int len)
+ {
+ }
+
+ @Override
+ public void write(int b)
+ {
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException
+ {
+ }
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java 2007-05-29 10:20:21 UTC (rev 3276)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.sunri.tools;
+
+import org.jboss.wsf.spi.tools.spi.WSContractConsumerFactory;
+import org.jboss.wsf.spi.tools.api.WSContractConsumer;
+
+/**
+ * Creates a WSContractConsumer that delegates to the Sun RI.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision:2311 $
+ */
+public class SunRIConsumerFactoryImpl implements WSContractConsumerFactory
+{
+ public WSContractConsumer createConsumer() {
+ return new SunRIConsumerImpl();
+ }
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java 2007-05-29 10:20:21 UTC (rev 3276)
@@ -0,0 +1,169 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.sunri.tools;
+
+import org.jboss.wsf.spi.tools.api.WSContractConsumer;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.util.List;
+import java.util.ArrayList;
+import java.net.URL;
+
+import com.sun.tools.ws.wscompile.WsimportTool;
+
+/**
+ * WSContractConsumer that delegates to the Sun CompileTool.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @author <a href="heiko.braun(a)jboss.com">Heiko Braun</a>
+ * @version $Revision$
+ */
+public class SunRIConsumerImpl extends WSContractConsumer
+{
+ private List<File> bindingFiles = null;
+ private File catalog = null;
+ private boolean generateSource = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+ private String targetPackage = null;
+ private PrintStream messageStream = null;
+ private String wsdlLocation = null;
+ private List<String> additionalCompilerClassPath = null;
+
+ @Override
+ public void setBindingFiles(List<File> bindingFiles) {
+ this.bindingFiles = bindingFiles;
+ }
+
+ @Override
+ public void setCatalog(File catalog) {
+ this.catalog = catalog;
+ }
+
+ @Override
+ public void setGenerateSource(boolean generateSource) {
+ this.generateSource = generateSource;
+ }
+
+ @Override
+ public void setMessageStream(PrintStream messageStream) {
+ // TODO Auto-generated method stub
+ this.messageStream = messageStream;
+ }
+
+ @Override
+ public void setOutputDirectory(File directory) {
+ // TODO Auto-generated method stub
+ outputDir = directory;
+ }
+
+ @Override
+ public void setSourceDirectory(File directory) {
+ sourceDir = directory;
+ }
+
+ @Override
+ public void setTargetPackage(String targetPackage) {
+ this.targetPackage = targetPackage;
+ }
+
+ @Override
+ public void setWsdlLocation(String wsdlLocation) {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void setAdditionalCompilerClassPath(List<String> additionalCompilerClassPath) {
+ this.additionalCompilerClassPath = additionalCompilerClassPath;
+ }
+
+ @Override
+ public void consume(URL wsdl) {
+ List<String> args = new ArrayList<String>();
+ if (bindingFiles != null) {
+ for (File file : bindingFiles) {
+ args.add("-b");
+ args.add(file.getAbsolutePath());
+
+ }
+ }
+
+ if (catalog != null) {
+ args.add("-catalog");
+ args.add(catalog.getAbsolutePath());
+ }
+
+ if (generateSource) {
+ args.add("-keep");
+ if (sourceDir != null) {
+ if (!sourceDir.exists() && !sourceDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + sourceDir.getName());
+
+ args.add("-s");
+ args.add(sourceDir.getAbsolutePath());
+ }
+ }
+
+ if (targetPackage != null) {
+ args.add("-p");
+ args.add(targetPackage);
+ }
+
+ if (wsdlLocation != null) {
+ args.add("-wsdllocation");
+ args.add(wsdlLocation);
+ }
+
+ PrintStream stream = messageStream;
+ if (stream != null) {
+ args.add("-verbose");
+ } else {
+ stream = new NullPrintStream();
+ }
+
+ if (!outputDir.exists() && !outputDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + outputDir.getName());
+
+ // Always add the output directory and the wsdl location
+ args.add("-d");
+ args.add(outputDir.getAbsolutePath());
+ args.add(wsdl.toString());
+
+ try
+ {
+ // enforce woodstox
+ if(null == System.getProperty("javax.xml.stream.XMLInputFactory"))
+ System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
+
+ WsimportTool compileTool = new WsimportTool(stream);
+ boolean success = compileTool.run(args.toArray(new String[0]));
+
+ if(!success) throw new IllegalStateException("WsImport invocation failed");
+ }
+ catch (Throwable t)
+ {
+ messageStream.println("Failed to invoke WsImport");
+ t.printStackTrace(messageStream);
+ }
+
+ }
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl
===================================================================
--- trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl 2007-05-29 09:44:14 UTC (rev 3275)
+++ trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl 2007-05-29 10:20:21 UTC (rev 3276)
@@ -1 +1 @@
-TODO:SUNRIConsumerFactoryImpl
\ No newline at end of file
+org.jboss.wsf.stack.sunri.tools.SunRIConsumerFactoryImpl
\ No newline at end of file
Modified: trunk/jbossws-core/ant-import/build-thirdparty.xml
===================================================================
--- trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-29 09:44:14 UTC (rev 3275)
+++ trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-29 10:20:21 UTC (rev 3276)
@@ -110,37 +110,37 @@
<target name="thirdparty-classpath" depends="thirdparty-get">
<!-- The compile classpath for jbossws core -->
- <path id="thirdparty.classpath">
- <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
- <pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
- <pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-ejb3x.jar"/>
- <pathelement location="${thirdparty.dir}/activation.jar"/>
- <pathelement location="${thirdparty.dir}/dom4j.jar"/>
- <pathelement location="${thirdparty.dir}/getopt.jar"/>
- <pathelement location="${thirdparty.dir}/javassist.jar"/>
- <pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
- <pathelement location="${thirdparty.dir}/jaxb-impl.jar"/>
- <pathelement location="${thirdparty.dir}/jaxb-xjc.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-common-core.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-microcontainer.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-xml-binding.jar"/>
- <pathelement location="${thirdparty.dir}/jbosssx.jar"/>
- <pathelement location="${thirdparty.dir}/mail.jar"/>
- <pathelement location="${thirdparty.dir}/servlet-api.jar"/>
- <pathelement location="${thirdparty.dir}/stax-api.jar"/>
- <pathelement location="${thirdparty.dir}/wsdl4j.jar"/>
- <pathelement location="${thirdparty.dir}/wstx.jar"/>
- <pathelement location="${thirdparty.dir}/xmlsec.jar"/>
- <pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
- <pathelement location="${thirdparty.dir}/xalan.jar"/>
- <pathelement location="${thirdparty.dir}/policy.jar"/>
- <pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
- <pathelement location="${thirdparty.dir}/jaxws-tools.jar"/>
- </path>
+ <path id="thirdparty.classpath">
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
+ <pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
+ <pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-ejb3x.jar"/>
+ <pathelement location="${thirdparty.dir}/activation.jar"/>
+ <pathelement location="${thirdparty.dir}/dom4j.jar"/>
+ <pathelement location="${thirdparty.dir}/getopt.jar"/>
+ <pathelement location="${thirdparty.dir}/javassist.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxb-impl.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxb-xjc.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxws-tools.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-common-core.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-microcontainer.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-xml-binding.jar"/>
+ <pathelement location="${thirdparty.dir}/jbosssx.jar"/>
+ <pathelement location="${thirdparty.dir}/mail.jar"/>
+ <pathelement location="${thirdparty.dir}/servlet-api.jar"/>
+ <pathelement location="${thirdparty.dir}/stax-api.jar"/>
+ <pathelement location="${thirdparty.dir}/wsdl4j.jar"/>
+ <pathelement location="${thirdparty.dir}/wstx.jar"/>
+ <pathelement location="${thirdparty.dir}/xmlsec.jar"/>
+ <pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
+ <pathelement location="${thirdparty.dir}/xalan.jar"/>
+ <pathelement location="${thirdparty.dir}/policy.jar"/>
+ </path>
</target>
17 years, 8 months
JBossWS SVN: r3275 - in trunk: jbossws-core and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-29 05:44:14 -0400 (Tue, 29 May 2007)
New Revision: 3275
Modified:
trunk/integration/sunri/build.xml
trunk/jbossws-core/build.xml
Log:
Include factory config in META-INF/services
Modified: trunk/integration/sunri/build.xml
===================================================================
--- trunk/integration/sunri/build.xml 2007-05-29 09:33:51 UTC (rev 3274)
+++ trunk/integration/sunri/build.xml 2007-05-29 09:44:14 UTC (rev 3275)
@@ -117,6 +117,7 @@
<include name="org/jboss/wsf/stack/sunri50/**"/>
<include name="org/jboss/wsf/stack/sunri/**"/>
</fileset>
+ <metainf dir="${sunri.resources.dir}/jbossws-sunri.jar"/>
</jar>
<!-- Build jbossws-context.war -->
Modified: trunk/jbossws-core/build.xml
===================================================================
--- trunk/jbossws-core/build.xml 2007-05-29 09:33:51 UTC (rev 3274)
+++ trunk/jbossws-core/build.xml 2007-05-29 09:44:14 UTC (rev 3275)
@@ -158,6 +158,7 @@
<include name="schema/**"/>
<include name="dtd/**"/>
</fileset>
+ <metainf dir="${core.resources.dir}/jbossws-core.jar"/>
</jar>
<!-- Build jbossws-client.jar -->
17 years, 8 months
JBossWS SVN: r3274 - trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-29 05:33:51 -0400 (Tue, 29 May 2007)
New Revision: 3274
Added:
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/BytecodeWrapperGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/NullPrintStream.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WritableWrapperGenerator.java
Log:
Tools first cut
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/BytecodeWrapperGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/BytecodeWrapperGenerator.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/BytecodeWrapperGenerator.java 2007-05-29 09:33:51 UTC (rev 3274)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.jaxws.impl;
+
+import javassist.CannotCompileException;
+import javassist.NotFoundException;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+public class BytecodeWrapperGenerator extends DynamicWrapperGenerator implements WritableWrapperGenerator
+{
+ private List<String> typeNames = new ArrayList<String>();
+ PrintStream stream;
+
+ public BytecodeWrapperGenerator(ClassLoader loader, PrintStream stream)
+ {
+ super(loader);
+ this.stream = stream;
+ prune = false;
+ }
+
+ @Override
+ public void reset(ClassLoader loader)
+ {
+ super.reset(loader);
+ typeNames.clear();
+ }
+
+ @Override
+ public void generate(FaultMetaData fmd)
+ {
+ super.generate(fmd);
+
+ typeNames.add(fmd.getFaultBeanName());
+ }
+
+ @Override
+ public void generate(ParameterMetaData pmd)
+ {
+ super.generate(pmd);
+
+ typeNames.add(pmd.getJavaTypeName());
+ }
+
+ public void write(File directory) throws IOException
+ {
+ stream.println("Writing Classes:");
+ for (String name : typeNames)
+ {
+ try
+ {
+ stream.println(name.replace('.', '/') + ".class");
+ pool.get(name).writeFile(directory.getAbsolutePath());
+ }
+ catch (CannotCompileException e)
+ {
+ throw new WSException(e);
+ }
+ catch (NotFoundException e)
+ {
+ throw new WSException(e);
+ }
+ }
+ }
+}
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/BytecodeWrapperGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/ChainedWritableWrapperGenerator.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/ChainedWritableWrapperGenerator.java 2007-05-29 09:33:51 UTC (rev 3274)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.jaxws.impl;
+
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ChainedWritableWrapperGenerator implements WrapperGenerator
+{
+ private List<Entry> chain = new ArrayList<Entry>();
+
+ static class Entry
+ {
+ Entry(WritableWrapperGenerator generator, File directory)
+ {
+ this.generator = generator;
+ this.directory = directory;
+ }
+
+ WritableWrapperGenerator generator;
+ File directory;
+ }
+
+ public ChainedWritableWrapperGenerator()
+ {
+ }
+
+ public void reset(ClassLoader loader)
+ {
+ for (Entry entry : chain)
+ entry.generator.reset(loader);
+ }
+
+ public void write() throws IOException
+ {
+ for (Entry entry : chain)
+ entry.generator.write(entry.directory);
+ }
+
+ public void generate(FaultMetaData fmd)
+ {
+ for (Entry entry : chain)
+ entry.generator.generate(fmd);
+ }
+
+ public void generate(ParameterMetaData pmd)
+ {
+ for (Entry entry : chain)
+ entry.generator.generate(pmd);
+ }
+
+ public void add(WritableWrapperGenerator generator, File directory)
+ {
+ chain.add(new Entry(generator, directory));
+ }
+}
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/NullPrintStream.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/NullPrintStream.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/NullPrintStream.java 2007-05-29 09:33:51 UTC (rev 3274)
@@ -0,0 +1,209 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.jaxws.impl;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.Locale;
+
+class NullPrintStream extends PrintStream
+{
+ NullPrintStream()
+ {
+ // Doesn't actually do anything
+ super(new ByteArrayOutputStream());
+ }
+
+ @Override
+ public PrintStream append(char c)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq, int start, int end)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq)
+ {
+ return this;
+ }
+
+ @Override
+ public boolean checkError()
+ {
+ return false;
+ }
+
+ @Override
+ public void close()
+ {
+ }
+
+ @Override
+ public void flush()
+ {
+ }
+
+ @Override
+ public PrintStream format(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream format(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void print(boolean b)
+ {
+ }
+
+ @Override
+ public void print(char c)
+ {
+ }
+
+ @Override
+ public void print(char[] s)
+ {
+ }
+
+ @Override
+ public void print(double d)
+ {
+ }
+
+ @Override
+ public void print(float f)
+ {
+ }
+
+ @Override
+ public void print(int i)
+ {
+ }
+
+ @Override
+ public void print(long l)
+ {
+ }
+
+ @Override
+ public void print(Object obj)
+ {
+ }
+
+ @Override
+ public void print(String s)
+ {
+ }
+
+ @Override
+ public PrintStream printf(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream printf(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void println()
+ {
+ }
+
+ @Override
+ public void println(boolean x)
+ {
+ }
+
+ @Override
+ public void println(char x)
+ {
+ }
+
+ @Override
+ public void println(char[] x)
+ {
+ }
+
+ @Override
+ public void println(double x)
+ {
+ }
+
+ @Override
+ public void println(float x)
+ {
+ }
+
+ @Override
+ public void println(int x)
+ {
+ }
+
+ @Override
+ public void println(long x)
+ {
+ }
+
+ @Override
+ public void println(Object x)
+ {
+ }
+
+ @Override
+ public void println(String x)
+ {
+ }
+
+ @Override
+ protected void setError()
+ {
+ }
+
+ @Override
+ public void write(byte[] buf, int off, int len)
+ {
+ }
+
+ @Override
+ public void write(int b)
+ {
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException
+ {
+ }
+}
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/NullPrintStream.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java 2007-05-29 09:33:51 UTC (rev 3274)
@@ -0,0 +1,171 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.jaxws.impl;
+
+import com.sun.codemodel.*;
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.AbstractWrapperGenerator;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+import org.jboss.wsf.spi.utils.JavaUtils;
+
+import javax.xml.bind.annotation.*;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.List;
+import java.util.SortedMap;
+
+/**
+ * Generates source for wrapper beans
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class SourceWrapperGenerator extends AbstractWrapperGenerator implements WritableWrapperGenerator
+{
+ private static Logger log = Logger.getLogger(SourceWrapperGenerator.class);
+ private PrintStream stream;
+ private JCodeModel codeModel;
+
+
+ public SourceWrapperGenerator(ClassLoader loader, PrintStream stream)
+ {
+ super(loader);
+ this.stream = stream;
+ codeModel = new JCodeModel();
+ }
+
+ @Override
+ public void reset(ClassLoader loader)
+ {
+ super.reset(loader);
+ codeModel = new JCodeModel();
+ }
+
+ public void write(File directory) throws IOException
+ {
+ stream.println("Writing Source:");
+ codeModel.build(directory, stream);
+ }
+
+ public void generate(ParameterMetaData pmd)
+ {
+ List<WrappedParameter> wrappedParameters = pmd.getWrappedParameters();
+ OperationMetaData operationMetaData = pmd.getOperationMetaData();
+
+ if (operationMetaData.isDocumentWrapped() == false)
+ throw new WSException("Operation is not document/literal (wrapped)");
+
+ if (wrappedParameters == null)
+ throw new WSException("Cannot generate a type when their is no type information");
+
+ String wrapperName = pmd.getJavaTypeName();
+ if (log.isDebugEnabled())
+ if(log.isDebugEnabled()) log.debug("Generating wrapper: " + wrapperName);
+
+ try
+ {
+
+ JDefinedClass clazz = codeModel._class(wrapperName);
+ addClassAnnotations(clazz, pmd.getXmlName(), pmd.getXmlType(), null);
+ for (WrappedParameter wrapped : wrappedParameters)
+ {
+ addProperty(clazz, wrapped.getType(), wrapped.getName(), wrapped.getVariable());
+ }
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Could not generate wrapper type: " + wrapperName, e);
+ }
+ }
+ public void generate(FaultMetaData fmd)
+ {
+ String faultBeanName = fmd.getFaultBeanName();
+ Class exception = fmd.getJavaType();
+
+ try
+ {
+ SortedMap<String, Class<?>> properties = getExceptionProperties(exception);
+ String[] propertyOrder = properties.keySet().toArray(new String[0]);
+
+ JDefinedClass clazz = codeModel._class(faultBeanName);
+ addClassAnnotations(clazz, fmd.getXmlName(), fmd.getXmlType(), propertyOrder);
+
+ for (String property : propertyOrder)
+ addProperty(clazz, properties.get(property).getName(), new QName(property), property);
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Could not generate wrapper type: " + faultBeanName, e);
+ }
+ }
+
+ private static String getterPrefix(Class type)
+ {
+ return Boolean.TYPE == type || Boolean.class == type ? "is" : "get";
+ }
+
+ private void addProperty(JDefinedClass clazz, String typeName, QName name, String variable)
+ throws ClassNotFoundException
+ {
+ Class type = JavaUtils.loadJavaType(typeName, loader);
+ JFieldVar field = clazz.field(JMod.PRIVATE, type, variable);
+ JAnnotationUse annotation = field.annotate(XmlElement.class);
+ if (name.getNamespaceURI() != null)
+ annotation.param("namespace", name.getNamespaceURI());
+ annotation.param("name", name.getLocalPart());
+
+ // Add acessor methods
+ JMethod method = clazz.method(JMod.PUBLIC, type, getterPrefix(type) + JavaUtils.capitalize(variable));
+ method.body()._return(JExpr._this().ref(variable));
+
+ method = clazz.method(JMod.PUBLIC, type, "set" + JavaUtils.capitalize(variable));
+ method.body().assign(JExpr._this().ref(variable), method.param(type, variable));
+ }
+
+ private static void addClassAnnotations(JDefinedClass clazz, QName xmlName, QName xmlType, String[] propertyOrder)
+ {
+ JAnnotationUse annotation = clazz.annotate(XmlRootElement.class);
+ if (xmlName.getNamespaceURI() != null && xmlName.getNamespaceURI().length() > 0)
+ annotation.param("namespace", xmlName.getNamespaceURI());
+ annotation.param("name", xmlName.getLocalPart());
+
+ annotation = clazz.annotate(XmlType.class);
+ if (xmlType.getNamespaceURI() != null & xmlType.getNamespaceURI().length() > 0)
+ annotation.param("namespace", xmlType.getNamespaceURI());
+ annotation.param("name", xmlType.getLocalPart());
+ if (propertyOrder != null)
+ {
+ JAnnotationArrayMember paramArray = annotation.paramArray("propOrder");
+ for (String property : propertyOrder)
+ paramArray.param(property);
+ }
+
+ annotation = clazz.annotate(XmlAccessorType.class);
+ annotation.param("value", XmlAccessType.FIELD);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WritableWrapperGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WritableWrapperGenerator.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WritableWrapperGenerator.java 2007-05-29 09:33:51 UTC (rev 3274)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.jaxws.impl;
+
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+
+import java.io.File;
+import java.io.IOException;
+
+public interface WritableWrapperGenerator extends WrapperGenerator
+{
+ public void write(File directory) throws IOException;
+}
\ No newline at end of file
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WritableWrapperGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 8 months
JBossWS SVN: r3273 - trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-29 05:33:17 -0400 (Tue, 29 May 2007)
New Revision: 3273
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpointImpl.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
Log:
Fix import location
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpointImpl.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpointImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpointImpl.java 2007-05-29 09:33:17 UTC (rev 3273)
@@ -1,6 +1,6 @@
package org.jboss.test.ws.jaxws.samples.swaref;
-import org.jboss.ws.annotation.WebContext;
+import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.ws.WSException;
import javax.jws.WebService;
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java 2007-05-29 09:33:17 UTC (rev 3273)
@@ -1,6 +1,6 @@
package org.jboss.test.ws.jaxws.samples.swaref;
-import org.jboss.ws.annotation.WebContext;
+import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.ws.WSException;
import javax.ejb.Stateless;
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2007-05-29 09:33:17 UTC (rev 3273)
@@ -1,6 +1,6 @@
package org.jboss.test.ws.jaxws.samples.swaref;
-import org.jboss.ws.annotation.WebContext;
+import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.ws.WSException;
import javax.activation.DataHandler;
17 years, 8 months
JBossWS SVN: r3272 - in trunk: build/etc and 39 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-29 05:21:32 -0400 (Tue, 29 May 2007)
New Revision: 3272
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractConsumer.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractProvider.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsconsume.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsprovide.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractConsumerFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractProviderFactory.java
trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/
trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/
trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/
trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl
trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ProviderFactoryImpl
trunk/jbossws-core/src/main/java/org/jboss/ws/integration/
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderFactoryImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerFactoryImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java
trunk/jbossws-core/src/main/resources/jbossws-core.jar/
trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/
trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/services/
trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl
trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.tools.ProviderFactoryImpl
trunk/jbossws-core/src/main/resources/schema/swaref.xsd
trunk/testsuite/src/java/org/jboss/test/ws/XOPTestSupport.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpoint.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpointImpl.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithoutRef.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java
Removed:
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/api/
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/command/
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/BytecodeWrapperGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/NullPrintStream.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderFactoryImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WritableWrapperGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/spi/
Modified:
trunk/build/ant-import/build-testsuite.xml
trunk/build/etc/wsconsume.bat
trunk/build/etc/wsconsume.sh
trunk/build/etc/wsprovide.bat
trunk/build/etc/wsprovide.sh
trunk/build/etc/wspublish.sh
trunk/integration/native/ant-import/build-deploy.xml
trunk/integration/native/ant-import/macros-deploy-native.xml
trunk/integration/spi/ant-import/build-thirdparty.xml
trunk/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java
trunk/jbossws-core/ant-import-tests/build-testsuite.xml
trunk/jbossws-core/ant-import/build-thirdparty.xml
trunk/jbossws-core/build.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentScanResult.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java
trunk/jbossws-core/src/main/resources/standard-config/standard-jaxws-client-config.xml
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java
Log:
Merged from Branch_2_0. Tools integration first cut
Modified: trunk/build/ant-import/build-testsuite.xml
===================================================================
--- trunk/build/ant-import/build-testsuite.xml 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/build/ant-import/build-testsuite.xml 2007-05-29 09:21:32 UTC (rev 3272)
@@ -97,6 +97,7 @@
<pathelement location="${jboss.client}/jboss-logging-spi.jar"/>
<pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
<pathelement location="${jboss.client}/mail.jar"/>
+ <pathelement location="${jboss.client}/jbossws-integration-tools.jar"/>
<pathelement location="${jboss.server.lib}/jboss-javaee.jar"/>
<pathelement location="${jboss.server.lib}/jbosssx.jar"/>
<pathelement location="${jboss.server.lib}/servlet-api.jar"/>
Modified: trunk/build/etc/wsconsume.bat
===================================================================
--- trunk/build/etc/wsconsume.bat 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/build/etc/wsconsume.bat 2007-05-29 09:21:32 UTC (rev 3272)
@@ -40,7 +40,9 @@
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-api.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-impl.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-xjc.jar
-set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-wsconsume-impl.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-rt.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-tools.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-integration-tools.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxrpc.jar
@@ -50,4 +52,4 @@
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
rem Execute the JVM
-"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.ws.tools.jaxws.command.wsconsume %*
+"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.wsf.spi.tools.command.wsconsume %*
Modified: trunk/build/etc/wsconsume.sh
===================================================================
--- trunk/build/etc/wsconsume.sh 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/build/etc/wsconsume.sh 2007-05-29 09:21:32 UTC (rev 3272)
@@ -50,7 +50,6 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JAVA_HOME/lib/tools.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-xml-binding.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/wstx.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-wsconsume-impl.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/activation.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/getopt.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/javassist.jar"
@@ -58,6 +57,8 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/stax-api.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-impl.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-xjc.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-rt.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-tools.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossall-client.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-client.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-jaxws.jar"
@@ -65,6 +66,7 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/mail.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-integration-tools.jar"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
@@ -79,4 +81,4 @@
-Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-Dlog4j.configuration=wstools-log4j.xml \
-classpath "$WSCONSUME_CLASSPATH" \
- org.jboss.ws.tools.jaxws.command.wsconsume "$@"
+ org.jboss.wsf.spi.tools.command.wsconsume "$@"
Modified: trunk/build/etc/wsprovide.bat
===================================================================
--- trunk/build/etc/wsprovide.bat 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/build/etc/wsprovide.bat 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,6 +1,6 @@
@echo off
-rem $Id: wsprovide.bat 2464 2007-02-23 21:51:05Z jason.greene(a)jboss.com $
+rem $Id: wsprovide.bat 3101 2007-05-16 08:26:33Z heiko.braun(a)jboss.com $
@if not "%ECHO%" == "" echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal
@@ -45,4 +45,4 @@
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
rem Execute the JVM
-"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSPROVIDE_CLASSPATH%" org.jboss.ws.tools.jaxws.command.wsprovide %*
+"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSPROVIDE_CLASSPATH%" org.jboss.wsf.spi.tools.command.wsprovide %*
Modified: trunk/build/etc/wsprovide.sh
===================================================================
--- trunk/build/etc/wsprovide.sh 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/build/etc/wsprovide.sh 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,6 +1,6 @@
#!/bin/sh
-# $Id: wsprovide.sh 2361 2007-02-14 14:52:02Z jason.greene(a)jboss.com $
+# $Id: wsprovide.sh 3101 2007-05-16 08:26:33Z heiko.braun(a)jboss.com $
DIRNAME=`dirname $0`
PROGNAME=`basename $0`
@@ -60,6 +60,7 @@
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/mail.jar"
+WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jbossws-integration-tools.jar"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
@@ -74,4 +75,4 @@
-Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-Dlog4j.configuration=wstools-log4j.xml \
-classpath "$WSPROVIDE_CLASSPATH" \
- org.jboss.ws.tools.jaxws.command.wsprovide "$@"
+ org.jboss.wsf.spi.tools.command.wsprovide "$@"
Modified: trunk/build/etc/wspublish.sh
===================================================================
--- trunk/build/etc/wspublish.sh 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/build/etc/wspublish.sh 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,6 +1,6 @@
#!/bin/sh
-# $Id: wspublish.sh 2157 2007-01-27 06:03:58Z jason.greene(a)jboss.com $
+# $Id: wspublish.sh 3101 2007-05-16 08:26:33Z heiko.braun(a)jboss.com $
DIRNAME=`dirname $0`
PROGNAME=`basename $0`
@@ -43,6 +43,7 @@
WSPUBLISH_CLASSPATH="$WSPUBLISH_CLASSPATH:$TOMCAT_HOME/common/lib/log4j.jar"
WSPUBLISH_CLASSPATH="$WSPUBLISH_CLASSPATH:$TOMCAT_HOME/common/lib/servlet-api.jar"
+
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
TOMCAT_HOME=`cygpath --path --windows "$TOMCAT_HOME"`
Modified: trunk/integration/native/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/native/ant-import/build-deploy.xml 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/integration/native/ant-import/build-deploy.xml 2007-05-29 09:21:32 UTC (rev 3272)
@@ -13,44 +13,80 @@
<project>
- <import file="${int.native.dir}/ant-import/macros-deploy-native.xml"/>
-
- <!-- ================================================================== -->
- <!-- Deployment -->
- <!-- ================================================================== -->
-
- <!-- Deploy to jboss50 -->
- <target name="deploy-jboss50" depends="jars-jboss50,undeploy-jboss50" description="Deploy jbossws to jboss50">
- <ant antfile="${int.sunri.dir}/build.xml" target="undeploy-jboss50" inheritall="false"/>
- <ant antfile="${int.xfire.dir}/build.xml" target="undeploy-jboss50" inheritall="false"/>
- <macro-deploy-native50
- spilibs="${spi.dir}/output/lib"
- jbosslibs="${int.jboss50.dir}/output/lib"
- corelibs="${core.dir}/output/lib"
- stacklibs="${int.native.dir}/output/lib"
- thirdpartylibs="${core.dir}/thirdparty"/>
- </target>
-
- <!-- Remove from jboss50 -->
- <target name="undeploy-jboss50" depends="prepare" description="Remove jbossws from jboss50">
- <macro-undeploy-native50/>
- </target>
-
- <!-- Deploy to jboss42 -->
- <target name="deploy-jboss42" depends="jars-jboss42,undeploy-jboss42" description="Deploy jbossws to jboss42">
- <ant antfile="${int.sunri.dir}/build.xml" target="undeploy-jboss42" inheritall="false"/>
- <ant antfile="${int.xfire.dir}/build.xml" target="undeploy-jboss42" inheritall="false"/>
- <macro-deploy-native42
- spilibs="${spi.dir}/output/lib"
- jbosslibs="${int.jboss42.dir}/output/lib"
- corelibs="${core.dir}/output/lib"
- stacklibs="${int.native.dir}/output/lib"
- thirdpartylibs="${core.dir}/thirdparty"/>
- </target>
-
- <!-- Remove from jboss42 -->
- <target name="undeploy-jboss42" depends="prepare" description="Remove jbossws from jboss42">
- <macro-undeploy-native42/>
- </target>
-
+ <import file="${int.native.dir}/ant-import/macros-deploy-native.xml"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment JBoss50 -->
+ <!-- ================================================================== -->
+
+ <!-- Deploy jbossws to jboss50 -->
+ <target name="deploy-jboss50" depends="jars-jboss50,undeploy-jboss50" description="Deploy jbossws to jboss50">
+ <ant antfile="${int.jboss50.dir}/build.xml" target="jars" inheritall="false"/>
+ <ant antfile="${int.sunri.dir}/build.xml" target="undeploy-jboss50" inheritall="false"/>
+ <ant antfile="${int.xfire.dir}/build.xml" target="undeploy-jboss50" inheritall="false"/>
+ <macro-deploy-native50
+ spilibs="${spi.dir}/output/lib"
+ jbosslibs="${int.jboss50.dir}/output/lib"
+ corelibs="${core.dir}/output/lib"
+ stacklibs="${int.native.dir}/output/lib"
+ thirdpartylibs="${core.dir}/thirdparty">
+ <copy-tasks>
+ <copy todir="${jboss50.home}/bin" overwrite="true">
+ <fileset dir="${build.dir}/etc">
+ <include name="*.bat"/>
+ <include name="*.sh"/>
+ </fileset>
+ </copy>
+ </copy-tasks>
+
+ </macro-deploy-native50>
+ </target>
+
+ <!-- Remove jbossws from jboss50 -->
+ <target name="undeploy-jboss50" depends="prepare" description="Remove jbossws from jboss50">
+ <macro-undeploy-native50>
+ <delete-tasks>
+ <delete>
+ <fileset dir="${jboss50.home}/bin">
+ <include name="ws*.sh"/>
+ <include name="ws*.bat"/>
+ </fileset>
+ </delete>
+ </delete-tasks>
+ </macro-undeploy-native50>
+ </target>
+
+ <!-- Deploy jbossws to jboss42 -->
+ <target name="deploy-jboss42" depends="jars-jboss42,undeploy-jboss42" description="Deploy jbossws to jboss42">
+ <ant antfile="${int.jboss42.dir}/build.xml" target="jars" inheritall="false"/>
+ <macro-deploy-native42
+ spilibs="${spi.dir}/output/lib"
+ jbosslibs="${int.jboss42.dir}/output/lib"
+ corelibs="${core.dir}/output/lib"
+ stacklibs="${int.native.dir}/output/lib"
+ thirdpartylibs="${core.dir}/thirdparty">
+ <copy-tasks>
+ <copy todir="${jboss42.home}/bin" overwrite="true">
+ <fileset dir="${build.dir}/etc">
+ <include name="*.bat"/>
+ <include name="*.sh"/>
+ </fileset>
+ </copy>
+ </copy-tasks>
+ </macro-deploy-native42>
+ </target>
+
+ <!-- Remove jbossws from jboss42 -->
+ <target name="undeploy-jboss42" depends="prepare" description="Remove jbossws from jboss42">
+ <macro-undeploy-native42>
+ <delete-tasks>
+ <delete>
+ <fileset dir="${jboss50.home}/bin">
+ <include name="ws*.sh"/>
+ <include name="ws*.bat"/>
+ </fileset>
+ </delete>
+ </delete-tasks>
+ </macro-undeploy-native42>
+ </target>
</project>
Modified: trunk/integration/native/ant-import/macros-deploy-native.xml
===================================================================
--- trunk/integration/native/ant-import/macros-deploy-native.xml 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/integration/native/ant-import/macros-deploy-native.xml 2007-05-29 09:21:32 UTC (rev 3272)
@@ -23,7 +23,8 @@
<attribute name="corelibs"/>
<attribute name="stacklibs"/>
<attribute name="thirdpartylibs"/>
- <sequential>
+ <element name="copy-tasks" optional="yes"/>
+ <sequential>
<fail message="Not available: ${jboss50.available.file}" unless="jboss50.available"/>
<copy todir="${jboss50.home}/client" overwrite="true">
<fileset dir="@{spilibs}">
@@ -37,13 +38,13 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
</fileset>
<fileset dir="@{thirdpartylibs}">
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
<include name="wsdl4j.jar"/>
- <include name="jbossws-wsconsume-impl.jar"/>
</fileset>
</copy>
<copy todir="${jboss50.home}/lib" overwrite="true">
@@ -65,6 +66,9 @@
<include name="jboss-saaj.jar"/>
</fileset>
</copy>
+
+ <copy-tasks/>
+
<mkdir dir="${jboss50.home}/server/${jboss.server.instance}/deployers/jbossws.deployer"/>
<unzip dest="${jboss50.home}/server/${jboss.server.instance}/deployers/jbossws.deployer" src="@{stacklibs}/jbossws-native50-deployer.zip"/>
<mkdir dir="${jboss50.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
@@ -77,6 +81,7 @@
</macrodef>
<macrodef name="macro-undeploy-native50">
+ <element name="delete-tasks" optional="yes"/>
<sequential>
<fail message="Not available: ${jboss50.available.file}" unless="jboss50.available"/>
<delete>
@@ -102,6 +107,8 @@
<delete file="${jboss50.home}/server/${jboss.server.instance}/deploy/jbossws-context.war"/>
<!-- Undeploy juddi-service.sar -->
<delete dir="${jboss50.home}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
+
+ <delete-tasks/>
</sequential>
</macrodef>
@@ -111,6 +118,7 @@
<attribute name="corelibs"/>
<attribute name="stacklibs"/>
<attribute name="thirdpartylibs"/>
+ <element name="copy-tasks" optional="yes"/>
<sequential>
<fail message="Not available: ${jboss42.available.file}" unless="jboss42.available"/>
<copy todir="${jboss42.home}/client" overwrite="true">
@@ -125,13 +133,13 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
</fileset>
<fileset dir="@{thirdpartylibs}">
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
- <include name="wsdl4j.jar"/>
- <include name="jbossws-wsconsume-impl.jar"/>
+ <include name="wsdl4j.jar"/>
</fileset>
</copy>
<copy todir="${jboss42.home}/server/${jboss.server.instance}/lib" overwrite="true">
@@ -147,6 +155,9 @@
<include name="jboss-saaj.jar"/>
</fileset>
</copy>
+
+ <copy-tasks/>
+
<mkdir dir="${jboss42.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<unjar dest="${jboss42.home}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/jbossws-native42.sar"/>
<!-- Deploy juddi-service.sar -->
@@ -156,6 +167,7 @@
</macrodef>
<macrodef name="macro-undeploy-native42">
+ <element name="delete-tasks" optional="yes"/>
<sequential>
<fail message="Not available: ${jboss42.available.file}" unless="jboss42.available"/>
<delete>
@@ -166,6 +178,7 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
<include name="jbossws-wsconsume-impl.jar"/>
</fileset>
<fileset dir="${jboss42.home}/lib">
@@ -182,6 +195,8 @@
<delete dir="${jboss42.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<!-- Undeploy juddi-service.sar -->
<delete dir="${jboss42.home}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
+
+ <delete-tasks/>
</sequential>
</macrodef>
Modified: trunk/integration/spi/ant-import/build-thirdparty.xml
===================================================================
--- trunk/integration/spi/ant-import/build-thirdparty.xml 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/integration/spi/ant-import/build-thirdparty.xml 2007-05-29 09:21:32 UTC (rev 3272)
@@ -13,6 +13,8 @@
<project>
+ <property file="${core.dir}/version.properties"/>
+
<!-- ========= -->
<!-- Libraries -->
<!-- ========= -->
@@ -42,6 +44,7 @@
<get src="${jboss.repository}/jboss/common-core/${jboss-common-core}/lib/jboss-common-core-sources.jar" dest="${thirdparty.dir}/jboss-common-core-sources.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/common-logging-log4j/${jboss-common-logging-log4j}/lib/jboss-logging-log4j.jar" dest="${thirdparty.dir}/jboss-logging-log4j.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/common-logging-spi/${jboss-common-logging-spi}/lib/jboss-logging-spi.jar" dest="${thirdparty.dir}/jboss-logging-spi.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/gnu-getopt/${gnu-getopt}/lib/getopt.jar" dest="${thirdparty.dir}/getopt.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jboss-javaee/${jboss-javaee}/lib/jboss-javaee.jar" dest="${thirdparty.dir}/jboss-javaee.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding.jar" dest="${thirdparty.dir}/jboss-xml-binding.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding-sources.jar" dest="${thirdparty.dir}/jboss-xml-binding-sources.jar" usetimestamp="true" verbose="true"/>
@@ -62,7 +65,6 @@
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/saaj-api.jar" dest="${thirdparty.dir}/saaj-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxrpc/${sun-jaxrpc}/lib/jaxrpc-api.jar" dest="${thirdparty.dir}/jaxrpc-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-servlet/${sun-servlet}/lib/servlet-api.jar" dest="${thirdparty.dir}/servlet-api.jar" usetimestamp="true" verbose="true"/>
-
<checksum file="${build.dir}/version.properties" fileext=".md5"/>
</target>
@@ -72,6 +74,7 @@
<path id="thirdparty.classpath">
<pathelement location="${thirdparty.dir}/activation.jar"/>
<pathelement location="${thirdparty.dir}/dom4j.jar"/>
+ <pathelement location="${thirdparty.dir}/getopt.jar"/>
<pathelement location="${thirdparty.dir}/jboss-common-core.jar"/>
<pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
<pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
Modified: trunk/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -31,7 +31,6 @@
import java.security.PrivilegedAction;
import java.util.Properties;
-import org.jboss.logging.Logger;
// $Id$
@@ -43,20 +42,19 @@
*/
public class FactoryLoader
{
- // provide logging
- private static Logger log = Logger.getLogger(FactoryLoader.class);
-
private FactoryLoader()
{
}
/**
* Load a factory using this ordered lookup procedure
- *
- * 1. Use the system property
- * 2. Use the properties file "lib/jaxm.properties" in the JRE directory
- * 3. Use the Services API (as detailed in the JAR specification), if available, to determine the classname
- * 4. Use the default factory implementation class
+ *
+ * <ol>
+ * <li>Use the system property
+ * <li>Use the properties file "lib/jaxm.properties" in the JRE directory
+ * <li>Use the Services API (as detailed in the JAR specification), if available, to determine the classname
+ * <li>Use the default factory implementation class
+ * </ol>
*
* @return the factory impl, or null
*/
@@ -72,7 +70,7 @@
{
try
{
- if(log.isDebugEnabled()) log.debug("Load from system property: " + factoryName);
+ //if(log.isDebugEnabled()) log.debug("Load from system property: " + factoryName);
Class factoryClass = loader.loadClass(factoryName);
factory = factoryClass.newInstance();
}
@@ -98,7 +96,7 @@
factoryName = jaxmProperties.getProperty(propertyName);
if (factoryName != null)
{
- if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile + ": " + factoryName);
+ //if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile + ": " + factoryName);
Class factoryClass = loader.loadClass(factoryName);
factory = factoryClass.newInstance();
}
@@ -124,7 +122,7 @@
br.close();
if (factoryName != null)
{
- if(log.isTraceEnabled()) log.trace("Load from Service API " + filename + ": " + factoryName);
+ //if(log.isTraceEnabled()) log.trace("Load from Service API " + filename + ": " + factoryName);
Class factoryClass = loader.loadClass(factoryName);
factory = factoryClass.newInstance();
}
@@ -142,7 +140,7 @@
try
{
factoryName = defaultFactory;
- if(log.isDebugEnabled()) log.debug("Load from default: " + factoryName);
+ //if(log.isDebugEnabled()) log.debug("Load from default: " + factoryName);
Class factoryClass = loader.loadClass(factoryName);
factory = factoryClass.newInstance();
}
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,305 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.wsf.spi.tools.ant;
+
+import org.apache.tools.ant.*;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.jboss.wsf.spi.tools.api.WSContractConsumer;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Ant task which consumes a Web Service contract.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
+ * <tr><td>catalog</td><td> Oasis XML Catalog file for entity resolution</td><td>none</td></tr>
+ * <tr><td>package</td><td> The target Java package for generated code.</td><td>generated</td></tr>
+ * <tr><td>binding</td><td>A JAX-WS or JAXB binding file</td><td>none</td></tr>
+ * <tr><td>wsdlLocation</td><td>Value to use for @(a)WebService.wsdlLocation</td><td>generated</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
+ * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
+ * <tr><td>wsdl*</td><td>The WSDL file or URL</td><td>n/a</td><tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <wsconsume
+ * fork="true"
+ * verbose="true"
+ * destdir="output"
+ * sourcedestdir="gen-src"
+ * keep="true"
+ * wsdllocation="handEdited.wsdl"
+ * wsdl="foo.wsdl">
+ * <binding dir="binding-files" includes="*.xml" excludes="bad.xml"/>
+ * </wsimport>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsconsume extends Task
+{
+ private CommandlineJava command = new CommandlineJava();
+ private String wsdl = null;
+ private File destdir = null;
+ private File sourcedestdir = null;
+ private List<File> bindingFiles = new ArrayList<File>();
+ private File catalog = null;
+ private String wsdlLocation = null;
+ private String targetPackage = null;
+ private boolean keep = false;
+ private boolean verbose = false;
+ private boolean fork = false;
+ private boolean debug = false;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setBinding(File bindingFile)
+ {
+ bindingFiles.add(bindingFile);
+ }
+
+ public void setCatalog(File catalog)
+ {
+ this.catalog = catalog;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setPackage(String targetPackage)
+ {
+ this.targetPackage = targetPackage;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setWsdl(String wsdl)
+ {
+ this.wsdl = wsdl;
+ }
+
+ public void setWsdlLocation(String wsdlLocation)
+ {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void addConfiguredBinding(FileSet fs)
+ {
+ DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+ File baseDir = ds.getBasedir();
+ for (String file : ds.getIncludedFiles())
+ {
+ bindingFiles.add(new File(baseDir, file));
+ }
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
+ ClassLoader antLoader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(antLoader);
+ try
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+ importer.setGenerateSource(keep);
+ if (destdir != null)
+ importer.setOutputDirectory(destdir);
+ if (sourcedestdir != null)
+ importer.setSourceDirectory(sourcedestdir);
+ if (targetPackage != null)
+ importer.setTargetPackage(targetPackage);
+ if (wsdlLocation != null)
+ importer.setWsdlLocation(wsdlLocation);
+ if (catalog != null)
+ importer.setCatalog(catalog);
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ importer.setBindingFiles(bindingFiles);
+
+ log("Consuming wsdl: " + wsdl, Project.MSG_INFO);
+
+ if (verbose)
+ {
+ importer.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
+ }
+
+ try
+ {
+ importer.setAdditionalCompilerClassPath(getTaskClassPathStrings());
+ importer.consume(wsdl);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new BuildException(e, getLocation());
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (wsdl == null)
+ throw new BuildException("The wsdl attribute must be specified!", getLocation());
+
+ if (fork)
+ executeForked();
+ else
+ executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private List<String> getTaskClassPathStrings()
+ {
+ // Why is everything in the Ant API a big hack???
+ List<String> strings = new ArrayList<String>();
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ for (String string : ((AntClassLoader)cl).getClasspath().split(File.pathSeparator))
+ strings.add(string);
+ }
+
+ return strings;
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.wsf.spi.tools.command.wsconsume.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ for (File file : bindingFiles)
+ {
+ command.createArgument().setValue("-b");
+ command.createArgument().setFile(file);
+ }
+
+ if (catalog != null)
+ {
+ command.createArgument().setValue("-c");
+ command.createArgument().setFile(catalog);
+ }
+
+ if (targetPackage != null)
+ {
+ command.createArgument().setValue("-p");
+ command.createArgument().setValue(targetPackage);
+ }
+
+ if (wsdlLocation != null)
+ {
+ command.createArgument().setValue("-w");
+ command.createArgument().setValue(wsdlLocation);
+ }
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (!verbose)
+ command.createArgument().setValue("-q");
+
+ // Always dump traces
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(wsdl);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke wsconsume", getLocation());
+ }
+}
\ No newline at end of file
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,266 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.wsf.spi.tools.ant;
+
+import org.apache.tools.ant.AntClassLoader;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Reference;
+import org.jboss.wsf.spi.tools.api.WSContractProvider;
+
+import java.io.File;
+import java.io.PrintStream;
+
+/**
+ * Ant task which invokes provides a Web Service contract and portable JAX-WS wrapper classes.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
+ * <tr><td>resourcedestdir</td><td>The output directory for resource artifacts (WSDL/XSD).</td><td>value of destdir</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
+ * <tr><td>genwsdl</td><td>Whether or not to generate WSDL.</td><td>false</td><tr>
+ * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
+ * <tr><td>sei*</td><td>Service Endpoint Implementation.</td><td></td><tr>
+ * <tr><td>classpath</td><td>The classpath that contains the service endpoint implementation.</td><td>""</tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <target name="test-wsproivde" depends="init">
+ * <taskdef name="wsprovide" classname="org.jboss.wsf.spi.tools.ant.wsprovide">
+ * <classpath refid="core.classpath"/>
+ * </taskdef>
+ * <wsprovide
+ * fork="false"
+ * keep="true"
+ * destdir="out"
+ * resourcedestdir="out-resource"
+ * sourcedestdir="out-source"
+ * genwsdl="true"
+ * verbose="true"
+ * sei="org.jboss.test.ws.jaxws.jsr181.soapbinding.DocWrappedServiceImpl">
+ * <classpath>
+ * <pathelement path="${tests.output.dir}/classes"/>
+ * </classpath>
+ * </wsprovide>
+ * </target>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsprovide extends Task
+{
+ private Path classpath = new Path(getProject());
+ private CommandlineJava command = new CommandlineJava();
+ private String sei = null;
+ private File destdir = null;
+ private File resourcedestdir = null;
+ private File sourcedestdir = null;
+ private boolean keep = false;
+ private boolean genwsdl = false;
+ private boolean verbose = false;
+ private boolean fork = false;
+ private boolean debug = false;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setClasspath(Path classpath)
+ {
+ this.classpath = classpath;
+ }
+
+ public void setClasspathRef(Reference ref)
+ {
+ createClasspath().setRefid(ref);
+ }
+
+ public Path createClasspath()
+ {
+ return classpath;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setSei(String sei)
+ {
+ this.sei = sei;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setResourcedestdir(File resourcedestdir)
+ {
+ this.resourcedestdir = resourcedestdir;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setGenwsdl(boolean genwsdl)
+ {
+ this.genwsdl = genwsdl;
+ }
+
+ private ClassLoader getClasspathLoader(ClassLoader parent)
+ {
+ return new AntClassLoader(parent, getProject(), classpath, false);
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
+ ClassLoader antLoader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(antLoader);
+ try
+ {
+ WSContractProvider gen = WSContractProvider.newInstance();
+ gen.setClassLoader(getClasspathLoader(antLoader));
+ if (verbose)
+ gen.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
+ gen.setGenerateSource(keep);
+ gen.setGenerateWsdl(genwsdl);
+ if (destdir != null)
+ gen.setOutputDirectory(destdir);
+ if (resourcedestdir != null)
+ gen.setResourceDirectory(resourcedestdir);
+ if (sourcedestdir != null)
+ gen.setSourceDirectory(sourcedestdir);
+
+ log("Generating from endpoint: " + sei, Project.MSG_INFO);
+
+ gen.provide(sei);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (sei == null)
+ throw new BuildException("The sei attribute must be specified!", getLocation());
+
+ if (fork)
+ executeForked();
+ else
+ executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.wsf.spi.tools.command.wsprovide.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+ path.append(classpath);
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ if (genwsdl)
+ command.createArgument().setValue("-w");
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+ if (resourcedestdir != null)
+ {
+ command.createArgument().setValue("-r");
+ command.createArgument().setFile(resourcedestdir);
+ }
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (!verbose)
+ command.createArgument().setValue("-q");
+
+ // Always dump traces
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(sei);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke wsprovide", getLocation());
+ }
+}
\ No newline at end of file
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractConsumer.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractConsumer.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractConsumer.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,188 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.wsf.spi.tools.api;
+
+import org.jboss.ws.integration.FactoryLoader;
+import org.jboss.wsf.spi.tools.spi.WSContractConsumerFactory;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+/**
+ * WSContractConsumer is responsible for generating JAX-WS client and server
+ * artifacts from the specified WSDL file. To implement a client, one would use
+ * the generated ___Service.java file. For a server, one only needs to provide
+ * an implementation class that implements the generated service endpoint
+ * interface.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public abstract class WSContractConsumer
+{
+ private static String DEFAULT_PROVIDER = "org.jboss.ws.tools.jaxws.impl.SunRIConsumerFactoryImpl";
+ public static final String PROVIDER_PROPERTY = "org.jboss.wsf.tools.ConsumerFactoryImpl";
+
+ /**
+ * Obtain a new instance of a WSContractProvider. This will use the current
+ * thread's context class loader to locate the WSContractProviderFactory
+ * implementation.
+ *
+ * @return a new WSContractProvider
+ */
+ public static WSContractConsumer newInstance()
+ {
+ return newInstance(Thread.currentThread().getContextClassLoader());
+ }
+
+ /**
+ * Obtain a new instance of a WSContractConsumer. The specified ClassLoader will be used to
+ * locate the WebServiceImporterProvide implementation
+ *
+ * @param loader the ClassLoader to use
+ * @return a new WSContractConsumer
+ */
+ public static WSContractConsumer newInstance(ClassLoader loader)
+ {
+ ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(loader);
+ WSContractConsumerFactory factory = (WSContractConsumerFactory)
+ FactoryLoader.loadFactory(PROVIDER_PROPERTY, DEFAULT_PROVIDER);
+ return factory.createConsumer();
+ }
+ finally{
+ Thread.currentThread().setContextClassLoader(oldLoader);
+ }
+ }
+
+ /**
+ * Specifies the JAX-WS and JAXB binding files to use on import operations.
+ *
+ * @param bindingFiles list of JAX-WS or JAXB binding files
+ */
+ public abstract void setBindingFiles(List<File> bindingFiles);
+
+ /**
+ * Sets the OASIS XML Catalog file to use for entity resolution.
+ *
+ * @param catalog the OASIS XML Catalog file
+ */
+ public abstract void setCatalog(File catalog);
+
+ /**
+ * Sets the main output directory. If the directory does not exist, it will be created.
+ *
+ * @param directory the root directory for generated files
+ */
+ public abstract void setOutputDirectory(File directory);
+
+ /**
+ * Sets the source directory. This directory will contain any generated Java source.
+ * If the directory does not exist, it will be created. If not specified,
+ * the output directory will be used instead.
+ *
+ * @param directory the root directory for generated source code
+ */
+ public abstract void setSourceDirectory(File directory);
+
+ /**
+ * Enables/Disables Java source generation.
+ *
+ * @param generateSource whether or not to generate Java source.
+ */
+ public abstract void setGenerateSource(boolean generateSource);
+
+
+ /**
+ * Sets the target package for generated source. If not specified the default
+ * is based off of the XML namespace.
+ *
+ * @param targetPackage the target package for generated source
+ */
+ public abstract void setTargetPackage(String targetPackage);
+
+ /**
+ * Sets the @(a)WebService.wsdlLocation and @(a)WebServiceClient.wsdlLocation attributes to a custom value.
+ *
+ * @param wsdlLocation the custom WSDL location to use in generated source
+ */
+ public abstract void setWsdlLocation(String wsdlLocation);
+
+ /**
+ * Sets the PrintStream to use for status feedback. The simplest example
+ * would be to use System.out.
+ *
+ * @param messageStream the stream to use for status messages:
+ */
+ public abstract void setMessageStream(PrintStream messageStream);
+
+
+ /**
+ * Sets the additional classpath to use if/when invoking the Java compiler.
+ * Typically an implementation will use the system <code>java.class.path</code>
+ * property. So for most normal applications this method is not needed. However,
+ * if this API is being used from an isolated classloader, then it needs to
+ * be called in order to reference all jars that are required by the
+ * implementation.
+ *
+ * @param classPath a list of strings where each entry references a
+ * single jar or directory
+ */
+ public abstract void setAdditionalCompilerClassPath(List<String> classPath);
+
+ /**
+ * Generate the required artifacts using the specified WSDL URL. This method
+ * may be called more than once, although this is probably not desireable
+ *
+ * @param wsdl the URL of the WSDL
+ */
+ public abstract void consume(URL wsdl);
+
+ /**
+ * Generate the required artifacts using the specified WSDL. This method
+ * may be called more than once, although this is probably not desireable.
+ * The passed string is expect to either be a valid URL, or a local file path.
+ *
+ * @param wsdl a URL or local file path
+ * @throws MalformedURLException if wsdl is not a legal URL or local file
+ */
+ public void consume(String wsdl) throws MalformedURLException
+ {
+ URL url = null;
+ try
+ {
+ url = new URL(wsdl);
+ }
+ catch (MalformedURLException e)
+ {
+ File file = new File(wsdl);
+ url = file.toURL();
+ }
+
+ consume(url);
+ }
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractConsumer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractProvider.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractProvider.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractProvider.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,159 @@
+package org.jboss.wsf.spi.tools.api;
+
+import org.jboss.wsf.spi.tools.spi.WSContractProviderFactory;
+import org.jboss.ws.integration.FactoryLoader;
+
+import java.io.File;
+import java.io.PrintStream;
+
+
+/**
+ * WSContractProvider is responsible for generating the required portable
+ * JAX-WS artifacts for a service endpoint implementation. This includes class
+ * files for wrapper types and fault beans. WSDL may be optionally generated as
+ * well using this API.
+ *
+ * <p>The following example generates class files, source files and WSDL for an
+ * endpoint:</p>
+ * <pre>
+ * WSContractProvider provider = WSContractProvider.newInstance();
+ * provider.setGenerateSource(true);
+ * provider.setGenerateWsdl(true);
+ * provider.setOutputDirectory(new File("output"));
+ * provider.setMessageStream(System.out);
+ * provider.provide(TestMe.class);
+ * </pre>
+ *
+ * <p>Thread-Safety:</p>
+ * This class expects to be thread-confined, so it can not be shared between threads.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public abstract class WSContractProvider
+{
+ private static String DEFAULT_PROVIDER = "org.jboss.ws.tools.jaxws.impl.JBossWSProviderFactoryImpl";
+ public static final String PROVIDER_PROPERTY = "org.jboss.wsf.tools.ProviderFactoryImpl";
+
+ protected WSContractProvider()
+ {
+
+ }
+
+ /**
+ * Obtain a new instance of a WSContractProvider. This will use the current
+ * thread's context class loader to locate the WSContractProviderFactory
+ * implementation.
+ *
+ * @return a new WSContractProvider
+ */
+ public static WSContractProvider newInstance()
+ {
+ return newInstance(Thread.currentThread().getContextClassLoader());
+ }
+
+ /**
+ * Obtain a new instance of a WSContractProvider. The specified ClassLoader will be used to
+ * locate the WSContractProviderFactory implementation
+ *
+ * @param loader the ClassLoader to use
+ * @return a new WSContractProvider
+ */
+ public static WSContractProvider newInstance(ClassLoader loader)
+ {
+ ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(loader);
+ WSContractProviderFactory factory = (WSContractProviderFactory)
+ FactoryLoader.loadFactory(PROVIDER_PROPERTY, DEFAULT_PROVIDER);
+ return factory.createProvider(loader);
+ }
+ finally{
+ Thread.currentThread().setContextClassLoader(oldLoader);
+ }
+ }
+
+ /**
+ * Enables/Disables WSDL generation.
+ *
+ * @param generateWsdl whether or not to generate WSDL
+ */
+ public abstract void setGenerateWsdl(boolean generateWsdl);
+
+ /**
+ * Enables/Disables Java source generation.
+ *
+ * @param generateSource whether or not to generate Java source.
+ */
+ public abstract void setGenerateSource(boolean generateSource);
+
+ /**
+ * Sets the main output directory. If the directory does not exist, it will be created.
+ *
+ * @param directory the root directory for generated files
+ */
+ public abstract void setOutputDirectory(File directory);
+
+ /**
+ * Sets the resource directory. This directory will contain any generated
+ * WSDL and XSD files. If the directory does not exist, it will be created.
+ * If not specified, the output directory will be used instead.
+ *
+ * @param directory the root directory for generated resource files
+ */
+ public abstract void setResourceDirectory(File directory);
+
+ /**
+ * Sets the source directory. This directory will contain any generated Java source.
+ * If the directory does not exist, it will be created. If not specified,
+ * the output directory will be used instead.
+ *
+ * @param directory the root directory for generated source code
+ */
+ public abstract void setSourceDirectory(File directory);
+
+ /**
+ * Sets the ClassLoader used to discover types. This defaults to the one used
+ * in instantiation.
+ *
+ * @param loader the ClassLoader to use
+ */
+ public abstract void setClassLoader(ClassLoader loader);
+
+ /**
+ * Generates artifacts using the current settings. This method may be invoked
+ * more than once (e.g. multiple endpoints).
+ *
+ * @param endpointClass the name of the endpoint implementation bean
+ * @throws RuntimeException if any error occurs during processing, or the class is not found
+ */
+ public abstract void provide(String endpointClass);
+
+ /**
+ * Generates artifacts using the current settings. This method may be invoked
+ * more than once (e.g. multiple endpoints).
+ *
+ * @param endpointClass the endpoint implementation bean
+ * @throws RuntimeException if any error occurs during processing
+ */
+ public abstract void provide(Class<?> endpointClass);
+
+ /**
+ * Sets the PrintStream to use for status feedback. The simplest example
+ * would be to use System.out.
+ *
+ * <p>Example output:</p>
+ * <pre>
+ * Generating WSDL:
+ * TestMeService.wsdl
+ * Writing Source:
+ * org/jboss/ws/tools/jaxws/TestMe.java
+ * org/jboss/ws/tools/jaxws/TestMeResponse.java
+ * Writing Classes:
+ * org/jboss/ws/tools/jaxws/TestMe.class
+ * org/jboss/ws/tools/jaxws/TestMeResponse.class
+ * </pre>
+ * @param messageStream the stream to use for status messages:
+ */
+ public abstract void setMessageStream(PrintStream messageStream);
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/api/WSContractProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsconsume.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsconsume.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsconsume.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,233 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.tools.command;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+import org.jboss.wsf.spi.tools.api.WSContractConsumer;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * wsconsume is a command line tool that generates portable JAX-WS artifacts
+ * from a WSDL file.
+ *
+ * <pre>
+ * usage: wsconsume [options] <wsdl-url>
+ * options:
+ * -h, --help Show this help message
+ * -b, --binding=<file> One or more JAX-WS or JAXB binding files
+ * -k, --keep Keep/Generate Java source
+ * -c --catalog=<file> Oasis XML Catalog file for entity resolution
+ * -p --package=<name> The target package for generated source
+ * -w --wsdlLocation=<loc> Value to use for @(a)WebService.wsdlLocation
+ * -o, --output=<directory> The directory to put generated artifacts
+ * -s, --source=<directory> The directory to put Java source
+ * -q, --quiet Be somewhat more quiet
+ * -t, --show-traces Show full exception stack traces
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsconsume
+{
+ private List<File> bindingFiles = new ArrayList<File>();
+ private boolean generateSource = false;
+ private File catalog = null;
+ private String targetPackage = null;
+ private String wsdlLocation = null;
+ private boolean quiet = false;
+ private boolean showTraces = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+
+ public static String PROGRAM_NAME = System.getProperty("program.name", wsconsume.class.getName());
+
+ public static void main(String[] args)
+ {
+ wsconsume importer = new wsconsume();
+ URL wsdl = importer.parseArguments(args);
+ System.exit(importer.importServices(wsdl));
+ }
+
+ private URL parseArguments(String[] args)
+ {
+ String shortOpts = "hb:kc:p:w:o:s:qt";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("binding", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("catalog", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("package", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
+ new LongOpt("wsdlLocation", LongOpt.REQUIRED_ARGUMENT, null, 'w'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'b':
+ bindingFiles.add(new File(getopt.getOptarg()));
+ break;
+ case 'k':
+ generateSource = true;
+ break;
+ case 'c':
+ catalog = new File(getopt.getOptarg());
+ break;
+ case 'p':
+ targetPackage = getopt.getOptarg();
+ break;
+ case 'w':
+ wsdlLocation = getopt.getOptarg();
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 't':
+ showTraces = true;
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ int wsdlPos = getopt.getOptind();
+ if (wsdlPos >= args.length)
+ {
+ System.err.println("Error: WSDL URL was not specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ URL url = null;
+ try
+ {
+ try
+ {
+ url = new URL(args[wsdlPos]);
+ }
+ catch (MalformedURLException e)
+ {
+ File file = new File(args[wsdlPos]);
+ url = file.toURL();
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: Invalid URI: " + args[wsdlPos]);
+ System.exit(1);
+ }
+
+ return url;
+ }
+
+
+ private int importServices(URL wsdl)
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+ importer.setGenerateSource(generateSource);
+ importer.setOutputDirectory(outputDir);
+ if (sourceDir != null)
+ importer.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ importer.setMessageStream(System.out);
+
+ if (catalog != null)
+ importer.setCatalog(catalog);
+
+ if (targetPackage != null)
+ importer.setTargetPackage(targetPackage);
+
+ if (wsdlLocation != null)
+ importer.setWsdlLocation(wsdlLocation);
+
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ importer.setBindingFiles(bindingFiles);
+
+ try
+ {
+ importer.consume(wsdl);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not import. (use --show-traces to see full traces)");
+ if (!showTraces)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("wsconsume is a command line tool that generates portable JAX-WS artifacts from a WSDL file.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options] <wsdl-url>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -b, --binding=<file> One or more JAX-WS or JAXB binding files ");
+ out.println(" -k, --keep Keep/Generate Java source");
+ out.println(" -c --catalog=<file> Oasis XML Catalog file for entity resolution");
+ out.println(" -p --package=<name> The target package for generated source");
+ out.println(" -w --wsdlLocation=<loc> Value to use for @WebService.wsdlLocation");
+ out.println(" -o, --output=<directory> The directory to put generated artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java source");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -t, --show-traces Show full exception stack traces");
+ out.flush();
+ }
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsconsume.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsprovide.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsprovide.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsprovide.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,224 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.tools.command;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+import org.jboss.wsf.spi.utils.JavaUtils;
+import org.jboss.wsf.spi.tools.api.WSContractProvider;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * wsprovide is a command line tool that generates portable JAX-WS artifacts
+ * for a service endpoint implementation.
+ *
+ * <pre>
+ * usage: wsprovide [options] <endpoint class name>
+ * options:
+ * -h, --help Show this help message
+ * -k, --keep Keep/Generate Java source
+ * -w, --wsdl Enable WSDL file generation
+ * -c. --classpath=<path< The classpath that contains the endpoint
+ * -o, --output=<directory> The directory to put generated artifacts
+ * -r, --resource=<directory> The directory to put resource artifacts
+ * -s, --source=<directory> The directory to put Java source
+ * -q, --quiet Be somewhat more quiet
+ * -t, --show-traces Show full exception stack traces
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class wsprovide
+{
+ private boolean generateSource = false;
+ private boolean generateWsdl = false;
+ private boolean quiet = false;
+ private boolean showTraces = false;
+ private ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ private File outputDir = new File("output");
+ private File resourceDir = null;
+ private File sourceDir = null;
+
+ public static String PROGRAM_NAME = System.getProperty("program.name", wsprovide.class.getSimpleName());
+
+ public static void main(String[] args)
+ {
+ wsprovide generate = new wsprovide();
+ String endpoint = generate.parseArguments(args);
+ System.exit(generate.generate(endpoint));
+ }
+
+ private String parseArguments(String[] args)
+ {
+ String shortOpts = "hwko:r:s:c:qt";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("wsdl", LongOpt.NO_ARGUMENT, null, 'w'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("resource", LongOpt.REQUIRED_ARGUMENT, null, 'r'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'k':
+ generateSource = true;
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 'r':
+ resourceDir = new File(getopt.getOptarg());
+ break;
+ case 'w':
+ generateWsdl = true;
+ break;
+ case 't':
+ showTraces = true;
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 'c':
+ processClassPath(getopt.getOptarg());
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ int endpointPos = getopt.getOptind();
+ if (endpointPos >= args.length)
+ {
+ System.err.println("Error: endpoint implementation was not specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ return args[endpointPos];
+ }
+
+
+ private int generate(String endpoint)
+ {
+ if (!JavaUtils.isLoaded(endpoint, loader))
+ {
+ System.err.println("Error: Could not load class [" + endpoint + "]. Did you specify a valid --classpath?");
+ return 1;
+ }
+
+ WSContractProvider gen = WSContractProvider.newInstance(loader);
+ gen.setGenerateWsdl(generateWsdl);
+ gen.setGenerateSource(generateSource);
+ gen.setOutputDirectory(outputDir);
+ if (resourceDir != null)
+ gen.setResourceDirectory(resourceDir);
+ if (sourceDir != null)
+ gen.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ gen.setMessageStream(System.out);
+
+ try
+ {
+ gen.provide(endpoint);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not generate. (use --show-traces to see full traces)");
+ if (!showTraces)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private void processClassPath(String classPath)
+ {
+ String[] entries = classPath.split(File.pathSeparator);
+ List<URL> urls= new ArrayList<URL>(entries.length);
+ for (String entry : entries)
+ {
+ try
+ {
+ urls.add(new File(entry).toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: a classpath entry was malformed: " + entry);
+ }
+ }
+ loader = new URLClassLoader(urls.toArray(new URL[0]), loader);
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("wsprovide generates portable JAX-WS artifacts for an endpoint implementation.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options] <endpoint class name>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -k, --keep Keep/Generate Java source");
+ out.println(" -w, --wsdl Enable WSDL file generation");
+ out.println(" -c. --classpath=<path> The classpath that contains the endpoint");
+ out.println(" -o, --output=<directory> The directory to put generated artifacts");
+ out.println(" -r, --resource=<directory> The directory to put resource artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java source");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -t, --show-traces Show full exception stack traces");
+ out.flush();
+ }
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsprovide.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractConsumerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractConsumerFactory.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractConsumerFactory.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.tools.spi;
+
+import org.jboss.wsf.spi.tools.api.WSContractConsumer;
+
+/**
+ * WSContractConsumerFactory defines the contract for a WSContractConsumer factory.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public interface WSContractConsumerFactory
+{
+ /**
+ * Create a new WSContractConsumer. There are no restrictions on how this
+ * should be performed.
+ *
+ * @return a new WSContractConsumer
+ */
+ public WSContractConsumer createConsumer();
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractConsumerFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractProviderFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractProviderFactory.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractProviderFactory.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.tools.spi;
+
+import org.jboss.wsf.spi.tools.api.WSContractProvider;
+
+/**
+ * WSContractProviderFactory defines the contract for a WSContractProvider factory.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public interface WSContractProviderFactory
+{
+ /**
+ * Create a new WSContractProvider. There are no restrictions on how this
+ * should be performed. The passed ClassLoader is the one used in
+ * {@link WSContractProvider#newInstance(ClassLoader)}. This loader
+ * should be made available to the generated WSContractProvider.
+ *
+ * @param loader the ClassLoader for type discovery
+ * @return a new WSContractProvider
+ */
+ public WSContractProvider createProvider(ClassLoader loader);
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/spi/WSContractProviderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl
===================================================================
--- trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl (rev 0)
+++ trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1 @@
+TODO:SUNRIConsumerFactoryImpl
\ No newline at end of file
Added: trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ProviderFactoryImpl
===================================================================
--- trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ProviderFactoryImpl (rev 0)
+++ trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ProviderFactoryImpl 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1 @@
+TODO:SUNRIProviderImpl
\ No newline at end of file
Modified: trunk/jbossws-core/ant-import/build-thirdparty.xml
===================================================================
--- trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-29 09:21:32 UTC (rev 3272)
@@ -91,6 +91,10 @@
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-api.jar" dest="${thirdparty.dir}/jaxb-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-impl.jar" dest="${thirdparty.dir}/jaxb-impl.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-xjc.jar" dest="${thirdparty.dir}/jaxb-xjc.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-rt.jar" dest="${thirdparty.dir}/jaxws-rt.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-tools.jar" dest="${thirdparty.dir}/jaxws-tools.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/stax-ex.jar" dest="${thirdparty.dir}/stax-ex.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/streambuffer.jar" dest="${thirdparty.dir}/streambuffer.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-servlet/${sun-servlet}/lib/servlet-api.jar" dest="${thirdparty.dir}/servlet-api.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/xmlunit-xmlunit/${xmlunit}/lib/xmlunit1.0.jar" dest="${thirdparty.dir}/xmlunit.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/wscommons-policy/${wscommons-policy}/lib/policy.jar" dest="${thirdparty.dir}/policy.jar" usetimestamp="true" verbose="true"/>
@@ -134,6 +138,8 @@
<pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
<pathelement location="${thirdparty.dir}/xalan.jar"/>
<pathelement location="${thirdparty.dir}/policy.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxws-tools.jar"/>
</path>
</target>
Modified: trunk/jbossws-core/ant-import-tests/build-testsuite.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-29 09:21:32 UTC (rev 3272)
@@ -31,7 +31,7 @@
<pathelement location="${core.dir}/output/lib/jboss-jaxws.jar"/>
<pathelement location="${core.dir}/output/lib/jboss-saaj.jar"/>
<pathelement location="${core.dir}/output/lib/jbossws-core.jar"/>
- <pathelement location="${core.dir}/output/lib/jbossws-client.jar"/>
+ <pathelement location="${core.dir}/output/lib/jbossws-client.jar"/>
</path>
<path id="tests.extra.classpath">
@@ -72,22 +72,30 @@
<target name="wsconsume" depends="tests-init" description="Consume JAX-WS contracts">
- <!-- Define the JAX-WS wsconsume task -->
- <taskdef name="wsconsume" classname="org.jboss.ws.tools.jaxws.ant.wsconsume">
- <classpath refid="ws.stack.classpath"/>
- <classpath location="${core.dir}/thirdparty/jbossws-wsconsume-impl.jar"/>
- <classpath location="${core.dir}/thirdparty/jaxb-xjc.jar"/>
- </taskdef>
+ <!-- Define the JAX-WS wsconsume task -->
+ <taskdef name="wsconsume" classname="org.jboss.wsf.spi.tools.ant.wsconsume">
+ <classpath refid="ws.stack.classpath"/>
+ <classpath location="${spi.dir}/output/lib/jbossws-spi.jar"/>
+
+ <classpath location="${core.dir}/thirdparty/jaxb-xjc.jar"/>
+ <classpath location="${core.dir}/thirdparty/jaxb-impl.jar"/>
+ <classpath location="${core.dir}/thirdparty/jaxws-rt.jar"/>
+ <classpath location="${core.dir}/thirdparty/jaxws-tools.jar"/>
+ <classpath location="${core.dir}/thirdparty/stax-api.jar"/>
+ <classpath location="${core.dir}/thirdparty/stax-ex.jar"/>
+ <classpath location="${core.dir}/thirdparty/streambuffer.jar"/>
+ <classpath location="${core.dir}/thirdparty/wstx.jar"/>
+ </taskdef>
<wsconsume wsdl="${tests.resources.dir}/benchmark/jaxws/doclit/WEB-INF/wsdl/BenchmarkWebService.wsdl" package="org.jboss.test.ws.benchmark.jaxws.doclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
- <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitB/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitb" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
- <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitW/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitw" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
- <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesRpcLit/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.baserpclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
- <wsconsume wsdl="${tests.resources.dir}/jaxws/complex/META-INF/wsdl/RegistrationService.wsdl" package="org.jboss.test.ws.jaxws.complex" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
- <wsconsume wsdl="${tests.resources.dir}/jaxws/holder/META-INF/wsdl/HolderService.wsdl" package="org.jboss.test.ws.jaxws.holder" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
- <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecuritypolicy" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
- <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
- <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurity/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurity" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
+ <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitB/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitb" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+ <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesDocLitW/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.basedoclitw" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+ <wsconsume wsdl="${tests.resources.dir}/interop/soapwsdl/BaseDataTypesRpcLit/WEB-INF/wsdl/service.wsdl" package="org.jboss.test.ws.interop.soapwsdl.baserpclit" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+ <wsconsume wsdl="${tests.resources.dir}/jaxws/complex/META-INF/wsdl/RegistrationService.wsdl" package="org.jboss.test.ws.jaxws.complex" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+ <wsconsume wsdl="${tests.resources.dir}/jaxws/holder/META-INF/wsdl/HolderService.wsdl" package="org.jboss.test.ws.jaxws.holder" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+ <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecuritypolicy/WEB-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecuritypolicy" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+ <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurityAnnotatedpolicy/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
+ <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurity/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurity" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true" verbose="false"/>
</target>
<!--
@@ -168,18 +176,19 @@
Generate JAX-WS sources
-->
<target name="wsprovide" depends="tests-compile" description="Provide the JAX-WS contracts.">
-
- <!-- Define the JAX-WS wsprovide task -->
- <taskdef name="wsprovide" classname="org.jboss.ws.tools.jaxws.ant.wsprovide">
- <classpath refid="ws.stack.classpath"/>
- <classpath refid="thirdparty.classpath"/>
- <classpath location="${core.dir}/thirdparty/concurrent.jar"/>
- <classpath location="${thirdparty.dir}/commons-logging.jar"/>
- <classpath location="${tests.output.dir}/classes"/>
- <classpath location="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy"/>
- </taskdef>
-
- <wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean"/>
+
+ <!-- Define the JAX-WS wsprovide task -->
+ <taskdef name="wsprovide" classname="org.jboss.wsf.spi.tools.ant.wsprovide">
+ <classpath refid="ws.stack.classpath"/>
+ <classpath refid="thirdparty.classpath"/>
+ <classpath location="${core.dir}/thirdparty/concurrent.jar"/>
+ <classpath location="${thirdparty.dir}/commons-logging.jar"/>
+ <classpath location="${tests.output.dir}/classes"/>
+ <classpath location="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy"/>
+ <classpath location="${core.dir}/output/lib/jbossws-integration-tools.jar"/>
+ </taskdef>
+
+ <wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean"/>
<wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurityAnnotatedpolicy" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurityAnnotatedpolicy.HelloJavaBean"/>
</target>
Modified: trunk/jbossws-core/build.xml
===================================================================
--- trunk/jbossws-core/build.xml 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/build.xml 2007-05-29 09:21:32 UTC (rev 3272)
@@ -152,7 +152,7 @@
<jar jarfile="${core.output.lib.dir}/jbossws-core.jar" manifest="${core.output.etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/annotation/**"/>
- <include name="org/jboss/ws/**"/>
+ <include name="org/jboss/ws/**"/>
</fileset>
<fileset dir="${core.resources.dir}">
<include name="schema/**"/>
@@ -175,7 +175,7 @@
<include name="standard-jaxws-client-config.xml"/>
</metainf>
</jar>
-
+
<!-- Build jbossws-resources.zip -->
<zip zipfile="${core.output.lib.dir}/jbossws-resources.zip" >
<fileset dir="${core.resources.dir}/standard-config">
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -29,10 +29,9 @@
import org.jboss.remoting.marshal.MarshalFactory;
import org.jboss.remoting.marshal.Marshaller;
import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.MessageTrace;
-import org.jboss.ws.core.StubExt;
-import org.jboss.ws.core.WSTimeoutException;
+import org.jboss.ws.core.*;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.metadata.config.EndpointProperty;
import javax.xml.rpc.Stub;
import javax.xml.soap.MimeHeader;
@@ -48,8 +47,13 @@
import java.util.Properties;
/**
- * SOAPConnection implementation
+ * SOAPConnection implementation.
+ * <p/>
*
+ * Per default HTTP 1.1 chunked encoding is used.
+ * This may be ovverriden through {@link org.jboss.ws.metadata.config.EndpointProperty#CHUNKED_ENCODING_SIZE}.
+ * A chunksize value of zero disables chunked encoding.
+ *
* @author Thomas.Diesler(a)jboss.org
* @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
*
@@ -96,6 +100,10 @@
// HTTPClientInvoker conect sends gratuitous POST
// http://jira.jboss.com/jira/browse/JBWS-711
clientConfig.put(Client.ENABLE_LEASE, false);
+
+ // Enable chunked encoding
+ // This is the default size. May be overridden through endpoint config
+ clientConfig.put("chunkedLength", "1024");
}
public boolean isClosed()
@@ -148,7 +156,10 @@
targetAddress = endpoint.toString();
}
- // setup remoting client
+ // remoting props may come from client config as well
+ mergeConfigContribution();
+
+ // setup remoting client
Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
Client client = createRemotingClient(endpoint, targetAddress, oneway);
@@ -195,6 +206,25 @@
}
}
+ private void mergeConfigContribution()
+ {
+ // check for config property contribution
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if(msgContext!=null)
+ {
+ Properties epmdProps = msgContext.getEndpointMetaData().getProperties();
+
+ // chunksize settings
+ String chunkSizeValue = epmdProps.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
+ int chunkSize = chunkSizeValue!=null ? Integer.valueOf(chunkSizeValue) : -1;
+ if(chunkSize>0)
+ clientConfig.put(EndpointProperty.CHUNKED_ENCODING_SIZE, chunkSizeValue);
+ else
+ clientConfig.remove("chunkedLength");
+
+ }
+ }
+
private String addURLParameter(String url, String key, String value)
{
int qmIndex = url.indexOf("?");
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -35,11 +35,7 @@
import javassist.NotFoundException;
import javassist.bytecode.ConstPool;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.*;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
@@ -112,7 +108,12 @@
for (WrappedParameter parameter : wrappedParameters)
{
- addProperty(clazz, parameter.getType(), parameter.getName(), parameter.getVariable(), parameter.getTypeArguments());
+ addProperty(
+ clazz, parameter.getType(),
+ parameter.getName(), parameter.getVariable(),
+ parameter.getTypeArguments(),
+ new boolean[] {parameter.isSwaRef(), parameter.isXop()}
+ );
}
clazz.stopPruning(!prune);
pool.toClass(clazz, loader);
@@ -146,7 +147,11 @@
addClassAnnotations(clazz, fmd.getXmlName(), fmd.getXmlType(), propertyOrder);
for (String property : propertyOrder)
- addProperty(clazz, properties.get(property).getName(), new QName(property), property, null);
+ addProperty(
+ clazz, properties.get(property).getName(),
+ new QName(property), property, null,
+ new boolean[] {false, false}
+ );
clazz.stopPruning(!prune);
pool.toClass(clazz, loader);
@@ -188,7 +193,9 @@
return "(" + type + ")V";
}
- private void addProperty(CtClass clazz, String typeName, QName name, String variable, String[] typeArguments)
+ private void addProperty(CtClass clazz, String typeName,
+ QName name, String variable, String[] typeArguments,
+ boolean[] attachments)
throws CannotCompileException, NotFoundException
{
ConstPool constPool = clazz.getClassFile().getConstPool();
@@ -210,6 +217,19 @@
annotation.addParameter("namespace", name.getNamespaceURI());
annotation.addParameter("name", name.getLocalPart());
annotation.markField(field);
+ // @XmlAttachmentRef
+ if(attachments[0])
+ {
+ annotation = JavassistUtils.createAnnotation(XmlAttachmentRef.class, constPool);
+ annotation.markField(field);
+ }
+ // @XmlMimeType
+ if(attachments[1])
+ {
+ annotation = JavassistUtils.createAnnotation(XmlMimeType.class, constPool);
+ annotation.addParameter("value", "application/octet-stream"); // TODO: default mime
+ annotation.markField(field);
+ }
clazz.addField(field);
// Add accessor methods
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -56,6 +56,7 @@
registerEntity("http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd", "j2ee_web_services_client_1_1.xsd");
registerEntity("http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd", "j2ee_web_services_1_1.xsd");
registerEntity("http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd", "j2ee_jaxrpc_mapping_1_1.xsd");
+ registerEntity("http://ws-i.org/profiles/basic/1.1/swaref.xsd", "schema/swaref.xsd");
}
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ws.extensions.xop.jaxws;
import javax.activation.DataHandler;
@@ -13,6 +34,21 @@
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.extensions.xop.XOPContext;
+/**
+ * Enable JAXB marshalling to optimize storage of binary data.<br>
+ * This API enables an efficient cooperative creation of optimized binary data formats between a JAXB marshalling process
+ * and a MIME-based package processor. A JAXB implementation marshals the root body of a MIME-based package,
+ * delegating the creation of referenceable MIME parts to the MIME-based package processor
+ * that implements this abstraction.<p>
+ * XOP processing is enabled when <code>isXOPPackage()</code> is true.
+ * See <code>addMtomAttachment(DataHandler, String, String)</code> for details.
+ * <p>
+ * WS-I Attachment Profile 1.0 is supported by <code>addSwaRefAttachment(DataHandler)</code>
+ * being called by the marshaller for each JAXB property related to {http://ws-i.org/profiles/basic/1.1/xsd}swaRef.
+ *
+ * @author <a href="heiko.braun(a)jboss.com">Heiko Braun</a>
+ * @version $Revision: 3220 $
+ */
public class AttachmentMarshallerImpl extends AttachmentMarshaller
{
// provide logging
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentScanResult.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentScanResult.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentScanResult.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -33,6 +33,9 @@
private String mimeType;
private Type type;
+ // distinguish return value and method parameters
+ private int index = -1;
+
public AttachmentScanResult(String mimeType, Type type)
{
this.mimeType = mimeType;
@@ -48,4 +51,25 @@
{
return type;
}
+
+ /**
+ * <code>
+ * <pre>
+ * -1 - return value
+ * 0 - 1st method parameter
+ * n - n'th method parameter
+ * </pre>
+ * </code>
+ *
+ * @return
+ */
+ public int getIndex()
+ {
+ return index;
+ }
+
+ public void setIndex(int index)
+ {
+ this.index = index;
+ }
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentUnmarshallerImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,20 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ws.extensions.xop.jaxws;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
+import org.jboss.ws.extensions.xop.XOPContext;
import javax.activation.DataHandler;
import javax.xml.bind.attachment.AttachmentUnmarshaller;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.SOAPException;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.extensions.xop.XOPContext;
-
+/**
+ * <p>Enables JAXB unmarshalling of a root document containing optimized binary data formats.</p>
+ *
+ * <p>This API enables an efficient cooperative processing of optimized
+ * binary data formats between a JAXB 2.0 implementation and MIME-based package
+ * processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the
+ * understanding of the packaging format being used to a MIME-based
+ * package processor that implements this abstract class.</p>
+ *
+ * <p>This abstract class identifies if a package requires XOP processing, <a href="../../../../javax/xml/bind/attachment/AttachmentUnmarshaller.html#isXOPPackage%28%29"><code>isXOPPackage()</code></a> and provides retrieval of binary content stored as attachments by content-id.</p>
+ *
+ * <h2>Identifying the content-id, cid, to pass to <code>getAttachment*(String cid)</code></h2>
+ * <ul>
+ * <li>
+ * For XOP processing, the infoset representation of the cid is described in step 2a in
+ * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#interpreting_xop_packages">Section 3.2 Interpreting XOP Packages</a>
+ * </li>
+ *
+ * <li>
+ * For WS-I AP 1.0, the cid is identified as an element or attribute of type <code>ref:swaRef </code> specified in
+ * <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Refer...">Section 4.4 Referencing Attachments from the SOAP Envelope</a>
+ * </li>
+ * </ul>
+ * <p>
+ */
public class AttachmentUnmarshallerImpl extends AttachmentUnmarshaller
{
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -21,33 +21,31 @@
*/
package org.jboss.ws.extensions.xop.jaxws;
-import java.awt.Image;
+import org.jboss.wsf.spi.utils.JavaUtils;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.transform.Source;
+import java.awt.*;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
-import javax.activation.DataHandler;
-import javax.xml.bind.annotation.XmlMimeType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlAttachmentRef;
-import javax.xml.transform.Source;
-
-import org.jboss.wsf.spi.utils.JavaUtils;
-
/**
- * Scans data types for MTOM and swaRef declarations.
+ * Scans java beans for MTOM and swaRef declarations.<br>
* It basically searches for
* <ul>
* <li><code>@XmlMimeType</code>
* <li><code>@XmlAttachmentRef</code>
* </ul>
- * and returns the appropriate mimetype.
+ * and returns the appropriate mimetype.<br>
* In order to re-use an instance of this class you need to invoke <code>reset()</code>
* in between scans.
*
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
* @since 04.12.2006
*
*/
@@ -73,10 +71,9 @@
* @param xmlRoot
* @return the first matching XmlMimeType#value() or <code>null</code> if none found
*/
- public AttachmentScanResult scan(Class xmlRoot)
+ public AttachmentScanResult scanBean(Class xmlRoot)
{
- if( isJDKType(xmlRoot) )
- return null;
+ if( isJDKType(xmlRoot) ) return null;
AttachmentScanResult result = null;
@@ -106,9 +103,7 @@
if(null == result) // try getter methods
{
- String mimeType = scanGetterAnnotation(xmlRoot, field);
- if(mimeType!=null)
- result = new AttachmentScanResult(mimeType, AttachmentScanResult.Type.XOP);
+ result = scanGetterAnnotation(xmlRoot, field);
}
// avoid recursive loops
@@ -117,7 +112,7 @@
// drill down if none found so far
if(null == result)
- result = scan(type);
+ result = scanBean(type);
}
@@ -126,6 +121,85 @@
return result;
}
+ public static List<AttachmentScanResult> scanMethod(Method method)
+ {
+ List<AttachmentScanResult> results = new ArrayList<AttachmentScanResult>();
+
+ // return type
+ if(method.getReturnType() != void.class)
+ {
+
+ AttachmentScanResult result = null;
+
+ if(method.isAnnotationPresent(XmlAttachmentRef.class))
+ {
+ result = new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
+ }
+ else if (method.isAnnotationPresent(XmlMimeType.class))
+ {
+ XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
+ result = new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
+ }
+
+ if(result!=null)
+ {
+ result.setIndex(-1); // default for return values
+ results.add(result);
+ }
+
+ }
+
+ // method parameter
+ int index = 0;
+ for (Annotation[] parameterAnnotations : method.getParameterAnnotations())
+ {
+ if (parameterAnnotations!=null)
+ {
+ for (Annotation annotation : parameterAnnotations)
+ {
+ AttachmentScanResult paramResult = null;
+
+ if(XmlAttachmentRef.class == annotation.annotationType())
+ {
+ paramResult = new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
+ }
+ else if(XmlMimeType.class == annotation.annotationType())
+ {
+ XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
+ paramResult = new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
+ }
+
+ if(paramResult!=null)
+ {
+ paramResult.setIndex(index);
+ index++;
+ results.add(paramResult);
+
+ }
+ }
+ }
+ }
+
+
+ return results;
+ }
+
+ public static AttachmentScanResult getResultByIndex(List<AttachmentScanResult> results, int index)
+ {
+ AttachmentScanResult result = null;
+
+ for(AttachmentScanResult asr : results)
+ {
+ if(asr.getIndex() == index)
+ {
+ result = asr;
+ break;
+ }
+ }
+
+ return result;
+ }
+
private boolean alreadyScanned(Field field)
{
@@ -155,19 +229,25 @@
private static boolean isJDKType(Class clazz)
{
- return clazz.getPackage()!= null ? clazz.getPackage().getName().startsWith("java") : true;
+ return clazz.getCanonicalName().startsWith("java") || clazz.isPrimitive();
}
- private static String scanGetterAnnotation(Class owner, Field field)
+ private static AttachmentScanResult scanGetterAnnotation(Class owner, Field field)
{
String getterMethodName = "get"+field.getName();
for(Method method : owner.getDeclaredMethods())
{
- if(method.getName().equalsIgnoreCase(getterMethodName)
- && method.isAnnotationPresent(XmlMimeType.class))
+ if(method.getName().equalsIgnoreCase(getterMethodName))
{
- XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
- return mimeTypeDecl.value();
+ if(method.isAnnotationPresent(XmlMimeType.class))
+ {
+ XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
+ return new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
+ }
+ else if(method.isAnnotationPresent(XmlAttachmentRef.class))
+ {
+ return new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
+ }
}
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -57,6 +57,7 @@
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;
+import org.jboss.ws.annotation.EndpointConfig;
/**
* A client side meta data builder.
@@ -277,6 +278,7 @@
processSOAPBinding(epMetaData, wsClass);
// process config, this will as well setup the handler
+ processEndpointConfig(epMetaData, wsClass);
epMetaData.initEndpointConfig();
// Process an optional @HandlerChain annotation
@@ -301,4 +303,18 @@
if(log.isDebugEnabled()) log.debug("END: rebuildMetaData\n" + epMetaData.getServiceMetaData());
}
+
+ /**
+ * Process config contribution through service endpoint interfaces
+ * @param epMetaData
+ * @param wsClass - the service endpoint interface
+ */
+ private void processEndpointConfig(EndpointMetaData epMetaData, Class<?> wsClass)
+ {
+ if (wsClass.isAnnotationPresent(EndpointConfig.class))
+ {
+ EndpointConfig anConfig = wsClass.getAnnotation(EndpointConfig.class);
+ epMetaData.setConfigName(anConfig.configName(), anConfig.configFile());
+ }
+ }
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -94,6 +94,9 @@
import com.sun.xml.bind.api.JAXBRIContext;
import com.sun.xml.bind.api.TypeReference;
+import org.jboss.ws.extensions.xop.jaxws.AttachmentScanResult;
+import org.jboss.ws.extensions.xop.jaxws.ReflectiveAttachmentRefScanner;
+
/**
* Abstract class that represents a JAX-WS metadata builder.
*
@@ -585,6 +588,9 @@
epMetaData.addOperation(opMetaData);
// Build parameter meta data
+ // Attachment annotations on SEI parameters
+ List<AttachmentScanResult> scanResult = ReflectiveAttachmentRefScanner.scanMethod(method);
+
Class[] parameterTypes = method.getParameterTypes();
Type[] genericTypes = method.getGenericParameterTypes();
Annotation[][] parameterAnnotations = method.getParameterAnnotations();
@@ -652,6 +658,8 @@
wrappedParameter = new WrappedParameter(wrappedParameter);
wrappedOutputParameters.add(wrappedParameter);
}
+
+ processAttachmentAnnotationsWrapped(scanResult, i, wrappedParameter);
}
else
{
@@ -681,6 +689,7 @@
javaTypes.add(javaType);
typeRefs.add(new TypeReference(xmlName, genericType, parameterAnnotations[i]));
+ processAttachmentAnnotations(scanResult, i, paramMetaData);
processMIMEBinding(epMetaData, opMetaData, paramMetaData);
}
}
@@ -706,6 +715,8 @@
// insert at the beginning just for prettiness
wrappedOutputParameters.add(0, wrapped);
+
+ processAttachmentAnnotationsWrapped(scanResult, -1, wrapped);
}
else
{
@@ -738,6 +749,7 @@
javaTypes.add(returnType);
typeRefs.add(new TypeReference(xmlName, genericReturnType, method.getAnnotations()));
+ processAttachmentAnnotations(scanResult, -1, retMetaData);
processMIMEBinding(epMetaData, opMetaData, retMetaData);
}
}
@@ -775,6 +787,42 @@
processMetaExtensions(method, epMetaData, opMetaData);
}
+ /**
+ * @see org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder#processAttachmentAnnotations(java.util.List, int, org.jboss.ws.metadata.umdm.ParameterMetaData)
+ * @param scanResult
+ * @param i
+ * @param wrappedParameter
+ */
+ private void processAttachmentAnnotationsWrapped(List<AttachmentScanResult> scanResult, int i, WrappedParameter wrappedParameter)
+ {
+ AttachmentScanResult asr = ReflectiveAttachmentRefScanner.getResultByIndex(scanResult, i);
+ if(asr!=null)
+ {
+ if(AttachmentScanResult.Type.SWA_REF == asr.getType())
+ wrappedParameter.setSwaRef(true);
+ else
+ wrappedParameter.setXOP(true);
+ }
+ }
+
+ /**
+ * Update PMD according to attachment annotations that might be in place
+ * @param scanResult
+ * @param i
+ * @param parameter
+ */
+ private void processAttachmentAnnotations(List<AttachmentScanResult> scanResult, int i, ParameterMetaData parameter)
+ {
+ AttachmentScanResult asr = ReflectiveAttachmentRefScanner.getResultByIndex(scanResult, i);
+ if(asr!=null)
+ {
+ if(AttachmentScanResult.Type.SWA_REF == asr.getType())
+ parameter.setSwaRef(true);
+ else
+ parameter.setXOP(true);
+ }
+ }
+
private void processMIMEBinding(EndpointMetaData epMetaData, OperationMetaData opMetaData, ParameterMetaData paramMetaData)
{
// process SWA metadata
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -52,7 +52,7 @@
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
import org.jboss.ws.tools.ToolsUtils;
-import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
+import org.jboss.ws.tools.wsdl.JAXBWSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.wsdl.WSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLWriter;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -32,7 +32,12 @@
{
public final static String MTOM_THRESHOLD = "http://org.jboss.ws/mtom#threshold";
+ /**
+ * Set to 0 in order to disable chunked encoding
+ */
+ public final static String CHUNKED_ENCODING_SIZE = "http://org.jboss.ws/http#chunksize";
+
public URI name;
public String value;
-}
\ No newline at end of file
+}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -489,7 +489,7 @@
if (epType == Type.JAXWS)
{
ReflectiveAttachmentRefScanner scanner = new ReflectiveAttachmentRefScanner();
- AttachmentScanResult scanResult = scanner.scan(javaType);
+ AttachmentScanResult scanResult = scanner.scanBean(javaType);
if (scanResult != null)
{
if(log.isDebugEnabled()) log.debug("Identified attachment reference: " + xmlName + ", type="+scanResult.getType());
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -41,6 +41,8 @@
private boolean holder = false;
private int index = -2;
private Accessor accessor;
+ private boolean swaRef;
+ private boolean xop;
public WrappedParameter(WrappedParameter wrapped)
{
@@ -131,9 +133,29 @@
this.accessor = accessor;
}
+ public boolean isSwaRef()
+ {
+ return swaRef;
+ }
+
+ public void setSwaRef(boolean swaRef)
+ {
+ this.swaRef = swaRef;
+ }
+
+ public boolean isXop()
+ {
+ return xop;
+ }
+
+ public void setXOP(boolean xop)
+ {
+ this.xop = xop;
+ }
+
public String toString()
{
return "[name = " + getName() + ", type = " + getType() + ", typeArgs = " + JavaUtils.printArray(getTypeArguments()) + ", variable = " + getVariable()
+ ", index = " + getIndex() + "]";
}
-}
\ No newline at end of file
+}
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,113 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.tools.jaxws;
-
-import java.io.IOException;
-
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.Result;
-import javax.xml.transform.dom.DOMResult;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.extensions.security.Util;
-import org.jboss.ws.metadata.wsdl.DOMTypes;
-import org.jboss.ws.tools.wsdl.WSDLGenerator;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import com.sun.xml.bind.api.JAXBRIContext;
-
-/**
- * JAXBWSDLGenerator provides a JAXB based WSDLGenerator.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- */
-public class JAXBWSDLGenerator extends WSDLGenerator
-{
- private JAXBRIContext ctx;
-
- public JAXBWSDLGenerator(JAXBRIContext ctx)
- {
- super();
- this.ctx = ctx;
- }
-
- protected void processTypes()
- {
- // Register namespaces
- for (String ns : ctx.getKnownNamespaceURIs())
- if (ns.length() > 0)
- wsdl.registerNamespaceURI(ns, null);
-
- try
- {
- DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- Document doc = builder.newDocument();
- DOMTypes types = new DOMTypes(doc);
- final Element element = types.getElement();
- final Element throwAway = doc.createElement("throw-away");
-
- ctx.generateSchema(new SchemaOutputResolver()
- {
- @Override
- public Result createOutput(String namespace, String file) throws IOException
- {
- // JBWS-1295, getKnownNamespaceURIs is not accurate
- if (namespace.length() > 0 && wsdl.getPrefix(namespace) == null)
- wsdl.registerNamespaceURI(namespace, null);
-
- // JAXB creates an empty namespace due to type references, ignore it
- DOMResult result = new DOMResult((namespace == null || namespace.length() == 0) ? throwAway : element);
- result.setSystemId("replace-me");
- return result;
- }
- });
-
- // Until we stop inlining schema, we will need to filter schemaLocations since JAXB requires them
- removeSchemaLocations(element);
-
- wsdl.setWsdlTypes(types);
- }
- catch (Exception exception)
- {
- throw new WSException("Could not generate schema: " + exception.getMessage(), exception);
- }
- }
-
- private void removeSchemaLocations(Element element)
- {
- for (Element child = Util.getFirstChildElement(element); child != null; child = Util.getNextSiblingElement(child))
- {
- if ("import".equals(child.getLocalName()) && Constants.NS_SCHEMA_XSD.equals(child.getNamespaceURI()) && "replace-me".equals(child.getAttribute("schemaLocation")))
- {
- child.removeAttribute("schemaLocation");
- }
- else
- {
- removeSchemaLocations(child);
- }
- }
- }
-}
\ No newline at end of file
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/BytecodeWrapperGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/BytecodeWrapperGenerator.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/BytecodeWrapperGenerator.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javassist.CannotCompileException;
-import javassist.NotFoundException;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-
-public class BytecodeWrapperGenerator extends DynamicWrapperGenerator implements WritableWrapperGenerator
-{
- private List<String> typeNames = new ArrayList<String>();
- PrintStream stream;
-
- public BytecodeWrapperGenerator(ClassLoader loader, PrintStream stream)
- {
- super(loader);
- this.stream = stream;
- prune = false;
- }
-
- @Override
- public void reset(ClassLoader loader)
- {
- super.reset(loader);
- typeNames.clear();
- }
-
- @Override
- public void generate(FaultMetaData fmd)
- {
- super.generate(fmd);
-
- typeNames.add(fmd.getFaultBeanName());
- }
-
- @Override
- public void generate(ParameterMetaData pmd)
- {
- super.generate(pmd);
-
- typeNames.add(pmd.getJavaTypeName());
- }
-
- public void write(File directory) throws IOException
- {
- stream.println("Writing Classes:");
- for (String name : typeNames)
- {
- try
- {
- stream.println(name.replace('.', '/') + ".class");
- pool.get(name).writeFile(directory.getAbsolutePath());
- }
- catch (CannotCompileException e)
- {
- throw new WSException(e);
- }
- catch (NotFoundException e)
- {
- throw new WSException(e);
- }
- }
- }
-}
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/ChainedWritableWrapperGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/ChainedWritableWrapperGenerator.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/ChainedWritableWrapperGenerator.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.core.jaxws.WrapperGenerator;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-
-public class ChainedWritableWrapperGenerator implements WrapperGenerator
-{
- private List<Entry> chain = new ArrayList<Entry>();
-
- static class Entry
- {
- Entry(WritableWrapperGenerator generator, File directory)
- {
- this.generator = generator;
- this.directory = directory;
- }
-
- WritableWrapperGenerator generator;
- File directory;
- }
-
- public ChainedWritableWrapperGenerator()
- {
- }
-
- public void reset(ClassLoader loader)
- {
- for (Entry entry : chain)
- entry.generator.reset(loader);
- }
-
- public void write() throws IOException
- {
- for (Entry entry : chain)
- entry.generator.write(entry.directory);
- }
-
- public void generate(FaultMetaData fmd)
- {
- for (Entry entry : chain)
- entry.generator.generate(fmd);
- }
-
- public void generate(ParameterMetaData pmd)
- {
- for (Entry entry : chain)
- entry.generator.generate(pmd);
- }
-
- public void add(WritableWrapperGenerator generator, File directory)
- {
- chain.add(new Entry(generator, directory));
- }
-}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderFactoryImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderFactoryImpl.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderFactoryImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.jaxws.impl;
+
+import org.jboss.wsf.spi.tools.api.WSContractProvider;
+import org.jboss.wsf.spi.tools.spi.WSContractProviderFactory;
+
+/**
+ * Creates a JBossWS WSContractProvider implementation.
+ * @see org.jboss.ws.tools.jaxws.impl.JBossWSProviderImpl
+ */
+public class JBossWSProviderFactoryImpl implements WSContractProviderFactory
+{
+ public WSContractProvider createProvider(ClassLoader loader)
+ {
+ JBossWSProviderImpl impl = new JBossWSProviderImpl();
+ impl.setClassLoader(loader);
+ return impl;
+ }
+}
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,182 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.tools.jaxws.impl;
+
+import org.jboss.ws.WSException;
+import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
+import org.jboss.wsf.spi.deployment.BasicDeployment;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import static org.jboss.wsf.spi.deployment.Deployment.DeploymentType.JAXWS_EJB3;
+import static org.jboss.wsf.spi.deployment.Deployment.DeploymentType.JAXWS_JSE;
+import org.jboss.ws.integration.ResourceLoaderAdapter;
+import org.jboss.wsf.spi.tools.api.WSContractProvider;
+import org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+import javax.ejb.Stateless;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+/**
+ * The default WSContractProvider implementation.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+final class JBossWSProviderImpl extends WSContractProvider
+{
+ private ClassLoader loader;
+ private boolean generateWsdl = false;
+ private boolean generateSource = false;
+ private File outputDir = new File("output");
+ private File resourceDir = null;
+ private File sourceDir = null;
+ private PrintStream messageStream = new NullPrintStream();
+
+ private void createDirectories(File resourceDir, File sourceDir)
+ {
+ if (!outputDir.exists())
+ if (!outputDir.mkdirs())
+ throw new WSException("Could not create directory: " + outputDir);
+
+ if (generateWsdl && !resourceDir.exists())
+ if (!resourceDir.mkdirs())
+ throw new WSException("Could not create directory: " + resourceDir);
+
+ if (generateSource && !sourceDir.exists())
+ if (!sourceDir.mkdirs())
+ throw new WSException("Could not create directory: " + sourceDir);
+ }
+
+ private UnifiedDeploymentInfo createUDI(Class<?> endpointClass, ClassLoader loader)
+ {
+ DeploymentType type = (endpointClass.isAnnotationPresent(Stateless.class)) ? JAXWS_EJB3 : JAXWS_JSE;
+ UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo(type)
+ {
+ @Override
+ public URL getMetaDataFileURL(String resourcePath) throws IOException
+ {
+ return null;
+ }
+ };
+ udi.classLoader = loader;
+ return udi;
+ }
+
+ @Override
+ public void provide(Class<?> endpointClass)
+ {
+ // Use the output directory as the default
+ File resourceDir = (this.resourceDir != null) ? this.resourceDir : outputDir;
+ File sourceDir = (this.sourceDir != null) ? this.sourceDir : outputDir;
+
+ createDirectories(resourceDir, sourceDir);
+
+ // Create a dummy classloader to catch generated classes
+ ClassLoader loader = new URLClassLoader(new URL[0], this.loader);
+ UnifiedMetaData umd = new UnifiedMetaData(new ResourceLoaderAdapter(loader));
+ umd.setClassLoader(loader);
+
+ ChainedWritableWrapperGenerator generator = new ChainedWritableWrapperGenerator();
+ if (generateSource)
+ generator.add(new SourceWrapperGenerator(loader, messageStream), sourceDir);
+ generator.add(new BytecodeWrapperGenerator(loader, messageStream), outputDir);
+
+ JAXWSWebServiceMetaDataBuilder builder = new JAXWSWebServiceMetaDataBuilder();
+ builder.setWrapperGenerator(generator);
+ builder.setGenerateWsdl(generateWsdl);
+ builder.setToolMode(true);
+ builder.setWsdlDirectory(resourceDir);
+ builder.setMessageStream(messageStream);
+
+ if (generateWsdl)
+ messageStream.println("Generating WSDL:");
+
+ UnifiedDeploymentInfo udi = createUDI(endpointClass, loader);
+ builder.buildWebServiceMetaData(new BasicDeployment(), umd, udi, endpointClass, null);
+ try
+ {
+ generator.write();
+ }
+ catch (IOException io)
+ {
+ throw new WSException("Could not write output files:", io);
+ }
+ }
+
+ @Override
+ public void provide(String endpointClass)
+ {
+ try
+ {
+ provide(loader.loadClass(endpointClass));
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new WSException("Class not found: " + endpointClass);
+ }
+ }
+
+ @Override
+ public void setClassLoader(ClassLoader loader)
+ {
+ this.loader = loader;
+ }
+
+ @Override
+ public void setGenerateWsdl(boolean generateWsdl)
+ {
+ this.generateWsdl = generateWsdl;
+ }
+
+ @Override
+ public void setOutputDirectory(File directory)
+ {
+ outputDir = directory;
+ }
+
+ @Override
+ public void setGenerateSource(boolean generateSource)
+ {
+ this.generateSource = generateSource;
+ }
+
+ @Override
+ public void setResourceDirectory(File directory)
+ {
+ resourceDir = directory;
+ }
+
+ @Override
+ public void setSourceDirectory(File directory)
+ {
+ sourceDir = directory;
+ }
+
+ @Override
+ public void setMessageStream(PrintStream messageStream)
+ {
+ this.messageStream = messageStream;
+ }
+}
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/NullPrintStream.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/NullPrintStream.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/NullPrintStream.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,209 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.tools.jaxws.impl;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.Locale;
-
-class NullPrintStream extends PrintStream
-{
- NullPrintStream()
- {
- // Doesn't actually do anything
- super(new ByteArrayOutputStream());
- }
-
- @Override
- public PrintStream append(char c)
- {
- return this;
- }
-
- @Override
- public PrintStream append(CharSequence csq, int start, int end)
- {
- return this;
- }
-
- @Override
- public PrintStream append(CharSequence csq)
- {
- return this;
- }
-
- @Override
- public boolean checkError()
- {
- return false;
- }
-
- @Override
- public void close()
- {
- }
-
- @Override
- public void flush()
- {
- }
-
- @Override
- public PrintStream format(Locale l, String format, Object... args)
- {
- return this;
- }
-
- @Override
- public PrintStream format(String format, Object... args)
- {
- return this;
- }
-
- @Override
- public void print(boolean b)
- {
- }
-
- @Override
- public void print(char c)
- {
- }
-
- @Override
- public void print(char[] s)
- {
- }
-
- @Override
- public void print(double d)
- {
- }
-
- @Override
- public void print(float f)
- {
- }
-
- @Override
- public void print(int i)
- {
- }
-
- @Override
- public void print(long l)
- {
- }
-
- @Override
- public void print(Object obj)
- {
- }
-
- @Override
- public void print(String s)
- {
- }
-
- @Override
- public PrintStream printf(Locale l, String format, Object... args)
- {
- return this;
- }
-
- @Override
- public PrintStream printf(String format, Object... args)
- {
- return this;
- }
-
- @Override
- public void println()
- {
- }
-
- @Override
- public void println(boolean x)
- {
- }
-
- @Override
- public void println(char x)
- {
- }
-
- @Override
- public void println(char[] x)
- {
- }
-
- @Override
- public void println(double x)
- {
- }
-
- @Override
- public void println(float x)
- {
- }
-
- @Override
- public void println(int x)
- {
- }
-
- @Override
- public void println(long x)
- {
- }
-
- @Override
- public void println(Object x)
- {
- }
-
- @Override
- public void println(String x)
- {
- }
-
- @Override
- protected void setError()
- {
- }
-
- @Override
- public void write(byte[] buf, int off, int len)
- {
- }
-
- @Override
- public void write(int b)
- {
- }
-
- @Override
- public void write(byte[] b) throws IOException
- {
- }
-}
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,184 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.List;
-import java.util.SortedMap;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.AbstractWrapperGenerator;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-import org.jboss.wsf.spi.utils.JavaUtils;
-
-import com.sun.codemodel.JAnnotationArrayMember;
-import com.sun.codemodel.JAnnotationUse;
-import com.sun.codemodel.JCodeModel;
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JExpr;
-import com.sun.codemodel.JFieldVar;
-import com.sun.codemodel.JMethod;
-import com.sun.codemodel.JMod;
-
-/**
- * Generates source for wrapper beans
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class SourceWrapperGenerator extends AbstractWrapperGenerator implements WritableWrapperGenerator
-{
- private static Logger log = Logger.getLogger(SourceWrapperGenerator.class);
- private PrintStream stream;
- private JCodeModel codeModel;
-
-
- public SourceWrapperGenerator(ClassLoader loader, PrintStream stream)
- {
- super(loader);
- this.stream = stream;
- codeModel = new JCodeModel();
- }
-
- @Override
- public void reset(ClassLoader loader)
- {
- super.reset(loader);
- codeModel = new JCodeModel();
- }
-
- public void write(File directory) throws IOException
- {
- stream.println("Writing Source:");
- codeModel.build(directory, stream);
- }
-
- public void generate(ParameterMetaData pmd)
- {
- List<WrappedParameter> wrappedParameters = pmd.getWrappedParameters();
- OperationMetaData operationMetaData = pmd.getOperationMetaData();
-
- if (operationMetaData.isDocumentWrapped() == false)
- throw new WSException("Operation is not document/literal (wrapped)");
-
- if (wrappedParameters == null)
- throw new WSException("Cannot generate a type when their is no type information");
-
- String wrapperName = pmd.getJavaTypeName();
- if (log.isDebugEnabled())
- if(log.isDebugEnabled()) log.debug("Generating wrapper: " + wrapperName);
-
- try
- {
-
- JDefinedClass clazz = codeModel._class(wrapperName);
- addClassAnnotations(clazz, pmd.getXmlName(), pmd.getXmlType(), null);
- for (WrappedParameter wrapped : wrappedParameters)
- {
- addProperty(clazz, wrapped.getType(), wrapped.getName(), wrapped.getVariable());
- }
- }
- catch (Exception e)
- {
- throw new WSException("Could not generate wrapper type: " + wrapperName, e);
- }
- }
- public void generate(FaultMetaData fmd)
- {
- String faultBeanName = fmd.getFaultBeanName();
- Class exception = fmd.getJavaType();
-
- try
- {
- SortedMap<String, Class<?>> properties = getExceptionProperties(exception);
- String[] propertyOrder = properties.keySet().toArray(new String[0]);
-
- JDefinedClass clazz = codeModel._class(faultBeanName);
- addClassAnnotations(clazz, fmd.getXmlName(), fmd.getXmlType(), propertyOrder);
-
- for (String property : propertyOrder)
- addProperty(clazz, properties.get(property).getName(), new QName(property), property);
- }
- catch (Exception e)
- {
- throw new WSException("Could not generate wrapper type: " + faultBeanName, e);
- }
- }
-
- private static String getterPrefix(Class type)
- {
- return Boolean.TYPE == type || Boolean.class == type ? "is" : "get";
- }
-
- private void addProperty(JDefinedClass clazz, String typeName, QName name, String variable)
- throws ClassNotFoundException
- {
- Class type = JavaUtils.loadJavaType(typeName, loader);
- JFieldVar field = clazz.field(JMod.PRIVATE, type, variable);
- JAnnotationUse annotation = field.annotate(XmlElement.class);
- if (name.getNamespaceURI() != null)
- annotation.param("namespace", name.getNamespaceURI());
- annotation.param("name", name.getLocalPart());
-
- // Add acessor methods
- JMethod method = clazz.method(JMod.PUBLIC, type, getterPrefix(type) + JavaUtils.capitalize(variable));
- method.body()._return(JExpr._this().ref(variable));
-
- method = clazz.method(JMod.PUBLIC, type, "set" + JavaUtils.capitalize(variable));
- method.body().assign(JExpr._this().ref(variable), method.param(type, variable));
- }
-
- private static void addClassAnnotations(JDefinedClass clazz, QName xmlName, QName xmlType, String[] propertyOrder)
- {
- JAnnotationUse annotation = clazz.annotate(XmlRootElement.class);
- if (xmlName.getNamespaceURI() != null && xmlName.getNamespaceURI().length() > 0)
- annotation.param("namespace", xmlName.getNamespaceURI());
- annotation.param("name", xmlName.getLocalPart());
-
- annotation = clazz.annotate(XmlType.class);
- if (xmlType.getNamespaceURI() != null & xmlType.getNamespaceURI().length() > 0)
- annotation.param("namespace", xmlType.getNamespaceURI());
- annotation.param("name", xmlType.getLocalPart());
- if (propertyOrder != null)
- {
- JAnnotationArrayMember paramArray = annotation.paramArray("propOrder");
- for (String property : propertyOrder)
- paramArray.param(property);
- }
-
- annotation = clazz.annotate(XmlAccessorType.class);
- annotation.param("value", XmlAccessType.FIELD);
- }
-}
\ No newline at end of file
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerFactoryImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerFactoryImpl.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerFactoryImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.tools.jaxws.impl;
+
+import org.jboss.wsf.spi.tools.api.WSContractConsumer;
+import org.jboss.wsf.spi.tools.spi.WSContractConsumerFactory;
+
+/**
+ * Creates a WSContractConsumer that delegates to the Sun RI.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision:2311 $
+ */
+public class SunRIConsumerFactoryImpl implements WSContractConsumerFactory
+{
+ public WSContractConsumer createConsumer() {
+ return new SunRIConsumerImpl();
+ }
+}
+
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,169 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.tools.jaxws.impl;
+
+import com.sun.tools.ws.wscompile.WsimportTool;
+import org.jboss.wsf.spi.tools.api.WSContractConsumer;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * WSContractConsumer that delegates to the Sun CompileTool.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @author <a href="heiko.braun(a)jboss.com">Heiko Braun</a>
+ * @version $Revision$
+ */
+public class SunRIConsumerImpl extends WSContractConsumer
+{
+ private List<File> bindingFiles = null;
+ private File catalog = null;
+ private boolean generateSource = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+ private String targetPackage = null;
+ private PrintStream messageStream = null;
+ private String wsdlLocation = null;
+ private List<String> additionalCompilerClassPath = null;
+
+ @Override
+ public void setBindingFiles(List<File> bindingFiles) {
+ this.bindingFiles = bindingFiles;
+ }
+
+ @Override
+ public void setCatalog(File catalog) {
+ this.catalog = catalog;
+ }
+
+ @Override
+ public void setGenerateSource(boolean generateSource) {
+ this.generateSource = generateSource;
+ }
+
+ @Override
+ public void setMessageStream(PrintStream messageStream) {
+ // TODO Auto-generated method stub
+ this.messageStream = messageStream;
+ }
+
+ @Override
+ public void setOutputDirectory(File directory) {
+ // TODO Auto-generated method stub
+ outputDir = directory;
+ }
+
+ @Override
+ public void setSourceDirectory(File directory) {
+ sourceDir = directory;
+ }
+
+ @Override
+ public void setTargetPackage(String targetPackage) {
+ this.targetPackage = targetPackage;
+ }
+
+ @Override
+ public void setWsdlLocation(String wsdlLocation) {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void setAdditionalCompilerClassPath(List<String> additionalCompilerClassPath) {
+ this.additionalCompilerClassPath = additionalCompilerClassPath;
+ }
+
+ @Override
+ public void consume(URL wsdl) {
+ List<String> args = new ArrayList<String>();
+ if (bindingFiles != null) {
+ for (File file : bindingFiles) {
+ args.add("-b");
+ args.add(file.getAbsolutePath());
+
+ }
+ }
+
+ if (catalog != null) {
+ args.add("-catalog");
+ args.add(catalog.getAbsolutePath());
+ }
+
+ if (generateSource) {
+ args.add("-keep");
+ if (sourceDir != null) {
+ if (!sourceDir.exists() && !sourceDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + sourceDir.getName());
+
+ args.add("-s");
+ args.add(sourceDir.getAbsolutePath());
+ }
+ }
+
+ if (targetPackage != null) {
+ args.add("-p");
+ args.add(targetPackage);
+ }
+
+ if (wsdlLocation != null) {
+ args.add("-wsdllocation");
+ args.add(wsdlLocation);
+ }
+
+ PrintStream stream = messageStream;
+ if (stream != null) {
+ args.add("-verbose");
+ } else {
+ stream = new NullPrintStream();
+ }
+
+ if (!outputDir.exists() && !outputDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + outputDir.getName());
+
+ // Always add the output directory and the wsdl location
+ args.add("-d");
+ args.add(outputDir.getAbsolutePath());
+ args.add(wsdl.toString());
+
+ try
+ {
+ // enforce woodstox
+ if(null == System.getProperty("javax.xml.stream.XMLInputFactory"))
+ System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
+
+ WsimportTool compileTool = new WsimportTool(stream);
+ boolean success = compileTool.run(args.toArray(new String[0]));
+
+ if(!success) throw new IllegalStateException("WsImport invocation failed");
+ }
+ catch (Throwable t)
+ {
+ messageStream.println("Failed to invoke WsImport");
+ t.printStackTrace(messageStream);
+ }
+
+ }
+}
+
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderFactoryImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderFactoryImpl.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderFactoryImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.tools.jaxws.impl;
-
-import org.jboss.ws.tools.jaxws.api.WSContractProvider;
-import org.jboss.ws.tools.jaxws.spi.WSContractProviderFactory;
-
-public class WSContractProviderFactoryImpl implements WSContractProviderFactory
-{
- public WSContractProvider createProvider(ClassLoader loader)
- {
- WSContractProviderImpl impl = new WSContractProviderImpl();
- impl.setClassLoader(loader);
- return impl;
- }
-}
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderImpl.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WSContractProviderImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,190 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-
-import javax.ejb.Stateless;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.tools.jaxws.api.WSContractProvider;
-import org.jboss.ws.integration.ResourceLoaderAdapter;
-import org.jboss.wsf.spi.deployment.BasicDeployment;
-import org.jboss.wsf.spi.deployment.BasicEndpoint;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-
-/**
- * The provided implementation of a WSContractProvider.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- */
-final class WSContractProviderImpl extends WSContractProvider
-{
- private ClassLoader loader;
- private boolean generateWsdl = false;
- private boolean generateSource = false;
- private File outputDir = new File("output");
- private File resourceDir = null;
- private File sourceDir = null;
- private PrintStream messageStream = new NullPrintStream();
-
- private void createDirectories(File resourceDir, File sourceDir)
- {
- if (!outputDir.exists())
- if (!outputDir.mkdirs())
- throw new WSException("Could not create directory: " + outputDir);
-
- if (generateWsdl && !resourceDir.exists())
- if (!resourceDir.mkdirs())
- throw new WSException("Could not create directory: " + resourceDir);
-
- if (generateSource && !sourceDir.exists())
- if (!sourceDir.mkdirs())
- throw new WSException("Could not create directory: " + sourceDir);
- }
-
- private UnifiedDeploymentInfo createUDI(Class<?> endpointClass, ClassLoader loader)
- {
- DeploymentType type = (endpointClass.isAnnotationPresent(Stateless.class)) ? DeploymentType.JAXWS_EJB3 : DeploymentType.JAXWS_JSE;
- UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo(type)
- {
- @Override
- public URL getMetaDataFileURL(String resourcePath) throws IOException
- {
- return null;
- }
- };
- udi.classLoader = loader;
- return udi;
- }
-
- @Override
- public void provide(Class<?> endpointClass)
- {
- // Use the output directory as the default
- File resourceDir = (this.resourceDir != null) ? this.resourceDir : outputDir;
- File sourceDir = (this.sourceDir != null) ? this.sourceDir : outputDir;
-
- createDirectories(resourceDir, sourceDir);
-
- // Create a dummy classloader to catch generated classes
- ClassLoader loader = new URLClassLoader(new URL[0], this.loader);
- UnifiedMetaData umd = new UnifiedMetaData(new ResourceLoaderAdapter(loader));
- umd.setClassLoader(loader);
-
- ChainedWritableWrapperGenerator generator = new ChainedWritableWrapperGenerator();
- if (generateSource)
- generator.add(new SourceWrapperGenerator(loader, messageStream), sourceDir);
- generator.add(new BytecodeWrapperGenerator(loader, messageStream), outputDir);
-
- JAXWSWebServiceMetaDataBuilder builder = new JAXWSWebServiceMetaDataBuilder();
- builder.setWrapperGenerator(generator);
- builder.setGenerateWsdl(generateWsdl);
- builder.setToolMode(true);
- builder.setWsdlDirectory(resourceDir);
- builder.setMessageStream(messageStream);
-
- if (generateWsdl)
- messageStream.println("Generating WSDL:");
-
- UnifiedDeploymentInfo udi = createUDI(endpointClass, loader);
-
- Deployment dep = new BasicDeployment();
- dep.getContext().addAttachment(UnifiedDeploymentInfo.class, udi);
- BasicEndpoint ep = new BasicEndpoint();
- ep.setTargetBean(endpointClass.getName());
- dep.getService().addEndpoint(ep);
-
- builder.buildWebServiceMetaData(dep, umd, udi, endpointClass, null);
- try
- {
- generator.write();
- }
- catch (IOException io)
- {
- throw new WSException("Could not write output files:", io);
- }
- }
-
- @Override
- public void provide(String endpointClass)
- {
- try
- {
- provide(loader.loadClass(endpointClass));
- }
- catch (ClassNotFoundException e)
- {
- throw new WSException("Class not found: " + endpointClass);
- }
- }
-
- @Override
- public void setClassLoader(ClassLoader loader)
- {
- this.loader = loader;
- }
-
- @Override
- public void setGenerateWsdl(boolean generateWsdl)
- {
- this.generateWsdl = generateWsdl;
- }
-
- @Override
- public void setOutputDirectory(File directory)
- {
- outputDir = directory;
- }
-
- @Override
- public void setGenerateSource(boolean generateSource)
- {
- this.generateSource = generateSource;
- }
-
- @Override
- public void setResourceDirectory(File directory)
- {
- resourceDir = directory;
- }
-
- @Override
- public void setSourceDirectory(File directory)
- {
- sourceDir = directory;
- }
-
- @Override
- public void setMessageStream(PrintStream messageStream)
- {
- this.messageStream = messageStream;
- }
-}
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WritableWrapperGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WritableWrapperGenerator.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/WritableWrapperGenerator.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.tools.jaxws.impl;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.jboss.ws.core.jaxws.WrapperGenerator;
-
-public interface WritableWrapperGenerator extends WrapperGenerator
-{
- public void write(File directory) throws IOException;
-}
\ No newline at end of file
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,113 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.tools.wsdl;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.metadata.wsdl.DOMTypes;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.bind.SchemaOutputResolver;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.dom.DOMResult;
+import java.io.IOException;
+
+/**
+ * JAXBWSDLGenerator provides a JAXB based WSDLGenerator.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ */
+public class JAXBWSDLGenerator extends WSDLGenerator
+{
+ private JAXBRIContext ctx;
+
+ public JAXBWSDLGenerator(JAXBRIContext ctx)
+ {
+ super();
+ this.ctx = ctx;
+ }
+
+ /**
+ * Delegate schema generation to JAXB RI
+ */
+ protected void processTypes()
+ {
+ // Register namespaces
+ for (String ns : ctx.getKnownNamespaceURIs())
+ if (ns.length() > 0)
+ wsdl.registerNamespaceURI(ns, null);
+
+ try
+ {
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document doc = builder.newDocument();
+ DOMTypes types = new DOMTypes(doc);
+ final Element element = types.getElement();
+ final Element throwAway = doc.createElement("throw-away");
+
+ ctx.generateSchema(new SchemaOutputResolver()
+ {
+ @Override
+ public Result createOutput(String namespace, String file) throws IOException
+ {
+ // JBWS-1295, getKnownNamespaceURIs is not accurate
+ if (namespace.length() > 0 && wsdl.getPrefix(namespace) == null)
+ wsdl.registerNamespaceURI(namespace, null);
+
+ // JAXB creates an empty namespace due to type references, ignore it
+ DOMResult result = new DOMResult((namespace == null || namespace.length() == 0) ? throwAway : element);
+ result.setSystemId("replace-me");
+ return result;
+ }
+ });
+
+ // Until we stop inlining schema, we will need to filter schemaLocations since JAXB requires them
+ removeSchemaLocations(element);
+
+ wsdl.setWsdlTypes(types);
+ }
+ catch (Exception exception)
+ {
+ throw new WSException("Could not generate schema: " + exception.getMessage(), exception);
+ }
+ }
+
+ private void removeSchemaLocations(Element element)
+ {
+ for (Element child = Util.getFirstChildElement(element); child != null; child = Util.getNextSiblingElement(child))
+ {
+ if ("import".equals(child.getLocalName()) && Constants.NS_SCHEMA_XSD.equals(child.getNamespaceURI()) && "replace-me".equals(child.getAttribute("schemaLocation")))
+ {
+ child.removeAttribute("schemaLocation");
+ }
+ else
+ {
+ removeSchemaLocations(child);
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/JAXBWSDLGenerator.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl
===================================================================
--- trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl (rev 0)
+++ trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1 @@
+org.jboss.ws.tools.jaxws.impl.SunRIConsumerFactoryImpl
\ No newline at end of file
Added: trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.tools.ProviderFactoryImpl
===================================================================
--- trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.tools.ProviderFactoryImpl (rev 0)
+++ trunk/jbossws-core/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.tools.ProviderFactoryImpl 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1 @@
+org.jboss.ws.tools.jaxws.impl.JBossWSProviderFactoryImpl
\ No newline at end of file
Added: trunk/jbossws-core/src/main/resources/schema/swaref.xsd
===================================================================
--- trunk/jbossws-core/src/main/resources/schema/swaref.xsd (rev 0)
+++ trunk/jbossws-core/src/main/resources/schema/swaref.xsd 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2002-2004 by The Web Services-Interoperability Organization (WS-I) and
+ Certain of its Members. All Rights Reserved.
+
+ Notice
+ The material contained herein is not a license, either expressly or impliedly, to any
+ intellectual property owned or controlled by any of the authors or developers of this
+ material or WS-I. The material contained herein is provided on an "AS IS" basis and to
+ the maximum extent permitted by applicable law, this material is provided AS IS AND WITH
+ ALL FAULTS, and the authors and developers of this material and WS-I hereby disclaim all
+ other warranties and conditions, either express, implied or statutory, including, but not
+ limited to, any (if any) implied warranties, duties or conditions of merchantability,
+ of fitness for a particular purpose, of accuracy or completeness of responses, of results,
+ of workmanlike effort, of lack of viruses, and of lack of negligence. ALSO, THERE IS NO
+ WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO
+ DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THIS MATERIAL.
+
+ IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR WS-I BE LIABLE TO ANY OTHER
+ PARTY FOR THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE,
+ LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES
+ WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR
+ ANY OTHER AGREEMENT RELATING TO THIS MATERIAL, WHETHER OR NOT SUCH PARTY HAD ADVANCE
+ NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
+
+ WS-I License Information
+ Use of this WS-I Material is governed by the WS-I Test License and other licenses. Information on these
+ licenses are contained in the README.txt and ReleaseNotes.txt files. By downloading this file, you agree
+ to the terms of these licenses.
+
+ How To Provide Feedback
+ The Web Services-Interoperability Organization (WS-I) would like to receive input,
+ suggestions and other feedback ("Feedback") on this work from a wide variety of
+ industry participants to improve its quality over time.
+
+ By sending email, or otherwise communicating with WS-I, you (on behalf of yourself if
+ you are an individual, and your company if you are providing Feedback on behalf of the
+ company) will be deemed to have granted to WS-I, the members of WS-I, and other parties
+ that have access to your Feedback, a non-exclusive, non-transferable, worldwide, perpetual,
+ irrevocable, royalty-free license to use, disclose, copy, license, modify, sublicense or
+ otherwise distribute and exploit in any manner whatsoever the Feedback you provide regarding
+ the work. You acknowledge that you have no expectation of confidentiality with respect to
+ any Feedback you provide. You represent and warrant that you have rights to provide this
+ Feedback, and if you are providing Feedback on behalf of a company, you represent and warrant
+ that you have the rights to provide Feedback on behalf of your company. You also acknowledge
+ that WS-I is not required to review, discuss, use, consider or in any way incorporate your
+ Feedback into future versions of its work. If WS-I does incorporate some or all of your
+ Feedback in a future version of the work, it may, but is not obligated to include your name
+ (or, if you are identified as acting on behalf of your company, the name of your company) on
+ a list of contributors to the work. If the foregoing is not acceptable to you and any company
+ on whose behalf you are acting, please do not provide any Feedback.
+
+ Feedback on this document should be directed to wsi-test-comments(a)ws-i.org.
+-->
+<xsd:schema targetNamespace="http://ws-i.org/profiles/basic/1.1/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:simpleType name="swaRef">
+ <xsd:restriction base="xsd:anyURI"/>
+ </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file
Property changes on: trunk/jbossws-core/src/main/resources/schema/swaref.xsd
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-core/src/main/resources/standard-config/standard-jaxws-client-config.xml
===================================================================
--- trunk/jbossws-core/src/main/resources/standard-config/standard-jaxws-client-config.xml 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/main/resources/standard-config/standard-jaxws-client-config.xml 2007-05-29 09:21:32 UTC (rev 3272)
@@ -8,9 +8,18 @@
<client-config>
<config-name>Standard Client</config-name>
<feature>http://org.jboss.ws/dispatch/validate</feature>
+ <property>
+ <property-name>http://org.jboss.ws/http#chunksize</property-name>
+ <property-value>2048</property-value>
+ </property>
</client-config>
<client-config>
+ <config-name>HTTP 1.0 Client</config-name>
+ <feature>http://org.jboss.ws/dispatch/validate</feature>
+ </client-config>
+
+ <client-config>
<config-name>Standard WSAddressing Client</config-name>
<post-handler-chains>
<javaee:handler-chain>
@@ -36,4 +45,4 @@
</post-handler-chains>
</client-config>
-</jaxws-config>
\ No newline at end of file
+</jaxws-config>
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -51,20 +51,20 @@
public void testFieldAnnotation() throws Exception
{
- AttachmentScanResult mimeType = SCANNER.scan(FieldAnnotation.class);
+ AttachmentScanResult mimeType = SCANNER.scanBean(FieldAnnotation.class);
assertNotNull("Unable to find xop declaration", mimeType);
assertEquals("text/xml", mimeType.getMimeType());
}
public void testMethodAnnotation() throws Exception
{
- AttachmentScanResult mimeType = SCANNER.scan(MethodAnnotation.class);
+ AttachmentScanResult mimeType = SCANNER.scanBean(MethodAnnotation.class);
assertNotNull("Unable to find xop declaration", mimeType);
}
public void testAnnotationMissing() throws Exception
{
- AttachmentScanResult mimeType = SCANNER.scan(NoAnnotation.class);
+ AttachmentScanResult mimeType = SCANNER.scanBean(NoAnnotation.class);
assertNull("There should be no mimeType available", mimeType);
}
@@ -82,20 +82,20 @@
System.out.println(m.getParameterAnnotations().length);
- AttachmentScanResult mimeType = SCANNER.scan( m.getParameterTypes()[0]);
+ AttachmentScanResult mimeType = SCANNER.scanBean( m.getParameterTypes()[0]);
assertNotNull("Unable to find xop declaration", mimeType);
assertEquals("text/xml", mimeType.getMimeType());
}
public void testSimpleRecursion() throws Exception
{
- AttachmentScanResult mimeType = SCANNER.scan(SimpleRecursion.class);
+ AttachmentScanResult mimeType = SCANNER.scanBean(SimpleRecursion.class);
assertNull(mimeType);
}
public void testComplexRecursion() throws Exception
{
- AttachmentScanResult mimeType = SCANNER.scan(ComplexRecursion.class);
+ AttachmentScanResult mimeType = SCANNER.scanBean(ComplexRecursion.class);
assertNotNull("Unable to find xop declaration", mimeType);
assertEquals("text/plain", mimeType.getMimeType());
}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java 2007-05-26 14:37:31 UTC (rev 3271)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -27,8 +27,8 @@
import java.net.URLClassLoader;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.tools.jaxws.api.WSContractProvider;
import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.wsf.spi.tools.api.WSContractProvider;
import org.jboss.wsf.spi.utils.JavaUtils;
/**
Added: trunk/testsuite/src/java/org/jboss/test/ws/XOPTestSupport.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/XOPTestSupport.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/XOPTestSupport.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws;
+
+// $Id$
+
+import java.awt.Image;
+import java.awt.Toolkit;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.activation.DataHandler;
+import javax.xml.transform.stream.StreamSource;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @since 22-Sep-2006
+ */
+public class XOPTestSupport
+{
+
+ public static byte[] getBytesFromFile(File file) throws IOException
+ {
+ InputStream is = new FileInputStream(file);
+
+ long length = file.length();
+ byte[] bytes = new byte[(int)length];
+
+ int offset = 0;
+ int numRead = 0;
+ while (offset < bytes.length && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0)
+ {
+ offset += numRead;
+ }
+
+ is.close();
+ return bytes;
+ }
+
+ public static Image createTestImage(File imgFile)
+ {
+ Image image = null;
+ try
+ {
+ URL url = imgFile.toURL();
+
+ image = null;
+ try
+ {
+ image = Toolkit.getDefaultToolkit().createImage(url);
+ }
+ catch (Throwable th)
+ {
+ //log.warn("Cannot create Image: " + th);
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ return image;
+ }
+
+ public static StreamSource createTestSource()
+ {
+ return new StreamSource(new ByteArrayInputStream("<some><nestedXml/></some>".getBytes()));
+ }
+
+ public static DataHandler createDataHandler(File imgFile)
+ {
+ try
+ {
+ URL url = imgFile.toURL();
+ return new DataHandler(url);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/XOPTestSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpoint.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpoint.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpoint.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,21 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.jws.soap.SOAPBinding;
+import javax.ejb.Remote;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import java.rmi.RemoteException;
+
+@WebService(name="BareEndpoint")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
+@Remote
+public interface BareEndpoint
+{
+ @WebMethod
+ DocumentPayload beanAnnotation(DocumentPayload payload) throws RemoteException;
+
+ @WebMethod
+ @XmlAttachmentRef
+ DocumentPayloadWithoutRef parameterAnnotation(@XmlAttachmentRef DocumentPayloadWithoutRef payload) throws RemoteException;
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpointImpl.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpointImpl.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpointImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,49 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import org.jboss.ws.annotation.WebContext;
+import org.jboss.ws.WSException;
+
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.ejb.Stateless;
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import java.io.IOException;
+import java.rmi.RemoteException;
+
+@Stateless
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.swaref.BareEndpoint")
+@WebContext(contextRoot = "jaxws-swaref")
+public class BareEndpointImpl implements BareEndpoint
+{
+
+ public DocumentPayload beanAnnotation(DocumentPayload payload) throws RemoteException
+ {
+ try
+ {
+ System.out.println("Got '" + payload.getData().getContent() +"'");
+ return new DocumentPayload( new DataHandler("Server data", "text/plain"));
+ }
+ catch (IOException e)
+ {
+ throw new WSException(e);
+ }
+ }
+
+ @WebMethod
+ @XmlAttachmentRef
+ public DocumentPayloadWithoutRef parameterAnnotation(@XmlAttachmentRef DocumentPayloadWithoutRef payload) throws RemoteException
+ {
+ try
+ {
+ if(null == payload) throw new WSException("Payload was null");
+ System.out.println("Got " + payload.getData().getContent());
+ DataHandler dataHandler = new DataHandler("Server data", "text/plain");
+ return new DocumentPayloadWithoutRef(dataHandler);
+ }
+ catch (IOException e)
+ {
+ throw new WSException(e);
+ }
+ }
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/BareEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,33 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class DocumentPayload
+{
+ private DataHandler data;
+
+ public DocumentPayload()
+ {
+ }
+
+ public DocumentPayload(DataHandler data)
+ {
+ this.data = data;
+ }
+
+ @XmlElement
+ @XmlAttachmentRef
+ public DataHandler getData()
+ {
+ return data;
+ }
+
+ public void setData(DataHandler data)
+ {
+ this.data = data;
+ }
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayload.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithoutRef.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithoutRef.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithoutRef.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,35 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Document that's not annotated with @XmlAttachmentRef
+ */
+@XmlRootElement
+public class DocumentPayloadWithoutRef
+{
+ private DataHandler data;
+
+ public DocumentPayloadWithoutRef()
+ {
+ }
+
+ public DocumentPayloadWithoutRef(DataHandler data)
+ {
+ this.data = data;
+ }
+
+ @XmlElement
+ public DataHandler getData()
+ {
+ return data;
+ }
+
+ public void setData(DataHandler data)
+ {
+ this.data = data;
+ }
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithoutRef.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,22 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.ejb.Remote;
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import java.rmi.RemoteException;
+
+@Remote
+@WebService
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface RpcLitEndpoint
+{
+ @WebMethod
+ @XmlAttachmentRef
+ DataHandler parameterAnnotation(@XmlAttachmentRef DataHandler data) throws RemoteException;
+
+ @WebMethod
+ DocumentPayload beanAnnotation(DocumentPayload payload) throws RemoteException;
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,48 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import org.jboss.ws.annotation.WebContext;
+import org.jboss.ws.WSException;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.activation.DataHandler;
+import java.rmi.RemoteException;
+import java.io.IOException;
+
+@Stateless
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.swaref.RpcLitEndpoint")
+@WebContext(contextRoot = "jaxws-swaref")
+public class RpcLitEndpointImpl implements RpcLitEndpoint
+{
+
+ @WebMethod
+ public DataHandler parameterAnnotation(DataHandler data) throws RemoteException
+ {
+ try
+ {
+ System.out.println("Got " + data.getContent() );
+ return new DataHandler("Server data", "text/plain");
+ }
+ catch (IOException e)
+ {
+ throw new WSException(e);
+ }
+
+ }
+
+ @WebMethod
+ public DocumentPayload beanAnnotation(DocumentPayload payload) throws RemoteException
+ {
+ try
+ {
+ System.out.println("Got " + payload.getData().getContent() );
+ DataHandler data = new DataHandler("Server data", "text/plain");
+ return new DocumentPayload(data);
+ }
+ catch (IOException e)
+ {
+ throw new WSException(e);
+ }
+ }
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,93 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import junit.framework.Test;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+import javax.xml.ws.Service;
+import javax.xml.namespace.QName;
+import javax.activation.DataHandler;
+import java.net.URL;
+
+/**
+ * Test SwARef with different binding styles and @XmlAttachmentRef locations.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ */
+public class SWARefTestCase extends JBossWSTest
+{
+ private String bareEndpointURL = "http://" + getServerHost() + ":8080/jaxws-swaref/BareEndpointImpl";
+ private String wrappedEndpointURL = "http://" + getServerHost() + ":8080/jaxws-swaref/WrappedEndpointImpl";
+ private String rpclitEndpointURL = "http://" + getServerHost() + ":8080/jaxws-swaref/RpcLitEndpointImpl";
+
+ private QName bareServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "BareEndpointImplService");
+ private QName wrappedServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "WrappedEndpointImplService");
+ private QName rpcLitServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "RpcLitEndpointImplService");
+
+ private static DataHandler data = new DataHandler("Client data", "text/plain");
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(SWARefTestCase.class, "jaxws-samples-swaref.jar");
+ }
+
+ public void testBeanAnnotationWithBare() throws Exception
+ {
+ Service service = Service.create(new URL(bareEndpointURL +"?wsdl"), bareServiceQName);
+ BareEndpoint port = service.getPort(BareEndpoint.class);
+ DocumentPayload response = port.beanAnnotation(new DocumentPayload(data));
+ assertTrue(response.getData().getContent().equals("Server data"));
+ }
+
+ /*public void testParameterAnnotationWithBare() throws Exception
+ {
+ Service service = Service.create(new URL(bareEndpointURL +"?wsdl"), bareServiceQName);
+ BareEndpoint port = service.getPort(BareEndpoint.class);
+
+ DocumentPayloadWithoutRef response = port.parameterAnnotation(new DocumentPayloadWithoutRef(data));
+ assertTrue(response.getData().getContent().equals("Server data"));
+ }*/
+
+ public void testBeanAnnotationWithWrapped() throws Exception
+ {
+ Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"), wrappedServiceQName);
+ WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
+
+ DocumentPayload response = port.beanAnnotation(new DocumentPayload(data), "Wrapped test");
+ assertTrue(response.getData().getContent().equals("Server data"));
+
+ }
+
+ public void testParameterAnnotationWithWrapped() throws Exception
+ {
+ Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"), wrappedServiceQName);
+ WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
+
+ DataHandler response = port.parameterAnnotation(data, "Wrapped test");
+ assertNotNull("Response as null", response);
+ assertTrue("Contents are not equal", response.getContent().equals("Server data"));
+ }
+
+ public void testBeanAnnotationWithRPC() throws Exception
+ {
+ Service service = Service.create(new URL(rpclitEndpointURL+"?wsdl"), rpcLitServiceQName);
+ RpcLitEndpoint port = service.getPort(RpcLitEndpoint.class);
+
+ DocumentPayload response = port.beanAnnotation( new DocumentPayload(data));
+ assertNotNull("Response was null", response);
+ assertTrue(response.getData().getContent().equals("Server data"));
+
+ }
+
+ /*public void testParameterAnnotationWithRPC() throws Exception
+ {
+ Service service = Service.create(new URL(rpclitEndpointURL+"?wsdl"), rpcLitServiceQName);
+ RpcLitEndpoint port = service.getPort(RpcLitEndpoint.class);
+
+ DataHandler response = port.parameterAnnotation(data);
+ assertNotNull("Response was null", response);
+ assertTrue(response.getContent().equals("Server data"));
+
+ }*/
+
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,21 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.ejb.Remote;
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import java.rmi.RemoteException;
+
+@Remote
+@WebService
+public interface WrappedEndpoint
+{
+ @WebMethod
+ DocumentPayload beanAnnotation(DocumentPayload dhw, String test) throws RemoteException;
+
+ @WebMethod
+ @XmlAttachmentRef
+ DataHandler parameterAnnotation(@XmlAttachmentRef DataHandler data, String test) throws RemoteException;
+
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,105 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import org.jboss.ws.annotation.WebContext;
+import org.jboss.ws.WSException;
+
+import javax.activation.DataHandler;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.ejb.Stateless;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.rmi.RemoteException;
+
+@Stateless
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.swaref.WrappedEndpoint")
+@WebContext(contextRoot = "jaxws-swaref")
+public class WrappedEndpointImpl implements WrappedEndpoint
+{
+ /* (non-Javadoc)
+ * @see org.jboss.ws.test.TestService#parameterAnnotation(javax.activation.DataHandler)
+ */
+ @WebMethod
+ public DocumentPayload beanAnnotation(DocumentPayload dhw, String test) throws RemoteException
+ {
+ DataHandler dh;
+
+ try {
+ System.out.println("[TestServiceImpl] ---> Dans le service");
+
+ // récupère la pièce attachée
+ if (dhw != null && dhw.getData() != null) {
+ dh=dhw.getData();
+ dumpDH(dh);
+ }
+ else
+ {
+ System.out.println("[TestServiceImpl] ---> Le DataHandler est NULL.");
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ dh = new DataHandler("Server data", "text/plain") ;
+
+ try{
+ System.out.println("[TestServiceImpl] ---> Le DataHandler returned.");
+ dumpDH(dh);
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ return new DocumentPayload(dh);
+ }
+
+
+ @WebMethod
+ @XmlAttachmentRef
+ public DataHandler parameterAnnotation(@XmlAttachmentRef DataHandler data, String test) throws RemoteException
+ {
+ try
+ {
+ System.out.println("Got " + data.getContent());
+ return new DataHandler("Server data", "text/plain");
+ }
+ catch (IOException e)
+ {
+ throw new WSException(e);
+ }
+ }
+
+ private static void dumpDH(DataHandler in_dh) throws Exception
+ {
+ InputStream is = in_dh.getInputStream();
+ if (is != null) {
+
+ System.out.println("[TestServiceImpl] ---> in_dh START : ");
+ System.out.println("[TestServiceImpl] ---> in_dh START : ");
+ System.out.println("[TestServiceImpl] ---> in_dh START : ");
+
+ // récupère le contenu du fichier
+ BufferedReader in = new BufferedReader(new InputStreamReader(is));
+ String ligne="";
+ ligne = in.readLine();
+ while (ligne != null)
+ {
+ System.out.println(ligne);
+ ligne = in.readLine();
+ }
+ in.close();
+ System.out.println("[TestServiceImpl] ---> END.");
+ System.out.println("[TestServiceImpl] ---> END.");
+ System.out.println("[TestServiceImpl] ---> END.");
+ }
+ else
+ {
+ System.out.println("[TestServiceImpl] ---> in_dh inputstream is null.");
+ }
+
+ }
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,16 @@
+package org.jboss.test.ws.jaxws.samples.xop.doclit;
+
+import javax.activation.DataHandler;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.ws.BindingType;
+
+@WebService
+@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
+public interface WrappedEndpoint
+{
+ @WebMethod
+ @XmlMimeType("text/plain")
+ DataHandler parameterAnnotation(@XmlMimeType("text/plain") DataHandler data);
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.xop.doclit;
+
+import org.jboss.ws.WSException;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.ws.BindingType;
+import javax.activation.DataHandler;
+import java.io.IOException;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ */
+@WebService(name = "WrappedEndpoint", serviceName = "WrappedService", endpointInterface = "org.jboss.test.ws.jaxws.samples.xop.doclit.WrappedEndpoint")
+public class WrappedEndpointImpl implements WrappedEndpoint
+{
+
+ @WebMethod
+ @XmlMimeType("text/plain")
+ public DataHandler parameterAnnotation(@XmlMimeType("text/plain")DataHandler data)
+ {
+ try
+ {
+ System.out.println("Got " + data.getContent());
+ return new DataHandler("Server data", "text/plain");
+ }
+ catch (IOException e)
+ {
+ throw new WSException(e);
+ }
+ }
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java 2007-05-29 09:21:32 UTC (rev 3272)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.xop.doclit;
+
+import junit.framework.Test;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.test.ws.JBossWSTest;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPBinding;
+import javax.activation.DataHandler;
+import java.net.URL;
+
+/**
+ * Test @XmlMimeType annotations on wrapped services.
+ * The annotations should be copied to the generated wrapper beans.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ */
+public class XOPWrappedTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-samples-xop-doclit/wrapped";
+
+ private WrappedEndpoint port;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(XOPWrappedTestCase.class, "jaxws-samples-xop-doclit.war");
+ }
+
+ protected void setUp() throws Exception
+ {
+
+ QName serviceName = new QName("http://doclit.xop.samples.jaxws.ws.test.jboss.org/", "WrappedService");
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port = service.getPort(WrappedEndpoint.class);
+
+ SOAPBinding binding = (SOAPBinding)((BindingProvider)port).getBinding();
+ binding.setMTOMEnabled(true);
+
+ }
+
+ public void testParameterAnnotation() throws Exception
+ {
+ DataHandler request = new DataHandler("Client data", "text/plain");
+ DataHandler response = port.parameterAnnotation(request);
+
+ assertNotNull(response);
+ assertEquals(response.getContent(), "Server data");
+ assertEquals(response.getContentType(), "text/plain");
+ }
+
+}
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 8 months
JBossWS SVN: r3271 - in trunk: integration/sunri/src/test/resources and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-26 10:37:31 -0400 (Sat, 26 May 2007)
New Revision: 3271
Added:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/jaxws-handlers-server.xml
Modified:
trunk/integration/sunri/ant-import/build-deploy.xml
trunk/integration/sunri/src/test/resources/excludes-jboss42.txt
trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
trunk/integration/xfire/src/test/resources/excludes-jboss42.txt
trunk/integration/xfire/src/test/resources/excludes-jboss50.txt
Log:
Redefine sunri,xfire excludes
Modified: trunk/integration/sunri/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-deploy.xml 2007-05-26 14:22:48 UTC (rev 3270)
+++ trunk/integration/sunri/ant-import/build-deploy.xml 2007-05-26 14:37:31 UTC (rev 3271)
@@ -21,7 +21,7 @@
<!-- Deploy to jboss50 -->
<target name="deploy-jboss50" depends="jars-jboss50,undeploy-jboss50" description="Deploy jbossws/sunri to jboss50">
- <ant antfile="${int.sunri.dir}/build.xml" target="undeploy-jboss50" inheritall="false"/>
+ <ant antfile="${int.native.dir}/build.xml" target="undeploy-jboss50" inheritall="false"/>
<ant antfile="${int.xfire.dir}/build.xml" target="undeploy-jboss50" inheritall="false"/>
<macro-deploy-sunri50
spilibs="${spi.dir}/output/lib"
Modified: trunk/integration/sunri/src/test/resources/excludes-jboss42.txt
===================================================================
--- trunk/integration/sunri/src/test/resources/excludes-jboss42.txt 2007-05-26 14:22:48 UTC (rev 3270)
+++ trunk/integration/sunri/src/test/resources/excludes-jboss42.txt 2007-05-26 14:37:31 UTC (rev 3271)
@@ -4,21 +4,16 @@
org/jboss/test/ws/jaxws/samples/asynchronous/**
org/jboss/test/ws/jaxws/samples/context/**
-# org/jboss/test/ws/jaxws/samples/eardeployment/**
org/jboss/test/ws/jaxws/samples/exception/**
org/jboss/test/ws/jaxws/samples/handlerchain/**
org/jboss/test/ws/jaxws/samples/httpbinding/**
org/jboss/test/ws/jaxws/samples/jaxr/**
-org/jboss/test/ws/jaxws/samples/jsr181ejb/**
-org/jboss/test/ws/jaxws/samples/jsr181pojo/**
org/jboss/test/ws/jaxws/samples/logicalhandler/**
org/jboss/test/ws/jaxws/samples/oneway/**
org/jboss/test/ws/jaxws/samples/provider/**
org/jboss/test/ws/jaxws/samples/retail/**
org/jboss/test/ws/jaxws/samples/soapbinding/**
org/jboss/test/ws/jaxws/samples/webmethod/**
-org/jboss/test/ws/jaxws/samples/webparam/**
-org/jboss/test/ws/jaxws/samples/webresult/**
org/jboss/test/ws/jaxws/samples/webservice/**
org/jboss/test/ws/jaxws/samples/webserviceref/**
org/jboss/test/ws/jaxws/samples/wsaddressing/**
Modified: trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
===================================================================
--- trunk/integration/sunri/src/test/resources/excludes-jboss50.txt 2007-05-26 14:22:48 UTC (rev 3270)
+++ trunk/integration/sunri/src/test/resources/excludes-jboss50.txt 2007-05-26 14:37:31 UTC (rev 3271)
@@ -2,26 +2,21 @@
# $Id$
#
-#org/jboss/test/ws/jaxws/samples/asynchronous/**
-#org/jboss/test/ws/jaxws/samples/context/**
-#org/jboss/test/ws/jaxws/samples/eardeployment/**
-#org/jboss/test/ws/jaxws/samples/exception/**
-#org/jboss/test/ws/jaxws/samples/handlerchain/**
-#org/jboss/test/ws/jaxws/samples/httpbinding/**
-#org/jboss/test/ws/jaxws/samples/jaxr/**
-#org/jboss/test/ws/jaxws/samples/jsr181ejb/**
-#org/jboss/test/ws/jaxws/samples/jsr181pojo/**
-#org/jboss/test/ws/jaxws/samples/logicalhandler/**
-#org/jboss/test/ws/jaxws/samples/oneway/**
-#org/jboss/test/ws/jaxws/samples/provider/**
-#org/jboss/test/ws/jaxws/samples/retail/**
-#org/jboss/test/ws/jaxws/samples/soapbinding/**
-#org/jboss/test/ws/jaxws/samples/webmethod/**
-#org/jboss/test/ws/jaxws/samples/webparam/**
-#org/jboss/test/ws/jaxws/samples/webresult/**
-#org/jboss/test/ws/jaxws/samples/webservice/**
-#org/jboss/test/ws/jaxws/samples/webserviceref/**
-#org/jboss/test/ws/jaxws/samples/wsaddressing/**
-#org/jboss/test/ws/jaxws/samples/wseventing/**
-#org/jboss/test/ws/jaxws/samples/wssecurity/**
-#org/jboss/test/ws/jaxws/samples/xop/**
+org/jboss/test/ws/jaxws/samples/asynchronous/**
+org/jboss/test/ws/jaxws/samples/context/**
+org/jboss/test/ws/jaxws/samples/exception/**
+org/jboss/test/ws/jaxws/samples/handlerchain/**
+org/jboss/test/ws/jaxws/samples/httpbinding/**
+org/jboss/test/ws/jaxws/samples/jaxr/**
+org/jboss/test/ws/jaxws/samples/logicalhandler/**
+org/jboss/test/ws/jaxws/samples/oneway/**
+org/jboss/test/ws/jaxws/samples/provider/**
+org/jboss/test/ws/jaxws/samples/retail/**
+org/jboss/test/ws/jaxws/samples/soapbinding/**
+org/jboss/test/ws/jaxws/samples/webmethod/**
+org/jboss/test/ws/jaxws/samples/webservice/**
+org/jboss/test/ws/jaxws/samples/webserviceref/**
+org/jboss/test/ws/jaxws/samples/wsaddressing/**
+org/jboss/test/ws/jaxws/samples/wseventing/**
+org/jboss/test/ws/jaxws/samples/wssecurity/**
+org/jboss/test/ws/jaxws/samples/xop/**
Modified: trunk/integration/xfire/src/test/resources/excludes-jboss42.txt
===================================================================
--- trunk/integration/xfire/src/test/resources/excludes-jboss42.txt 2007-05-26 14:22:48 UTC (rev 3270)
+++ trunk/integration/xfire/src/test/resources/excludes-jboss42.txt 2007-05-26 14:37:31 UTC (rev 3271)
@@ -4,13 +4,10 @@
org/jboss/test/ws/jaxws/samples/asynchronous/**
org/jboss/test/ws/jaxws/samples/context/**
-# org/jboss/test/ws/jaxws/samples/eardeployment/**
org/jboss/test/ws/jaxws/samples/exception/**
org/jboss/test/ws/jaxws/samples/handlerchain/**
org/jboss/test/ws/jaxws/samples/httpbinding/**
org/jboss/test/ws/jaxws/samples/jaxr/**
-org/jboss/test/ws/jaxws/samples/jsr181ejb/**
-org/jboss/test/ws/jaxws/samples/jsr181pojo/**
org/jboss/test/ws/jaxws/samples/logicalhandler/**
org/jboss/test/ws/jaxws/samples/oneway/**
org/jboss/test/ws/jaxws/samples/provider/**
Modified: trunk/integration/xfire/src/test/resources/excludes-jboss50.txt
===================================================================
--- trunk/integration/xfire/src/test/resources/excludes-jboss50.txt 2007-05-26 14:22:48 UTC (rev 3270)
+++ trunk/integration/xfire/src/test/resources/excludes-jboss50.txt 2007-05-26 14:37:31 UTC (rev 3271)
@@ -4,13 +4,10 @@
org/jboss/test/ws/jaxws/samples/asynchronous/**
org/jboss/test/ws/jaxws/samples/context/**
-# org/jboss/test/ws/jaxws/samples/eardeployment/**
org/jboss/test/ws/jaxws/samples/exception/**
org/jboss/test/ws/jaxws/samples/handlerchain/**
org/jboss/test/ws/jaxws/samples/httpbinding/**
org/jboss/test/ws/jaxws/samples/jaxr/**
-org/jboss/test/ws/jaxws/samples/jsr181ejb/**
-org/jboss/test/ws/jaxws/samples/jsr181pojo/**
org/jboss/test/ws/jaxws/samples/logicalhandler/**
org/jboss/test/ws/jaxws/samples/oneway/**
org/jboss/test/ws/jaxws/samples/provider/**
Added: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/jaxws-handlers-server.xml
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/jaxws-handlers-server.xml (rev 0)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/jaxws-handlers-server.xml 2007-05-26 14:37:31 UTC (rev 3271)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+ <handler>
+ <handler-name> MTOMHandler </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.samples.xop.doclit.MTOMProtocolHandler </handler-class>
+ </handler>
+ </handler-chain>
+</handler-chains>
\ No newline at end of file
Property changes on: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/jaxws-handlers-server.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 8 months
JBossWS SVN: r3270 - in trunk: integration/sunri/ant-import and 11 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-26 10:22:48 -0400 (Sat, 26 May 2007)
New Revision: 3270
Modified:
trunk/integration/native/.classpath
trunk/integration/sunri/ant-import/build-thirdparty.xml
trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
trunk/testsuite/.classpath
trunk/testsuite/ant-import/build-jars-jaxws.xml
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpJAXBTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/ProviderBeanJAXB.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderMessageTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/soapbinding/SOAPBindingTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/DHRequest.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMEndpointBean.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMProtocolHandler.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBase.java
Log:
Remove dependency on propriatary API
Modified: trunk/integration/native/.classpath
===================================================================
--- trunk/integration/native/.classpath 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/integration/native/.classpath 2007-05-26 14:22:48 UTC (rev 3270)
@@ -5,5 +5,9 @@
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
<classpathentry combineaccessrules="false" kind="src" path="/integration-spi"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-core"/>
+ <classpathentry kind="lib" path="/integration-spi/thirdparty/dom4j.jar"/>
+ <classpathentry kind="lib" path="/integration-spi/thirdparty/jboss-common-core.jar"/>
+ <classpathentry kind="lib" path="/jbossws-core/thirdparty/wsdl4j.jar"/>
+ <classpathentry kind="lib" path="/integration-spi/thirdparty/activation.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/integration/sunri/ant-import/build-thirdparty.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-thirdparty.xml 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/integration/sunri/ant-import/build-thirdparty.xml 2007-05-26 14:22:48 UTC (rev 3270)
@@ -78,8 +78,6 @@
<pathelement location="${spi.dir}/thirdparty/jboss-javaee.jar"/>
<pathelement location="${thirdparty.dir}/http.jar"/>
<pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
- <pathelement location="${thirdparty.dir}/jaxb-impl.jar"/>
- <pathelement location="${thirdparty.dir}/jaxb-xjc.jar"/>
<pathelement location="${thirdparty.dir}/jaxws-api.jar"/>
<pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
<pathelement location="${thirdparty.dir}/jsr181-api.jar"/>
Modified: trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
===================================================================
--- trunk/integration/sunri/src/test/resources/excludes-jboss50.txt 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/integration/sunri/src/test/resources/excludes-jboss50.txt 2007-05-26 14:22:48 UTC (rev 3270)
@@ -2,26 +2,26 @@
# $Id$
#
-org/jboss/test/ws/jaxws/samples/asynchronous/**
-org/jboss/test/ws/jaxws/samples/context/**
-# org/jboss/test/ws/jaxws/samples/eardeployment/**
-org/jboss/test/ws/jaxws/samples/exception/**
-org/jboss/test/ws/jaxws/samples/handlerchain/**
-org/jboss/test/ws/jaxws/samples/httpbinding/**
-org/jboss/test/ws/jaxws/samples/jaxr/**
-org/jboss/test/ws/jaxws/samples/jsr181ejb/**
-org/jboss/test/ws/jaxws/samples/jsr181pojo/**
-org/jboss/test/ws/jaxws/samples/logicalhandler/**
-org/jboss/test/ws/jaxws/samples/oneway/**
-org/jboss/test/ws/jaxws/samples/provider/**
-org/jboss/test/ws/jaxws/samples/retail/**
-org/jboss/test/ws/jaxws/samples/soapbinding/**
-org/jboss/test/ws/jaxws/samples/webmethod/**
-org/jboss/test/ws/jaxws/samples/webparam/**
-org/jboss/test/ws/jaxws/samples/webresult/**
-org/jboss/test/ws/jaxws/samples/webservice/**
-org/jboss/test/ws/jaxws/samples/webserviceref/**
-org/jboss/test/ws/jaxws/samples/wsaddressing/**
-org/jboss/test/ws/jaxws/samples/wseventing/**
-org/jboss/test/ws/jaxws/samples/wssecurity/**
-org/jboss/test/ws/jaxws/samples/xop/**
+#org/jboss/test/ws/jaxws/samples/asynchronous/**
+#org/jboss/test/ws/jaxws/samples/context/**
+#org/jboss/test/ws/jaxws/samples/eardeployment/**
+#org/jboss/test/ws/jaxws/samples/exception/**
+#org/jboss/test/ws/jaxws/samples/handlerchain/**
+#org/jboss/test/ws/jaxws/samples/httpbinding/**
+#org/jboss/test/ws/jaxws/samples/jaxr/**
+#org/jboss/test/ws/jaxws/samples/jsr181ejb/**
+#org/jboss/test/ws/jaxws/samples/jsr181pojo/**
+#org/jboss/test/ws/jaxws/samples/logicalhandler/**
+#org/jboss/test/ws/jaxws/samples/oneway/**
+#org/jboss/test/ws/jaxws/samples/provider/**
+#org/jboss/test/ws/jaxws/samples/retail/**
+#org/jboss/test/ws/jaxws/samples/soapbinding/**
+#org/jboss/test/ws/jaxws/samples/webmethod/**
+#org/jboss/test/ws/jaxws/samples/webparam/**
+#org/jboss/test/ws/jaxws/samples/webresult/**
+#org/jboss/test/ws/jaxws/samples/webservice/**
+#org/jboss/test/ws/jaxws/samples/webserviceref/**
+#org/jboss/test/ws/jaxws/samples/wsaddressing/**
+#org/jboss/test/ws/jaxws/samples/wseventing/**
+#org/jboss/test/ws/jaxws/samples/wssecurity/**
+#org/jboss/test/ws/jaxws/samples/xop/**
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -79,13 +79,13 @@
// The associated parameter
private ParameterMetaData paramMetaData;
-
- // content soapContent
+ // SOAP content
private SOAPContent soapContent;
+ // While transitioning DOM expansion
+ private boolean lockDOMExpansion;
+ // While transitioning MTOM expansion
+ private boolean lockMTOMTransition;
- // while transitioning DOM expansion needs to be locked
- private boolean lockDOMExpansion = false;
-
/** Construct a SOAPContentElement
*/
public SOAPContentElement(Name name)
@@ -498,7 +498,10 @@
private void expandToDOM()
{
if (!lockDOMExpansion)
+ {
+ handleMTOMTransitions();
transitionTo(State.DOM_VALID);
+ }
}
public void setValue(String value)
@@ -522,10 +525,7 @@
public void writeElement(Writer writer) throws IOException
{
- // JMS transport hot fix
- // Can be removed once we got a immutabe object model
- if (MessageContextAssociation.peekMessageContext() != null)
- handleMTOMTransitions();
+ handleMTOMTransitions();
if (soapContent instanceof DOMContent)
{
@@ -553,36 +553,48 @@
*/
public void handleMTOMTransitions()
{
+ // JMS transport hot fix. Can be removed once we got a immutabe object model
+ if (MessageContextAssociation.peekMessageContext() == null)
+ return;
+
// MTOM processing is only required on XOP parameters
- if (!isXOPParameter())
+ if (lockMTOMTransition || !isXOPParameter())
return;
- boolean domContentState = (soapContent instanceof DOMContent);
-
- if (!XOPContext.isMTOMEnabled())
+ try
{
- // If MTOM is disabled, we force dom expansion on XOP parameters.
- // This will inline any XOP include element and remove the attachment part.
- // See SOAPFactoryImpl for details.
+ lockMTOMTransition = true;
+ boolean domContentState = (soapContent instanceof DOMContent);
- log.debug("MTOM disabled: Force inline XOP data");
+ if (!XOPContext.isMTOMEnabled())
+ {
+ // If MTOM is disabled, we force dom expansion on XOP parameters.
+ // This will inline any XOP include element and remove the attachment part.
+ // See SOAPFactoryImpl for details.
- // TODO: This property must be reset, otherwise you negate its purpose
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- if (msgContext instanceof MessageContextJAXWS)
- ((MessageContextJAXWS)msgContext).setScope(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Scope.APPLICATION);
+ log.debug("MTOM disabled: Force inline XOP data");
- expandToDOM();
+ // TODO: This property must be reset, otherwise you negate its purpose
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ if (msgContext instanceof MessageContextJAXWS)
+ ((MessageContextJAXWS)msgContext).setScope(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Scope.APPLICATION);
+
+ expandToDOM();
+ }
+ else if (domContentState && XOPContext.isMTOMEnabled())
+ {
+ // When the DOM representation is valid,
+ // but MTOM is enabled we need to convert the inlined
+ // element back to an xop:Include element and create the attachment part
+
+ log.debug("MTOM enabled: Restore XOP data");
+ XOPContext.restoreXOPDataDOM(this);
+ }
}
- else if (domContentState && XOPContext.isMTOMEnabled())
+ finally
{
- // When the DOM representation is valid,
- // but MTOM is enabled we need to convert the inlined
- // element back to an xop:Include element and create the attachment part
-
- log.debug("MTOM enabled: Restore XOP data");
- XOPContext.restoreXOPDataDOM(this);
+ lockMTOMTransition = false;
}
}
Modified: trunk/testsuite/.classpath
===================================================================
--- trunk/testsuite/.classpath 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/.classpath 2007-05-26 14:22:48 UTC (rev 3270)
@@ -13,6 +13,5 @@
<classpathentry kind="lib" path="/integration-spi/thirdparty/activation.jar"/>
<classpathentry kind="lib" path="/integration-spi/thirdparty/jaxb-api.jar"/>
<classpathentry kind="lib" path="/integration-spi/thirdparty/jaxb-impl.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/jbossws-core"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/testsuite/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/testsuite/ant-import/build-jars-jaxws.xml 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/ant-import/build-jars-jaxws.xml 2007-05-26 14:22:48 UTC (rev 3270)
@@ -283,6 +283,7 @@
<war jarfile="${tests.output.dir}/libs/jaxws-samples-xop-doclit.war" webxml="${tests.output.dir}/resources/jaxws/samples/xop/doclit/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxws/samples/xop/doclit/*.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/xop/doclit/jaxws-handlers-server.xml"/>
<exclude name="org/jboss/test/ws/jaxws/samples/xop/doclit/*TestCase.class"/>
</classes>
</war>
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpJAXBTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpJAXBTestCase.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpJAXBTestCase.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -38,8 +38,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.wsf.spi.utils.DOMUtils;
+import org.w3c.dom.Element;
/**
* Test HTTP Binding
@@ -57,9 +57,8 @@
public void testWSDLAccess() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-httpbinding-jaxb/ProviderEndpoint?wsdl");
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
- assertNotNull(wsdlDefinitions);
+ Element wsdl = DOMUtils.parse(wsdlURL.openStream());
+ assertNotNull(wsdl);
}
public void testProviderDispatch() throws Exception
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/ProviderBeanJAXB.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/ProviderBeanJAXB.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/ProviderBeanJAXB.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -36,8 +36,6 @@
import org.jboss.logging.Logger;
-import com.sun.xml.bind.api.JAXBRIContext;
-
/**
* Test a Provider<Source> with JAXB
*
@@ -57,7 +55,7 @@
{
try
{
- JAXBContext jc = JAXBRIContext.newInstance(new Class[] { UserType.class });
+ JAXBContext jc = JAXBContext.newInstance(new Class[] { UserType.class });
UserType user = (UserType)jc.createUnmarshaller().unmarshal(request);
log.info("[string=" + user.getString() + ",qname=" + user.getQname() + "]");
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -34,8 +34,6 @@
import org.jboss.logging.Logger;
-import com.sun.xml.bind.api.JAXBRIContext;
-
/**
* Test a Provider<Source> with JAXB
*
@@ -58,7 +56,7 @@
{
try
{
- JAXBContext jc = JAXBRIContext.newInstance(new Class[] {UserType.class});
+ JAXBContext jc = JAXBContext.newInstance(new Class[] {UserType.class});
UserType user = (UserType)jc.createUnmarshaller().unmarshal(request);
log.info("[string=" + user.getString() + ",qname=" + user.getQname() + "]");
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -45,8 +45,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.wsf.spi.utils.DOMUtils;
import org.w3c.dom.Element;
/**
@@ -66,9 +65,8 @@
public void testWSDLAccess() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-provider-jaxb/ProviderEndpoint?wsdl");
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
- assertNotNull(wsdlDefinitions);
+ Element wsdl = DOMUtils.parse(wsdlURL.openStream());
+ assertNotNull(wsdl);
}
public void testProviderDispatch() throws Exception
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderMessageTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderMessageTestCase.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderMessageTestCase.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -45,9 +45,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.jboss.wsf.spi.utils.DOMUtils;
+import org.w3c.dom.Element;
/**
* Test a Provider<SOAPMessage>
@@ -73,9 +72,8 @@
public void testWSDLAccess() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-provider-message?wsdl");
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
- assertNotNull(wsdlDefinitions);
+ Element wsdl = DOMUtils.parse(wsdlURL.openStream());
+ assertNotNull(wsdl);
}
public void testProviderDispatch() throws Exception
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -46,8 +46,6 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.jboss.wsf.spi.utils.DOMUtils;
import org.w3c.dom.Element;
@@ -73,9 +71,8 @@
public void testWSDLAccess() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-provider-payload?wsdl");
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
- assertNotNull(wsdlDefinitions);
+ Element wsdl = DOMUtils.parse(wsdlURL.openStream());
+ assertNotNull(wsdl);
}
public void testProviderDispatch() throws Exception
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/soapbinding/SOAPBindingTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/soapbinding/SOAPBindingTestCase.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/soapbinding/SOAPBindingTestCase.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -39,7 +39,6 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.soap.NameImpl;
/**
* Test the JSR-181 annotation: javax.jws.SOAPBinding
@@ -106,9 +105,9 @@
SOAPMessage reqMsg = MessageFactory.newInstance().createMessage(null, new ByteArrayInputStream(reqEnv.getBytes()));
SOAPMessage resMsg = (SOAPMessage)dispatch.invoke(reqMsg);
- NameImpl name = new NameImpl(new QName(targetNS, "SubmitPOResponse"));
- SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(name).next();
- soapElement = (SOAPElement)soapElement.getChildElements(new NameImpl(new QName(targetNS, "product"))).next();
+ QName qname = new QName(targetNS, "SubmitPOResponse");
+ SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(qname).next();
+ soapElement = (SOAPElement)soapElement.getChildElements(new QName(targetNS, "product")).next();
assertEquals("Ferrari", soapElement.getValue());
}
@@ -137,9 +136,9 @@
SOAPMessage reqMsg = MessageFactory.newInstance().createMessage(null, new ByteArrayInputStream(reqEnv.getBytes()));
SOAPMessage resMsg = (SOAPMessage)dispatch.invoke(reqMsg);
- NameImpl name = new NameImpl(new QName(resultNamespace, "SubmitBareResponse"));
- SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(name).next();
- soapElement = (SOAPElement)soapElement.getChildElements(new NameImpl(new QName(targetNS, "product"))).next();
+ QName qname = new QName(resultNamespace, "SubmitBareResponse");
+ SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(qname).next();
+ soapElement = (SOAPElement)soapElement.getChildElements(new QName(targetNS, "product")).next();
assertEquals("Ferrari", soapElement.getValue());
}
@@ -181,10 +180,10 @@
SOAPMessage resMsg = (SOAPMessage) dispatch.invoke(reqMsg);
- NameImpl name = new NameImpl(new QName(targetNS, "SubmitPOResponse"));
- SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(name).next();
- soapElement = (SOAPElement)soapElement.getChildElements(new NameImpl(new QName("PurchaseOrderAck"))).next();
- soapElement = (SOAPElement)soapElement.getChildElements(new NameImpl(new QName(targetNS, "product"))).next();
+ QName qname = new QName(targetNS, "SubmitPOResponse");
+ SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(qname).next();
+ soapElement = (SOAPElement)soapElement.getChildElements(new QName("PurchaseOrderAck")).next();
+ soapElement = (SOAPElement)soapElement.getChildElements(new QName(targetNS, "product")).next();
assertEquals("Ferrari", soapElement.getValue());
}
@@ -214,10 +213,10 @@
SOAPMessage resMsg = con.call(reqMsg, epURL);
- NameImpl name = new NameImpl(new QName(targetNS, "SubmitNamespacedPOResponse"));
- SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(name).next();
- soapElement = (SOAPElement)soapElement.getChildElements(new NameImpl(new QName(resultNamespace, "NamespacedPurchaseOrderAck"))).next();
- soapElement = (SOAPElement)soapElement.getChildElements(new NameImpl(new QName(targetNS, "product"))).next();
+ QName qname = new QName(targetNS, "SubmitNamespacedPOResponse");
+ SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(qname).next();
+ soapElement = (SOAPElement)soapElement.getChildElements(new QName(resultNamespace, "NamespacedPurchaseOrderAck")).next();
+ soapElement = (SOAPElement)soapElement.getChildElements(new QName(targetNS, "product")).next();
assertEquals("Ferrari", soapElement.getValue());
}
}
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -42,7 +42,6 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.soap.NameImpl;
import org.jboss.wsf.spi.utils.DOMUtils;
import org.w3c.dom.Element;
@@ -93,9 +92,9 @@
URL epURL = new URL(endpointURL);
SOAPMessage resMsg = con.call(reqMsg, epURL);
- NameImpl name = new NameImpl(new QName(targetNS, "echoStringResponse"));
- SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(name).next();
- soapElement = (SOAPElement)soapElement.getChildElements(new NameImpl("return")).next();
+ QName qname = new QName(targetNS, "echoStringResponse");
+ SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(qname).next();
+ soapElement = (SOAPElement)soapElement.getChildElements(new QName("return")).next();
assertEquals("Hello", soapElement.getValue());
}
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -32,10 +32,6 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.StubExt;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
/**
* Test the JSR-181 annotation: javax.jws.WebParam
@@ -76,12 +72,6 @@
public void testPingOneWay() throws Exception
{
- StubExt stub = (StubExt)port;
- EndpointMetaData epMetaData = stub.getEndpointMetaData();
- OperationMetaData opMetaData = epMetaData.getOperation(new QName(targetNS, "PingOneWay"));
- ParameterMetaData param = opMetaData.getParameter(new QName("Ping"));
- assertNotNull ("Expected param", param);
-
PingDocument doc = new PingDocument();
doc.setContent("Hello Kermit");
port.pingOneWay(doc);
@@ -99,16 +89,6 @@
public void testSecurePing() throws Exception
{
- StubExt stub = (StubExt)port;
- EndpointMetaData epMetaData = stub.getEndpointMetaData();
- OperationMetaData opMetaData = epMetaData.getOperation(new QName(targetNS, "SecurePing"));
-
- ParameterMetaData param1 = opMetaData.getParameter(new QName("Ping"));
- assertNotNull ("Expected param", param1);
- ParameterMetaData param2 = opMetaData.getParameter(new QName(targetNS, "SecHeader"));
- assertNotNull ("Expected param", param2);
- assertTrue ("Expected header param", param2.isInHeader());
-
PingDocument doc = new PingDocument();
doc.setContent("Hello Kermit");
SecurityHeader secHeader = new SecurityHeader();
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -37,7 +37,6 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.soap.NameImpl;
/**
* Test the JSR-181 annotation: javax.jws.webresult
@@ -103,9 +102,9 @@
SOAPMessage resMsg = con.call(reqMsg, epURL);
- NameImpl name = new NameImpl(new QName(targetNS, "locateCustomerResponse"));
- SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(name).next();
- soapElement = (SOAPElement)soapElement.getChildElements(new NameImpl("CustomerRecord")).next();
+ QName qname = new QName(targetNS, "locateCustomerResponse");
+ SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(qname).next();
+ soapElement = (SOAPElement)soapElement.getChildElements(new QName("CustomerRecord")).next();
assertNotNull("Expected CustomerRecord", soapElement);
}
}
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/DHRequest.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/DHRequest.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/DHRequest.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -1,50 +1,52 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.test.ws.jaxws.samples.xop.doclit;
import javax.activation.DataHandler;
import javax.xml.bind.annotation.XmlMimeType;
import javax.xml.bind.annotation.XmlType;
-@XmlType(name="dataRequest", namespace = "http://org.jboss.ws/xop/doclit")
-public class DHRequest {
+@XmlType(name = "dataRequest", namespace = "http://org.jboss.ws/xop/doclit")
+public class DHRequest
+{
+ private DataHandler dataHandler;
-
- public DHRequest() {
+ public DHRequest()
+ {
}
-
- public DHRequest(DataHandler dataHandler) {
+ public DHRequest(DataHandler dataHandler)
+ {
this.dataHandler = dataHandler;
}
- private DataHandler dataHandler;
-
@XmlMimeType("image/jpeg")
- public DataHandler getDataHandler() {
+ public DataHandler getDataHandler()
+ {
return dataHandler;
}
- public void setDataHandler(DataHandler dataHandler) {
+ public void setDataHandler(DataHandler dataHandler)
+ {
this.dataHandler = dataHandler;
}
}
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMEndpointBean.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMEndpointBean.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMEndpointBean.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -25,12 +25,14 @@
import javax.activation.DataHandler;
import javax.jws.WebService;
+import javax.xml.ws.WebServiceException;
-import org.jboss.ws.WSException;
+import org.jboss.logging.Logger;
@WebService(name = "MTOMEndpoint", serviceName = "MTOMService", endpointInterface = "org.jboss.test.ws.jaxws.samples.xop.doclit.MTOMEndpoint")
public class MTOMEndpointBean implements MTOMEndpoint
{
+ private Logger log = Logger.getLogger(MTOMEndpointBean.class);
public DHResponse echoDataHandler(DHRequest request)
{
@@ -39,12 +41,12 @@
try
{
- System.out.println("Recv " + dataHandler.getContentType());
- System.out.println("Content is " + dataHandler.getContent());
+ log.info("Recv " + dataHandler.getContentType());
+ log.info("Content is " + dataHandler.getContent());
}
catch (IOException e)
{
- throw new WSException(e);
+ throw new WebServiceException(e);
}
return new DHResponse(request.getDataHandler());
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMProtocolHandler.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMProtocolHandler.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMProtocolHandler.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -1,44 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.test.ws.jaxws.samples.xop.doclit;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.wsf.spi.handler.GenericSOAPHandler;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPElementWriter;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.handler.GenericSOAPHandler;
+import org.jboss.wsf.spi.utils.DOMWriter;
+
/**
* A MTOM handler should see the conceptual payload,
* which means an inlined representation of the binary data.
*/
-class MTOMProtocolHandler extends GenericSOAPHandler
+public class MTOMProtocolHandler extends GenericSOAPHandler
{
private Logger log = Logger.getLogger(MTOMProtocolHandler.class);
- protected boolean handleOutbound(MessageContext msgContext) {
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
return dumpMessage(msgContext);
}
- protected boolean handleInbound(MessageContext msgContext) {
+ protected boolean handleInbound(MessageContext msgContext)
+ {
return dumpMessage(msgContext);
}
- private boolean dumpMessage(MessageContext context) {
+ private boolean dumpMessage(MessageContext context)
+ {
try
{
- CommonMessageContext msgContext = (CommonMessageContext)context;
- SOAPMessageImpl soapMsg = (SOAPMessageImpl)msgContext.getSOAPMessage();
- SOAPEnvelope soapReqEnv = soapMsg.getSOAPPart().getEnvelope();
- String xml = SOAPElementWriter.writeElement((SOAPElementImpl)soapReqEnv, true);
- log.info(xml.substring(0, 50)+"[...]");
+ SOAPMessageContext msgContext = (SOAPMessageContext)context;
+ SOAPMessage soapMsg = msgContext.getMessage();
+ SOAPEnvelope soapEnv = soapMsg.getSOAPPart().getEnvelope();
+ log.info(DOMWriter.printNode(soapEnv, true));
}
- catch (SOAPException e)
+ catch (SOAPException ex)
{
- //
+ throw new WebServiceException(ex);
}
return true;
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBase.java 2007-05-26 12:36:34 UTC (rev 3269)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBase.java 2007-05-26 14:22:48 UTC (rev 3270)
@@ -61,7 +61,7 @@
DataHandler dh = new DataHandler(imgFile.toURL());
DHResponse response = getPort().echoDataHandler(new DHRequest(dh));
assertNotNull(response);
- assertEquals(response.getDataHandler().getContentType(), "image/jpeg");
+ assertEquals("image/jpeg", response.getDataHandler().getContentType());
assertTrue(response.getDataHandler().getContent() instanceof BufferedImage);
}
@@ -72,7 +72,7 @@
DataHandler dh = new DataHandler(imgFile.toURL());
DHResponse response = getPort().echoDataHandler(new DHRequest(dh));
assertNotNull(response);
- assertEquals(response.getDataHandler().getContentType(), "application/octet-stream");
+ assertEquals("application/octet-stream", response.getDataHandler().getContentType());
assertTrue("Wrong java type returned", response.getDataHandler().getContent() instanceof InputStream);
}
17 years, 8 months
JBossWS SVN: r3269 - in trunk: integration/native/ant-import and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-26 08:36:34 -0400 (Sat, 26 May 2007)
New Revision: 3269
Added:
trunk/integration/native/src/main/java/org/
trunk/integration/native/src/main/java/org/jboss/
trunk/integration/native/src/main/java/org/jboss/wsf/
Removed:
trunk/jbossws-core/src/main/java/org/jboss/wsf/
Modified:
trunk/integration/native/ant-import/build-deploy.xml
trunk/integration/native/ant-import/build-thirdparty.xml
trunk/integration/native/build.xml
trunk/jbossws-core/build.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
Log:
Move native integration to integration/native
Modified: trunk/integration/native/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/native/ant-import/build-deploy.xml 2007-05-26 11:57:57 UTC (rev 3268)
+++ trunk/integration/native/ant-import/build-deploy.xml 2007-05-26 12:36:34 UTC (rev 3269)
@@ -20,7 +20,7 @@
<!-- ================================================================== -->
<!-- Deploy to jboss50 -->
- <target name="deploy-jboss50" depends="jars-native50,undeploy-jboss50" description="Deploy jbossws to jboss50">
+ <target name="deploy-jboss50" depends="jars-jboss50,undeploy-jboss50" description="Deploy jbossws to jboss50">
<ant antfile="${int.sunri.dir}/build.xml" target="undeploy-jboss50" inheritall="false"/>
<ant antfile="${int.xfire.dir}/build.xml" target="undeploy-jboss50" inheritall="false"/>
<macro-deploy-native50
@@ -37,7 +37,7 @@
</target>
<!-- Deploy to jboss42 -->
- <target name="deploy-jboss42" depends="jars-native42,undeploy-jboss42" description="Deploy jbossws to jboss42">
+ <target name="deploy-jboss42" depends="jars-jboss42,undeploy-jboss42" description="Deploy jbossws to jboss42">
<ant antfile="${int.sunri.dir}/build.xml" target="undeploy-jboss42" inheritall="false"/>
<ant antfile="${int.xfire.dir}/build.xml" target="undeploy-jboss42" inheritall="false"/>
<macro-deploy-native42
Modified: trunk/integration/native/ant-import/build-thirdparty.xml
===================================================================
--- trunk/integration/native/ant-import/build-thirdparty.xml 2007-05-26 11:57:57 UTC (rev 3268)
+++ trunk/integration/native/ant-import/build-thirdparty.xml 2007-05-26 12:36:34 UTC (rev 3269)
@@ -30,8 +30,22 @@
<target name="thirdparty-classpath" depends="thirdparty-init">
- <!-- The compile classpath for jboss50 integration -->
+ <path id="native.integration.classpath">
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
+ <pathelement location="${spi.dir}/thirdparty/activation.jar"/>
+ <pathelement location="${spi.dir}/thirdparty/dom4j.jar"/>
+ <pathelement location="${spi.dir}/thirdparty/jboss-common-core.jar"/>
+ <pathelement location="${spi.dir}/thirdparty/jboss-logging-spi.jar"/>
+ <pathelement location="${spi.dir}/thirdparty/servlet-api.jar"/>
+ <pathelement location="${core.dir}/output/lib/jbossws-core.jar"/>
+ <pathelement location="${core.dir}/output/lib/jboss-jaxrpc.jar"/>
+ <pathelement location="${core.dir}/output/lib/jboss-jaxws.jar"/>
+ <pathelement location="${core.dir}/output/lib/jboss-saaj.jar"/>
+ <pathelement location="${core.dir}/thirdparty/wsdl4j.jar"/>
+ </path>
+
<path id="native50.integration.classpath">
+ <path refid="native.integration.classpath"/>
</path>
</target>
Modified: trunk/integration/native/build.xml
===================================================================
--- trunk/integration/native/build.xml 2007-05-26 11:57:57 UTC (rev 3268)
+++ trunk/integration/native/build.xml 2007-05-26 12:36:34 UTC (rev 3269)
@@ -59,6 +59,12 @@
<!-- Compile java sources -->
<target name="compile-classes" depends="init">
+ <mkdir dir="${native.output.classes.dir}"/>
+ <javac srcdir="${native.java.dir}" sourcepath="" destdir="${native.output.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
+ deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
+ <include name="org/jboss/wsf/stack/jbws/**"/>
+ <classpath refid="native.integration.classpath"/>
+ </javac>
</target>
<!-- Compile etc files (manifests and such) -->
@@ -88,11 +94,40 @@
<!--
| Build all jar files.
-->
- <target name="jars" depends="compile,jars-native42,jars-native50" description="Builds all jar files.">
+ <target name="jars" depends="compile,jars-jboss42,jars-jboss50" description="Builds all jar files.">
</target>
- <target name="jars-native50" depends="compile" if="jboss50.home">
+ <target name="jars-common" depends="compile">
+ <!-- Build jbossws-native.jar -->
+ <mkdir dir="${native.output.lib.dir}"/>
+ <jar jarfile="${native.output.lib.dir}/jbossws-native.jar" manifest="${native.output.etc.dir}/default.mf">
+ <fileset dir="${native.output.classes.dir}">
+ <include name="org/jboss/wsf/stack/jbws/**"/>
+ </fileset>
+ </jar>
+
+ <!-- Build jbossws-context.war -->
+ <mkdir dir="${native.output.lib.dir}"/>
+ <war warfile="${native.output.lib.dir}/jbossws-context.war" webxml="${native.resources.dir}/jbossws-context.war/WEB-INF/web.xml">
+ <fileset dir="${native.resources.dir}/jbossws-context.war">
+ <include name="index.html"/>
+ <include name="styles.css"/>
+ </fileset>
+ <webinf dir="${native.resources.dir}/jbossws-context.war/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
+
+ <!-- Build jbossws-native-src.zip -->
+ <zip zipfile="${native.output.lib.dir}/jbossws-native-src.zip" >
+ <fileset dir="${native.java.dir}"/>
+ </zip>
+
+ </target>
+
+ <target name="jars-jboss50" depends="jars-common" if="jboss50.home">
+
<ant antfile="${int.jboss50.dir}/build.xml" target="jars" inheritall="false"/>
<!-- Build jbossws-context.war -->
@@ -133,14 +168,16 @@
<!-- Build jbossws-native50.deployer -->
<zip zipfile="${native.output.lib.dir}/jbossws-native50-deployer.zip">
+ <fileset dir="${native.output.lib.dir}">
+ <include name="jbossws-native.jar"/>
+ </fileset>
<fileset dir="${native.resources.dir}/jbossws-native50.deployer">
<include name="META-INF/jbossws-deployer-beans.xml"/>
</fileset>
</zip>
-
- </target>
+ </target>
- <target name="jars-native42" depends="compile" if="jboss42.home">
+ <target name="jars-jboss42" depends="jars-common" if="jboss42.home">
<ant antfile="${int.jboss42.dir}/build.xml" target="jars" inheritall="false"/>
@@ -149,6 +186,7 @@
<jar jarfile="${native.output.lib.dir}/jbossws-native42.sar" manifest="${native.output.etc.dir}/default.mf">
<fileset dir="${native.output.lib.dir}">
<include name="jbossws-context.war"/>
+ <include name="jbossws-native.jar"/>
</fileset>
<fileset dir="${core.dir}/output/lib">
<include name="jboss-jaxws.jar"/>
Copied: trunk/integration/native/src/main/java/org/jboss/wsf (from rev 3266, trunk/jbossws-core/src/main/java/org/jboss/wsf)
Modified: trunk/jbossws-core/build.xml
===================================================================
--- trunk/jbossws-core/build.xml 2007-05-26 11:57:57 UTC (rev 3268)
+++ trunk/jbossws-core/build.xml 2007-05-26 12:36:34 UTC (rev 3269)
@@ -79,7 +79,6 @@
<include name="javax/xml/ws/**"/>
<include name="javax/jws/**"/>
<include name="org/jboss/annotation/**"/>
- <include name="org/jboss/wsf/**"/>
<include name="org/jboss/ws/**"/>
<classpath path="${core.output.classes14.dir}"/>
<classpath refid="thirdparty.classpath"/>
@@ -153,7 +152,6 @@
<jar jarfile="${core.output.lib.dir}/jbossws-core.jar" manifest="${core.output.etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/annotation/**"/>
- <include name="org/jboss/wsf/**"/>
<include name="org/jboss/ws/**"/>
</fileset>
<fileset dir="${core.resources.dir}">
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2007-05-26 11:57:57 UTC (rev 3268)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2007-05-26 12:36:34 UTC (rev 3269)
@@ -30,10 +30,9 @@
import java.util.StringTokenizer;
import org.jboss.logging.Logger;
+import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.integration.UnifiedVirtualFile;
-import org.jboss.wsf.stack.jbws.ManagedEndpointRegistry;
/**
* The top level meta data.
@@ -200,7 +199,7 @@
{
if (implementationVersion == null)
{
- implementationVersion = ManagedEndpointRegistry.class.getPackage().getImplementationVersion();
+ implementationVersion = UnifiedMetaData.class.getPackage().getImplementationVersion();
if (implementationVersion != null)
isFinalRelease = new StringTokenizer(implementationVersion).nextToken().endsWith(".GA");
}
17 years, 8 months
JBossWS SVN: r3268 - in trunk: integration/sunri/ant-import and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-26 07:57:57 -0400 (Sat, 26 May 2007)
New Revision: 3268
Modified:
trunk/integration/native/ant-import/build-testsuite.xml
trunk/integration/sunri/ant-import/build-testsuite.xml
trunk/integration/xfire/ant-import/build-testsuite.xml
trunk/jbossws-core/ant-import-tests/build-testsuite.xml
Log:
Include testsuite jaxws samples in core testsuite
Modified: trunk/integration/native/ant-import/build-testsuite.xml
===================================================================
--- trunk/integration/native/ant-import/build-testsuite.xml 2007-05-26 11:44:22 UTC (rev 3267)
+++ trunk/integration/native/ant-import/build-testsuite.xml 2007-05-26 11:57:57 UTC (rev 3268)
@@ -13,6 +13,10 @@
<property name="tests.output.dir" value="${int.native.dir}/output-tests"/>
<import file="${testsuite.dir}/ant-import/build-testsuite.xml"/>
+ <property name="tests.dir" value="${testsuite.dir}/src"/>
+ <property name="tests.java.dir" value="${tests.dir}/java"/>
+ <property name="tests.resources.dir" value="${tests.dir}/resources"/>
+
<!-- Define excludesfile -->
<condition property="excludesfile" value="${int.native.dir}/src/test/resources/excludes-jboss50.txt">
<equals arg1="${jbossws.integration.target}" arg2="jboss50"/>
Modified: trunk/integration/sunri/ant-import/build-testsuite.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-testsuite.xml 2007-05-26 11:44:22 UTC (rev 3267)
+++ trunk/integration/sunri/ant-import/build-testsuite.xml 2007-05-26 11:57:57 UTC (rev 3268)
@@ -13,6 +13,10 @@
<property name="tests.output.dir" value="${int.sunri.dir}/output-tests"/>
<import file="${testsuite.dir}/ant-import/build-testsuite.xml"/>
+ <property name="tests.dir" value="${testsuite.dir}/src"/>
+ <property name="tests.java.dir" value="${tests.dir}/java"/>
+ <property name="tests.resources.dir" value="${tests.dir}/resources"/>
+
<!-- Define excludesfile -->
<condition property="excludesfile" value="${int.sunri.dir}/src/test/resources/excludes-jboss50.txt">
<equals arg1="${jbossws.integration.target}" arg2="jboss50"/>
Modified: trunk/integration/xfire/ant-import/build-testsuite.xml
===================================================================
--- trunk/integration/xfire/ant-import/build-testsuite.xml 2007-05-26 11:44:22 UTC (rev 3267)
+++ trunk/integration/xfire/ant-import/build-testsuite.xml 2007-05-26 11:57:57 UTC (rev 3268)
@@ -13,6 +13,10 @@
<property name="tests.output.dir" value="${int.xfire.dir}/output-tests"/>
<import file="${testsuite.dir}/ant-import/build-testsuite.xml"/>
+ <property name="tests.dir" value="${testsuite.dir}/src"/>
+ <property name="tests.java.dir" value="${tests.dir}/java"/>
+ <property name="tests.resources.dir" value="${tests.dir}/resources"/>
+
<!-- Define excludesfile -->
<condition property="excludesfile" value="${int.xfire.dir}/src/test/resources/excludes-jboss50.txt">
<equals arg1="${jbossws.integration.target}" arg2="jboss50"/>
Modified: trunk/jbossws-core/ant-import-tests/build-testsuite.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-26 11:44:22 UTC (rev 3267)
+++ trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-26 11:57:57 UTC (rev 3268)
@@ -10,12 +10,13 @@
<project>
+ <property name="tests.output.dir" value="${core.dir}/output-tests"/>
+ <import file="${build.dir}/ant-import/build-testsuite.xml"/>
+
<property name="tests.dir" value="${core.dir}/src/test"/>
+ <property name="tests.java.dir" value="${tests.dir}/java"/>
<property name="tests.resources.dir" value="${tests.dir}/resources"/>
- <property name="tests.output.dir" value="${core.dir}/output-tests"/>
- <import file="${build.dir}/ant-import/build-testsuite.xml"/>
-
<!-- Define excluded tests -->
<property name="excludes-short-name" value="tests-${jbossws.integration.target}-excludes.txt"/>
<property name="excludesfile" value="${core.dir}/src/test/resources/${excludes-short-name}"/>
17 years, 8 months