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="(a){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="(a){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...;,
"j2ee_web_services_client_1_1.xsd");
registerEntity("http://www.ibm.com/webservices/xsd/j2ee_web_services...;,
"j2ee_web_services_1_1.xsd");
registerEntity("http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mappi...;,
"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...
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...
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