JBossWS SVN: r5954 - in stack/cxf/trunk: ant-import and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-03-13 07:24:53 -0400 (Thu, 13 Mar 2008)
New Revision: 5954
Added:
stack/cxf/trunk/ant-import/build-prepare-deploy.xml
stack/cxf/trunk/ant-import/jbossws-deploy-macros.xml
Removed:
stack/cxf/trunk/ant-import/macros-deploy-cxf.xml
stack/cxf/trunk/src/main/distro/bin-dist-deploy.xml
Modified:
stack/cxf/trunk/ant-import/build-bin-dist.xml
stack/cxf/trunk/ant-import/build-deploy.xml
stack/cxf/trunk/ant-import/build-thirdparty.xml
stack/cxf/trunk/build.xml
stack/cxf/trunk/src/main/distro/ant.properties.example
stack/cxf/trunk/src/main/distro/bin-dist-build.xml
Log:
Align deploy steps with native
Modified: stack/cxf/trunk/ant-import/build-bin-dist.xml
===================================================================
--- stack/cxf/trunk/ant-import/build-bin-dist.xml 2008-03-13 08:42:17 UTC (rev 5953)
+++ stack/cxf/trunk/ant-import/build-bin-dist.xml 2008-03-13 11:24:53 UTC (rev 5954)
@@ -17,19 +17,18 @@
<!-- Binary distribution -->
<!-- ================================================================== -->
- <target name="build-bin-dist" depends="jars, javadoc" description="Build the binary distribution">
+ <target name="build-bin-dist" depends="jars,javadoc,prepare-deploy" description="Build the binary distribution">
<property name="bindist.dir" value="${cxf.output.dir}/jbossws-cxf-dist"/>
<property name="bindist.build.dir" value="${bindist.dir}/build"/>
- <property name="bindist.bin.dir" value="${bindist.dir}/bin"/>
- <property name="bindist.lib.dir" value="${bindist.dir}/lib"/>
+ <property name="bindist.deploy.dir" value="${bindist.dir}/deploy"/>
<property name="bindist.docs.dir" value="${bindist.dir}/docs"/>
<property name="bindist.tests.dir" value="${bindist.dir}/tests"/>
<property name="bindist.tools.dir" value="${bindist.dir}/tools"/>
<delete dir="${bindist.dir}"/>
<mkdir dir="${bindist.build.dir}"/>
- <mkdir dir="${bindist.bin.dir}"/>
+ <mkdir dir="${bindist.deploy.dir}"/>
<mkdir dir="${bindist.docs.dir}"/>
<mkdir dir="${bindist.tests.dir}"/>
<mkdir dir="${bindist.tools.dir}"/>
@@ -42,27 +41,21 @@
</copy>
<copy tofile="${bindist.dir}/version.properties" file="${cxf.dir}/version.properties"/>
<copy tofile="${bindist.dir}/build.xml" file="${cxf.distro.dir}/bin-dist-build.xml"/>
- <copy tofile="${bindist.build.dir}/build-deploy.xml" file="${cxf.distro.dir}/bin-dist-deploy.xml"/>
<!-- build -->
<copy todir="${bindist.build.dir}">
<fileset dir="${cxf.dir}/ant-import">
- <include name="jbossws.default.undeploy.files"/>
- <include name="macros-deploy-cxf.xml"/>
+ <include name="build-deploy.xml"/>
+ <include name="jbossws-deploy-macros.xml"/>
+ <include name="jbossws-default-deploy.conf"/>
</fileset>
</copy>
- <unzip dest="${bindist.bin.dir}" src="${thirdparty.dir}/jbossws-framework-scripts.zip"/>
+ <!-- deploy -->
+ <copy todir="${bindist.deploy.dir}">
+ <fileset dir="${deploy.artifacts.dir}"/>
+ </copy>
- <copy todir="${bindist.bin.dir}">
- <fileset dir="${cxf.dir}/src/main/etc">
- <include name="*.sh"/>
- <include name="*.bat"/>
- </fileset>
- </copy>
-
- <chmod dir="${bindist.bin.dir}" perm="+x" includes="**/*.sh"/>
-
<!-- docs -->
<copy todir="${bindist.docs.dir}" >
<fileset dir="${cxf.output.dir}">
@@ -85,41 +78,6 @@
</fileset>
</copy>
- <!-- lib -->
- <copy todir="${bindist.lib.dir}" overwrite="true">
- <fileset dir="${thirdparty.dir}">
- <include name="jbossws-common.jar"/>
- <include name="jbossws-framework.jar"/>
- <include name="jbossws-framework-scripts.zip"/>
- <include name="jbossws-spi.jar"/>
- </fileset>
- <fileset dir="${cxf.dir}/output/lib">
- <include name="jbossws-context.war/**"/>
- <include name="jbossws-cxf.jar"/>
- <include name="jbossws-cxf-client.jar"/>
- <include name="jbossws-cxf42.sar"/>
- <include name="jbossws-cxf50.sar"/>
- </fileset>
- <fileset dir="${thirdparty.dir}">
- <include name="juddi-service.sar"/>
- <include name="cxf-${cxf.version}.jar"/>
- <include name="geronimo-javamail_${cxf.geronimo.javamail}.jar"/>
- <include name="geronimo-ws-metadata_${cxf.geronimo.ws.metadata}.jar"/>
- <include name="jaxws-api-${cxf.jaxws.api}.jar"/>
- <include name="jdom-${cxf.jdom}.jar"/>
- <include name="neethi-${cxf.neethi}.jar"/>
- <include name="saaj-api-${cxf.saaj}.jar"/>
- <include name="saaj-impl-${cxf.saaj}.jar"/>
- <include name="xml-resolver-${cxf.xml.resolver}.jar"/>
- <include name="XmlSchema-${cxf.xmlschema}.jar"/>
- <include name="jaxb-api.jar"/>
- <include name="jaxb-impl.jar"/>
- <include name="jaxb-xjc.jar"/>
- <include name="wsdl4j.jar"/>
- <include name="wstx.jar"/>
- </fileset>
- </copy>
-
<!-- tests -->
<copy todir="${bindist.tests.dir}" overwrite="true">
<fileset dir="${cxf.dir}/src/test-framework"/>
Modified: stack/cxf/trunk/ant-import/build-deploy.xml
===================================================================
--- stack/cxf/trunk/ant-import/build-deploy.xml 2008-03-13 08:42:17 UTC (rev 5953)
+++ stack/cxf/trunk/ant-import/build-deploy.xml 2008-03-13 11:24:53 UTC (rev 5954)
@@ -12,58 +12,123 @@
<!-- $Id$ -->
<project>
-
- <import file="${int.cxf.dir}/ant-import/macros-deploy-cxf.xml"/>
-
- <property name="deploy.dir" value="${int.cxf.dir}/output/deploy"/>
- <property name="jbossws.default.undeploy.files" value="${int.cxf.dir}/ant-import/jbossws-default-deploy.conf"/>
<!-- ================================================================== -->
- <!-- Deployment JBoss422 -->
+ <!-- Prepare Deployment Structure JBoss-4.2.x -->
<!-- ================================================================== -->
-
- <target name="deploy-jboss422" depends="jars-jboss42,undeploy-jboss422" description="Deploy jbossws/cxf to jboss42">
- <macro-deploy-cxf422 stacklibs="${int.cxf.dir}/output/lib" thirdpartylibs="${int.cxf.dir}/thirdparty"/>
+
+ <target name="deploy-structure-jboss42" depends="prepare-deploy">
+ <delete dir="${deploy.structure.jboss42}"/>
+ <antcall target="deploy-jbossws-cxf42" inheritall="false">
+ <param name="installserver" value="${deploy.structure.jboss42}/server/${jboss.server.instance}"/>
+ <param name="resourcesdir" value="${deploy.artifacts.dir}/resources/jbossws-jboss42.sar"/>
+ <param name="thirdpartydir" value="${deploy.artifacts.dir}"/>
+ </antcall>
+ <macro-create-deploy-conf deploystructure="${deploy.structure.jboss42}"/>
</target>
+
+ <!-- ================================================================== -->
+ <!-- Deployment JBoss422 -->
+ <!-- ================================================================== -->
- <target name="undeploy-jboss422" depends="prepare" description="Remove jbossws/cxf from jboss42">
- <macro-undeploy-cxf422/>
+ <target name="deploy-jboss422" depends="undeploy-jboss422,deploy-structure-jboss42" description="Deploy jbossws to jboss422">
+ <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
+ <copy todir="${jboss422.home}" overwrite="true">
+ <fileset dir="${deploy.structure.jboss42}"/>
+ </copy>
+ <unzip dest="${jboss422.server.deploy}/juddi-service.sar" src="${deploy.artifacts.dir}/lib/juddi-service.sar"/>
+ <chmod dir="${jboss422.home}/bin" perm="+x" includes="*.sh"/>
</target>
+
+ <target name="undeploy-jboss422" depends="prepare" description="Remove jbossws from jboss422">
+ <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
+ <macro-undeploy-jbossws targetdir="${jboss422.server.deploy}/jbossws.sar" defaultconf="${jbossws.default.deploy.conf}"/>
+ <delete dir="${jboss422.server.deploy}/juddi-service.sar"/>
+ </target>
<!-- ================================================================== -->
- <!-- Deployment JBoss423 -->
+ <!-- Deployment JBoss423 -->
<!-- ================================================================== -->
- <target name="deploy-jboss423" depends="jars-jboss42,undeploy-jboss423" description="Deploy jbossws/cxf to jboss42">
- <macro-deploy-cxf423 stacklibs="${int.cxf.dir}/output/lib" thirdpartylibs="${int.cxf.dir}/thirdparty"/>
+ <target name="deploy-jboss423" depends="undeploy-jboss423,deploy-structure-jboss42" description="Deploy jbossws to jboss423">
+ <fail message="Not available: ${jboss423.available.file}" unless="jboss423.available"/>
+ <copy todir="${jboss423.home}" overwrite="true">
+ <fileset dir="${deploy.structure.jboss42}"/>
+ </copy>
+ <unzip dest="${jboss423.server.deploy}/juddi-service.sar" src="${deploy.artifacts.dir}/lib/juddi-service.sar"/>
+ <chmod dir="${jboss423.home}/bin" perm="+x" includes="*.sh"/>
</target>
-
- <target name="undeploy-jboss423" depends="prepare" description="Remove jbossws/cxf from jboss42">
- <macro-undeploy-cxf423/>
+
+ <target name="undeploy-jboss423" depends="prepare" description="Remove jbossws from jboss423">
+ <fail message="Not available: ${jboss423.available.file}" unless="jboss423.available"/>
+ <macro-undeploy-jbossws targetdir="${jboss423.server.deploy}/jbossws.sar" defaultconf="${jbossws.default.deploy.conf}"/>
+ <delete dir="${jboss423.server.deploy}/juddi-service.sar"/>
</target>
-
+
<!-- ================================================================== -->
- <!-- Deployment JBoss500 -->
+ <!-- Prepare Deployment Structure JBoss-5.0.x -->
<!-- ================================================================== -->
-
- <target name="deploy-jboss500" depends="jars-jboss50,undeploy-jboss500" description="Deploy jbossws/cxf to jboss50">
- <macro-deploy-cxf500 stacklibs="${int.cxf.dir}/output/lib" thirdpartylibs="${int.cxf.dir}/thirdparty"/>
+
+ <target name="deploy-structure-jboss50" depends="prepare-deploy">
+ <delete dir="${deploy.structure.jboss50}"/>
+ <antcall target="deploy-jbossws-cxf50" inheritall="false">
+ <param name="installserver" value="${deploy.structure.jboss50}/server/${jboss.server.instance}"/>
+ <param name="thirdpartydir" value="${deploy.artifacts.dir}"/>
+ </antcall>
+ <macro-create-deploy-conf deploystructure="${deploy.structure.jboss50}"/>
</target>
+
+ <!-- ================================================================== -->
+ <!-- Deployment JBoss500 -->
+ <!-- ================================================================== -->
- <target name="undeploy-jboss500" depends="prepare" description="Remove jbossws/cxf from jboss50">
- <macro-undeploy-cxf500/>
+ <target name="deploy-jboss500" depends="undeploy-jboss500,deploy-structure-jboss50" description="Deploy jbossws to jboss500">
+ <fail message="Not available: ${jboss500.available.file}" unless="jboss500.available"/>
+ <copy todir="${jboss500.home}" overwrite="true">
+ <fileset dir="${deploy.structure.jboss50}"/>
+ </copy>
+ <unzip dest="${jboss500.server.deploy}/juddi-service.sar" src="${deploy.artifacts.dir}/lib/juddi-service.sar"/>
+ <chmod dir="${jboss500.home}/bin" perm="+x" includes="*.sh"/>
</target>
-
+
+ <target name="undeploy-jboss500" depends="prepare" description="Remove jbossws from jboss500">
+ <fail message="Not available: ${jboss500.available.file}" unless="jboss500.available"/>
+ <macro-undeploy-jbossws targetdir="${jboss500.server.deploy}/jbossws.sar" defaultconf="${jbossws.default.deploy.conf}"/>
+ <delete dir="${jboss500.server.deploy}/juddi-service.sar"/>
+ </target>
+
<!-- ================================================================== -->
- <!-- Deployment JBoss501 -->
+ <!-- Deployment JBoss501 -->
<!-- ================================================================== -->
- <target name="deploy-jboss501" depends="jars-jboss50,undeploy-jboss501" description="Deploy jbossws/cxf to jboss50">
- <macro-deploy-cxf501 stacklibs="${int.cxf.dir}/output/lib" thirdpartylibs="${int.cxf.dir}/thirdparty"/>
+ <target name="deploy-jboss501" depends="undeploy-jboss501,deploy-structure-jboss50" description="Deploy jbossws to jboss501">
+ <fail message="Not available: ${jboss501.available.file}" unless="jboss501.available"/>
+ <copy todir="${jboss501.home}" overwrite="true">
+ <fileset dir="${deploy.structure.jboss50}"/>
+ </copy>
+ <unzip dest="${jboss501.server.deploy}/juddi-service.sar" src="${deploy.artifacts.dir}/lib/juddi-service.sar"/>
+ <chmod dir="${jboss501.home}/bin" perm="+x" includes="*.sh"/>
</target>
-
- <target name="undeploy-jboss501" depends="prepare" description="Remove jbossws/cxf from jboss50">
- <macro-undeploy-cxf501/>
+
+ <target name="undeploy-jboss501" depends="prepare" description="Remove jbossws from jboss501">
+ <fail message="Not available: ${jboss501.available.file}" unless="jboss501.available"/>
+ <macro-undeploy-jbossws targetdir="${jboss501.server.deploy}/jbossws.sar" defaultconf="${jbossws.default.deploy.conf}"/>
+ <delete dir="${jboss501.server.deploy}/juddi-service.sar"/>
</target>
-
+
+ <!-- ================================================================== -->
+ <!-- Create jbossws-deploy.conf -->
+ <!-- ================================================================== -->
+
+ <macrodef name="macro-create-deploy-conf">
+ <attribute name="deploystructure"/>
+ <sequential>
+ <fileset id="jbossws.deploy.fileset" dir="@{deploystructure}" excludes="**/jbossws.sar/**"/>
+ <property name="jbossws.deploy.fileset" refid="jbossws.deploy.fileset"/>
+ <property name="jbossws.sar.dir" value="@{deploystructure}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
+ <echo file="${jbossws.sar.dir}/jbossws-deploy.conf" message="${jbossws.deploy.fileset}"/>
+ <replace file="${jbossws.sar.dir}/jbossws-deploy.conf" token=";" value=" "/>
+ </sequential>
+ </macrodef>
+
</project>
Added: stack/cxf/trunk/ant-import/build-prepare-deploy.xml
===================================================================
--- stack/cxf/trunk/ant-import/build-prepare-deploy.xml (rev 0)
+++ stack/cxf/trunk/ant-import/build-prepare-deploy.xml 2008-03-13 11:24:53 UTC (rev 5954)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
+<project>
+
+ <!-- ================================================================== -->
+ <!-- Prepare Deployment Source -->
+ <!-- ================================================================== -->
+
+ <target name="prepare-deploy" depends="jars">
+
+ <delete dir="${deploy.artifacts.dir}"/>
+
+ <unzip dest="${deploy.artifacts.dir}/bin" src="${thirdparty.dir}/jbossws-framework-scripts.zip"/>
+ <copy todir="${deploy.artifacts.dir}/lib">
+ <fileset dir="${thirdparty.dir}">
+ <patternset refid="jbossws.client.patternset"/>
+ <patternset refid="jbossws.lib.patternset"/>
+ <patternset refid="jbossws.lib.endorsed.patternset"/>
+ <patternset refid="jbossws.server.lib.patternset"/>
+ <patternset refid="jbossws.service.lib.patternset"/>
+ <include name="juddi-service.sar"/>
+ </fileset>
+ <fileset dir="${cxf.output.lib.dir}">
+ <patternset refid="jbossws.client.patternset"/>
+ <patternset refid="jbossws.lib.patternset"/>
+ <patternset refid="jbossws.lib.endorsed.patternset"/>
+ <patternset refid="jbossws.server.lib.patternset"/>
+ <patternset refid="jbossws.service.lib.patternset"/>
+ </fileset>
+ </copy>
+ <copy todir="${deploy.artifacts.dir}/resources">
+ <fileset dir="${cxf.output.resources.dir}">
+ <include name="jbossws-cxf42-beans.xml"/>
+ <include name="jbossws-cxf50-beans.xml"/>
+ <include name="jbossws-jboss42.sar/**"/>
+ <include name="jbossws-cxf.sar/**"/>
+ </fileset>
+ </copy>
+ </target>
+
+</project>
Property changes on: stack/cxf/trunk/ant-import/build-prepare-deploy.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/trunk/ant-import/build-thirdparty.xml
===================================================================
--- stack/cxf/trunk/ant-import/build-thirdparty.xml 2008-03-13 08:42:17 UTC (rev 5953)
+++ stack/cxf/trunk/ant-import/build-thirdparty.xml 2008-03-13 11:24:53 UTC (rev 5954)
@@ -134,7 +134,7 @@
</target>
<!-- SVN update the Apache CXF sources -->
- <target name="cxf-update-required" depends="thirdparty-init" if="apache.cxf.available">
+ <target name="cxf-update-required" depends="thirdparty-init" if="apache.cxf.available" unless="skip-cxf-update">
<exec dir="${apache.cxf.dir}" executable="svn" failonerror="true" output="${apache.cxf.dir}/svn-info.xml">
<arg line="info"/>
<arg line="--xml"/>
Copied: stack/cxf/trunk/ant-import/jbossws-deploy-macros.xml (from rev 5919, stack/cxf/trunk/ant-import/macros-deploy-cxf.xml)
===================================================================
--- stack/cxf/trunk/ant-import/jbossws-deploy-macros.xml (rev 0)
+++ stack/cxf/trunk/ant-import/jbossws-deploy-macros.xml 2008-03-13 11:24:53 UTC (rev 5954)
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
+<project>
+
+ <!--
+ These patterns should be common for all supported containers.
+ All jars must also be declared in component-info.xml to ensure
+ that the AS build uses the same version.
+ -->
+ <patternset id="jbossws.bin.patternset">
+ <include name="**/wsconsume.bat"/>
+ <include name="**/wsconsume.sh"/>
+ <include name="**/wsprovide.bat"/>
+ <include name="**/wsprovide.sh"/>
+ </patternset>
+
+ <patternset id="jbossws.client.patternset">
+ <include name="**/jbossws-common.jar"/>
+ <include name="**/jbossws-framework.jar"/>
+ <include name="**/jbossws-spi.jar"/>
+ <include name="**/jaxb-api.jar"/>
+ <include name="**/jaxb-impl.jar"/>
+ <include name="**/jaxb-xjc.jar"/>
+ <include name="**/jaxws-api-${cxf.jaxws.api}.jar"/>
+ <include name="**/saaj-api-${cxf.saaj}.jar"/>
+ </patternset>
+
+ <patternset id="jbossws.lib.patternset">
+ <include name="**/jaxb-api.jar"/>
+ <include name="**/jaxb-impl.jar"/>
+ </patternset>
+
+ <patternset id="jbossws.lib.endorsed.patternset">
+ <include name="**/jboss-jaxrpc.jar"/>
+ <include name="**/jboss-jaxws.jar"/>
+ <include name="**/jboss-jaxws-ext.jar"/>
+ <include name="**/jboss-saaj.jar"/>
+ <include name="**/jaxb-api.jar"/>
+ </patternset>
+
+ <patternset id="jbossws.server.lib.patternset">
+ <include name="**/jbossws-common.jar"/>
+ <include name="**/jbossws-framework.jar"/>
+ <include name="**/jbossws-spi.jar"/>
+ <include name="**/jaxws-api-${cxf.jaxws.api}.jar"/>
+ <include name="**/saaj-api-${cxf.saaj}.jar"/>
+ </patternset>
+
+ <patternset id="jbossws.service.lib.patternset">
+ <include name="**/cxf-${cxf.version}.jar"/>
+ <include name="**/jbossws-cxf.jar"/>
+ <include name="**/geronimo-javamail_${cxf.geronimo.javamail}.jar"/>
+ <include name="**/geronimo-ws-metadata_${cxf.geronimo.ws.metadata}.jar"/>
+ <include name="**/jaxws-api-${cxf.jaxws.api}.jar"/>
+ <include name="**/jdom-${cxf.jdom}.jar"/>
+ <include name="**/neethi-${cxf.neethi}.jar"/>
+ <include name="**/saaj-api-${cxf.saaj}.jar"/>
+ <include name="**/saaj-impl-${cxf.saaj}.jar"/>
+ <include name="**/spring-beans-${cxf.spring}.jar"/>
+ <include name="**/spring-context-${cxf.spring}.jar"/>
+ <include name="**/spring-core-${cxf.spring}.jar"/>
+ <include name="**/xbean-${cxf.xbean}.jar"/>
+ <include name="**/xml-resolver-${cxf.xml.resolver}.jar"/>
+ <include name="**/XmlSchema-${cxf.xmlschema}.jar"/>
+ <include name="**/jaxb-api.jar"/>
+ <include name="**/jaxb-impl.jar"/>
+ <include name="**/jaxrpc-api.jar"/>
+ <include name="**/stax-api.jar"/>
+ <include name="**/wsdl4j.jar"/>
+ <include name="**/wstx.jar"/>
+ </patternset>
+
+ <!-- ================================================================== -->
+ <!-- Deploy Bin -->
+ <!-- ================================================================== -->
+
+ <macrodef name="macro-deploy-jbossws-bin">
+ <attribute name="thirdpartydir"/>
+ <attribute name="targetdir"/>
+ <sequential>
+ <mkdir dir="@{targetdir}"/>
+ <copy todir="@{targetdir}" flatten="true" overwrite="true">
+ <fileset dir="@{thirdpartydir}">
+ <patternset refid="jbossws.bin.patternset"/>
+ </fileset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <!-- ================================================================== -->
+ <!-- Deploy Lib -->
+ <!-- ================================================================== -->
+
+ <macrodef name="macro-deploy-jbossws-lib">
+ <attribute name="thirdpartydir"/>
+ <attribute name="targetdir"/>
+ <sequential>
+ <mkdir dir="@{targetdir}"/>
+ <copy todir="@{targetdir}" flatten="true" overwrite="true">
+ <fileset dir="@{thirdpartydir}">
+ <patternset refid="jbossws.lib.patternset"/>
+ </fileset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <!-- ================================================================== -->
+ <!-- Deploy Lib Endorsed -->
+ <!-- ================================================================== -->
+
+ <macrodef name="macro-deploy-jbossws-endorsed">
+ <attribute name="thirdpartydir"/>
+ <attribute name="targetdir"/>
+ <sequential>
+ <mkdir dir="@{targetdir}"/>
+ <copy todir="@{targetdir}" flatten="true" overwrite="true">
+ <fileset dir="@{thirdpartydir}">
+ <patternset refid="jbossws.lib.endorsed.patternset"/>
+ </fileset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <!-- ================================================================== -->
+ <!-- Deploy Client -->
+ <!-- ================================================================== -->
+
+ <macrodef name="macro-deploy-jbossws-client">
+ <attribute name="thirdpartydir"/>
+ <attribute name="targetdir"/>
+ <sequential>
+ <mkdir dir="@{targetdir}"/>
+ <copy todir="@{targetdir}" flatten="true" overwrite="true">
+ <fileset dir="@{thirdpartydir}">
+ <patternset refid="jbossws.client.patternset"/>
+ </fileset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <!-- ================================================================== -->
+ <!-- Deploy Server Lib -->
+ <!-- ================================================================== -->
+
+ <macrodef name="macro-deploy-jbossws-server-lib">
+ <attribute name="thirdpartydir"/>
+ <attribute name="targetdir"/>
+ <sequential>
+ <mkdir dir="@{targetdir}"/>
+ <copy todir="@{targetdir}" flatten="true" overwrite="true">
+ <fileset dir="@{thirdpartydir}">
+ <patternset refid="jbossws.server.lib.patternset"/>
+ </fileset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <!-- ================================================================== -->
+ <!-- Deploy JBossWS Service -->
+ <!-- ================================================================== -->
+
+ <macrodef name="macro-deploy-jbossws-cxf42-sar">
+ <attribute name="thirdpartydir"/>
+ <attribute name="resourcesdir"/>
+ <attribute name="targetdir"/>
+ <sequential>
+ <mkdir dir="@{targetdir}"/>
+ <copy todir="@{targetdir}" flatten="true">
+ <fileset dir="@{thirdpartydir}">
+ <patternset refid="jbossws.service.lib.patternset"/>
+ <include name="**/jbossws-deploy.conf"/>
+ <include name="**/jaxb-api.jar"/>
+ <include name="**/jaxb-impl.jar"/>
+ </fileset>
+ </copy>
+ <unzip dest="@{targetdir}/jbossws-context.war">
+ <fileset dir="@{thirdpartydir}">
+ <include name="**/jbossws-context.war"/>
+ </fileset>
+ </unzip>
+ <copy todir="@{targetdir}/jbossws.beans/META-INF" flatten="true">
+ <fileset dir="@{thirdpartydir}">
+ <include name="**/jbossws-cxf42-beans.xml"/>
+ </fileset>
+ </copy>
+ <move file="@{targetdir}/jbossws.beans/META-INF/jbossws-cxf42-beans.xml" tofile="@{targetdir}/jbossws.beans/META-INF/jboss-beans.xml"/>
+ <copy todir="@{targetdir}/META-INF">
+ <fileset dir="@{thirdpartydir}/resources/jbossws-cxf.sar/META-INF"/>
+ </copy>
+ <copy todir="@{targetdir}/META-INF">
+ <fileset dir="@{resourcesdir}/META-INF"/>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="macro-deploy-jbossws-cxf50-sar">
+ <attribute name="thirdpartydir"/>
+ <attribute name="targetdir"/>
+ <sequential>
+ <mkdir dir="@{targetdir}"/>
+ <copy todir="@{targetdir}" flatten="true" overwrite="true">
+ <fileset dir="@{thirdpartydir}">
+ <patternset refid="jbossws.service.lib.patternset"/>
+ <include name="**/jbossws-deploy.conf"/>
+ </fileset>
+ </copy>
+ <unzip dest="@{targetdir}/jbossws-context.war" overwrite="true">
+ <fileset dir="@{thirdpartydir}">
+ <include name="**/jbossws-context.war"/>
+ </fileset>
+ </unzip>
+ <copy todir="@{targetdir}/jbossws.beans/META-INF" flatten="true">
+ <fileset dir="@{thirdpartydir}">
+ <include name="**/jbossws-cxf50-beans.xml"/>
+ </fileset>
+ </copy>
+ <move file="@{targetdir}/jbossws.beans/META-INF/jbossws-cxf50-beans.xml" tofile="@{targetdir}/jbossws.beans/META-INF/jboss-beans.xml"/>
+ <copy todir="@{targetdir}/META-INF">
+ <fileset dir="@{thirdpartydir}/resources/jbossws-cxf.sar/META-INF"/>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <!-- ================================================================== -->
+ <!-- Deploy JBossWS -->
+ <!-- ================================================================== -->
+
+ <!-- JDK Detection -->
+ <available classname="java.io.Console" property="HAVE_JDK_1.6"/>
+
+ <target name="deploy-jbossws-cxf42" depends="deploy-jbossws-endorsed">
+ <macro-deploy-jbossws-bin targetdir="${installserver}/../../bin" thirdpartydir="${thirdpartydir}"/>
+ <macro-deploy-jbossws-lib targetdir="${installserver}/../../lib" thirdpartydir="${thirdpartydir}"/>
+ <macro-deploy-jbossws-client targetdir="${installserver}/../../client" thirdpartydir="${thirdpartydir}"/>
+ <macro-deploy-jbossws-server-lib targetdir="${installserver}/lib" thirdpartydir="${thirdpartydir}"/>
+ <macro-deploy-jbossws-cxf42-sar targetdir="${installserver}/deploy/jbossws.sar" thirdpartydir="${thirdpartydir}" resourcesdir="${resourcesdir}"/>
+ </target>
+
+ <target name="deploy-jbossws-cxf50" depends="deploy-jbossws-endorsed">
+ <macro-deploy-jbossws-bin targetdir="${installserver}/../../bin" thirdpartydir="${thirdpartydir}"/>
+ <macro-deploy-jbossws-lib targetdir="${installserver}/../../lib" thirdpartydir="${thirdpartydir}"/>
+ <macro-deploy-jbossws-client targetdir="${installserver}/../../client" thirdpartydir="${thirdpartydir}"/>
+ <macro-deploy-jbossws-server-lib targetdir="${installserver}/lib" thirdpartydir="${thirdpartydir}"/>
+ <macro-deploy-jbossws-cxf50-sar targetdir="${installserver}/deploy/jbossws.sar" thirdpartydir="${thirdpartydir}"/>
+ </target>
+
+ <target name="deploy-jbossws-endorsed" if="HAVE_JDK_1.6">
+ <macro-deploy-jbossws-endorsed targetdir="${installserver}/../../lib/endorsed" thirdpartydir="${thirdpartydir}"/>
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Undeploy JBossWS -->
+ <!-- ================================================================== -->
+
+ <macrodef name="macro-undeploy-jbossws">
+ <attribute name="defaultconf"/>
+ <attribute name="targetdir"/>
+ <sequential>
+ <loadfile property="jbossws.deploy.conf" srcfile="@{targetdir}/jbossws-deploy.conf" failonerror="false"/>
+ <loadfile property="jbossws.deploy.conf" srcfile="@{defaultconf}" failonerror="false"/>
+
+ <property name="jboss.undeploy.home" value="@{targetdir}/../../../.."/>
+ <available property="jboss.undeploy.client" file="${jboss.undeploy.home}/client"/>
+ <fail message="Cannot find ${jboss.undeploy.home}/client" unless="jboss.undeploy.client"/>
+
+ <delete>
+ <fileset dir="${jboss.undeploy.home}" includes="${jbossws.deploy.conf}"/>
+ </delete>
+ <delete dir="@{targetdir}"/>
+ </sequential>
+ </macrodef>
+
+</project>
\ No newline at end of file
Deleted: stack/cxf/trunk/ant-import/macros-deploy-cxf.xml
===================================================================
--- stack/cxf/trunk/ant-import/macros-deploy-cxf.xml 2008-03-13 08:42:17 UTC (rev 5953)
+++ stack/cxf/trunk/ant-import/macros-deploy-cxf.xml 2008-03-13 11:24:53 UTC (rev 5954)
@@ -1,286 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ====================================================================== -->
-<!-- -->
-<!-- JBoss, the OpenSource J2EE webOS -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at http://www.gnu.org. -->
-<!-- -->
-<!-- ====================================================================== -->
-
-<!-- $Id$ -->
-
-<project>
-
- <!--
- These patterns should be common for all supported containers
- Exceptions must be defined in the individual deploy macros.
- -->
- <patternset id="client.patternset">
- <include name="jbossws-common.jar"/>
- <include name="jbossws-framework.jar"/>
- <include name="jbossws-spi.jar"/>
- <include name="jaxb-api.jar"/>
- <include name="jaxb-impl.jar"/>
- <include name="jaxb-xjc.jar"/>
- <include name="jaxws-api-${cxf.jaxws.api}.jar"/>
- <include name="saaj-api-${cxf.saaj}.jar"/>
- </patternset>
-
- <patternset id="lib.patternset">
- <include name="jaxb-api.jar"/>
- <include name="jaxb-impl.jar"/>
- </patternset>
-
- <patternset id="server.lib.patternset">
- <include name="jbossws-common.jar"/>
- <include name="jbossws-framework.jar"/>
- <include name="jbossws-spi.jar"/>
- <include name="jaxws-api-${cxf.jaxws.api}.jar"/>
- <include name="saaj-api-${cxf.saaj}.jar"/>
- </patternset>
-
- <!-- ================================================================== -->
- <!-- Deploy Framework -->
- <!-- ================================================================== -->
-
- <macrodef name="macro-deploy-framework">
- <attribute name="thirdpartylibs"/>
- <sequential>
-
- <!-- BIN SCRIPTS -->
- <unzip dest="${deploy.dir}/bin" src="@{thirdpartylibs}/jbossws-framework-scripts.zip"/>
-
- <!-- CLIENT JARS-->
- <copy todir="${deploy.dir}/client">
- <fileset dir="@{thirdpartylibs}">
- <patternset refid="client.patternset"/>
- </fileset>
- </copy>
-
- <!-- SERVER LIB JARS-->
- <copy todir="${deploy.dir}/server/${jboss.server.instance}/lib">
- <fileset dir="@{thirdpartylibs}">
- <patternset refid="server.lib.patternset"/>
- </fileset>
- </copy>
- </sequential>
- </macrodef>
-
- <!-- ================================================================== -->
- <!-- Deploy JBossWS -->
- <!-- ================================================================== -->
-
- <macrodef name="macro-deploy-jbossws">
- <attribute name="jbosshome"/>
- <attribute name="sarname"/>
- <attribute name="stacklibs"/>
- <attribute name="thirdpartylibs"/>
- <sequential>
-
- <!-- Deploy the sars -->
- <mkdir dir="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
- <unjar dest="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar" src="@{stacklibs}/@{sarname}"/>
- <mkdir dir="@{jbosshome}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
- <unzip dest="@{jbosshome}/server/${jboss.server.instance}/deploy/juddi-service.sar" src="@{thirdpartylibs}/juddi-service.sar"/>
-
- <!-- Deploy the jars -->
- <fileset id="jbossws.deploy.files" dir="${deploy.dir}" excludes="jbossws-deploy.conf"/>
- <copy todir="@{jbosshome}" overwrite="true">
- <fileset refid="jbossws.deploy.files"/>
- </copy>
- <chmod dir="@{jbosshome}/bin" perm="+x" includes="*.sh"/>
-
- <!-- Write jbossws-deploy.conf -->
- <property name="jbossws.deploy.files" refid="jbossws.deploy.files"/>
- <echo file="${deploy.dir}/jbossws-deploy.conf" message="${jbossws.deploy.files}"/>
- <replace file="${deploy.dir}/jbossws-deploy.conf" token=";" value=" "/>
- <copy todir="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar" file="${deploy.dir}/jbossws-deploy.conf" overwrite="true"/>
-
- </sequential>
- </macrodef>
-
- <!-- ================================================================== -->
- <!-- Undeploy JBossWS -->
- <!-- ================================================================== -->
-
- <macrodef name="macro-undeploy-jbossws">
- <attribute name="jbosshome"/>
- <sequential>
-
- <delete dir="${deploy.dir}"/>
-
- <loadfile property="jbossws.undeploy.files" srcfile="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar/jbossws-deploy.conf" failonerror="false"/>
- <loadfile property="jbossws.undeploy.files" srcfile="${jbossws.default.undeploy.files}" failonerror="false"/>
- <delete dir="@{jbosshome}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
- <delete dir="@{jbosshome}/server/${jboss.server.instance}/deploy/juddi-service.sar"/>
- <delete>
- <fileset dir="@{jbosshome}" includes="${jbossws.undeploy.files}"/>
- </delete>
-
- </sequential>
- </macrodef>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-4.2.x -->
- <!-- ================================================================== -->
-
- <macrodef name="macro-deploy-cxf42x">
- <attribute name="stacklibs"/>
- <attribute name="thirdpartylibs"/>
- <sequential>
-
- <!-- CLIENT JARS -->
- <mkdir dir="${deploy.dir}/client"/>
- <copy todir="${deploy.dir}/client" overwrite="true">
- <fileset dir="@{stacklibs}">
- <patternset refid="client.patternset"/>
- </fileset>
- <fileset dir="@{thirdpartylibs}">
- <patternset refid="client.patternset"/>
- </fileset>
- </copy>
-
- <!-- LIB JARS -->
- <mkdir dir="${deploy.dir}/lib"/>
- <copy todir="${deploy.dir}/lib" overwrite="true">
- <fileset dir="@{thirdpartylibs}">
- <patternset refid="lib.patternset"/>
- </fileset>
- </copy>
-
- </sequential>
- </macrodef>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-4.2.2 -->
- <!-- ================================================================== -->
-
- <macrodef name="macro-deploy-cxf422">
- <attribute name="stacklibs"/>
- <attribute name="thirdpartylibs"/>
- <sequential>
- <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
- <macro-deploy-framework thirdpartylibs="@{thirdpartylibs}"/>
- <macro-deploy-cxf42x stacklibs="@{stacklibs}" thirdpartylibs="@{thirdpartylibs}"/>
- <macro-deploy-jbossws jbosshome="${jboss422.home}" sarname="jbossws-cxf42.sar" stacklibs="@{stacklibs}" thirdpartylibs="@{thirdpartylibs}"/>
- </sequential>
- </macrodef>
-
- <!-- Remove jbossws/cxf from jboss422 -->
- <macrodef name="macro-undeploy-cxf422">
- <sequential>
- <fail message="Not available: ${jboss422.available.file}" unless="jboss422.available"/>
- <macro-undeploy-jbossws jbosshome="${jboss422.home}"/>
- </sequential>
- </macrodef>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-4.2.3 -->
- <!-- ================================================================== -->
-
- <macrodef name="macro-deploy-cxf423">
- <attribute name="stacklibs"/>
- <attribute name="thirdpartylibs"/>
- <sequential>
- <fail message="Not available: ${jboss423.available.file}" unless="jboss423.available"/>
- <macro-deploy-framework thirdpartylibs="@{thirdpartylibs}"/>
- <macro-deploy-cxf42x stacklibs="@{stacklibs}" thirdpartylibs="@{thirdpartylibs}"/>
- <macro-deploy-jbossws jbosshome="${jboss423.home}" sarname="jbossws-cxf42.sar" stacklibs="@{stacklibs}" thirdpartylibs="@{thirdpartylibs}"/>
- </sequential>
- </macrodef>
-
- <!-- Remove jbossws/cxf from jboss423 -->
- <macrodef name="macro-undeploy-cxf423">
- <sequential>
- <fail message="Not available: ${jboss423.available.file}" unless="jboss423.available"/>
- <macro-undeploy-jbossws jbosshome="${jboss423.home}"/>
- </sequential>
- </macrodef>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-5.0.x -->
- <!-- ================================================================== -->
-
- <macrodef name="macro-deploy-cxf50x">
- <attribute name="stacklibs"/>
- <attribute name="thirdpartylibs"/>
- <sequential>
-
- <!-- CLIENT JARS -->
- <mkdir dir="${deploy.dir}/client"/>
- <copy todir="${deploy.dir}/client" overwrite="true">
- <fileset dir="@{stacklibs}">
- <patternset refid="client.patternset"/>
- </fileset>
- <fileset dir="@{thirdpartylibs}">
- <patternset refid="client.patternset"/>
- </fileset>
- </copy>
-
- <!-- LIB JARS -->
- <mkdir dir="${deploy.dir}/lib"/>
- <copy todir="${deploy.dir}/lib" overwrite="true">
- <fileset dir="@{thirdpartylibs}">
- <patternset refid="lib.patternset"/>
- </fileset>
- </copy>
-
- <!-- SERVER JARS -->
- <copy todir="${deploy.dir}/server/${jboss.server.instance}/lib" overwrite="true">
- <fileset dir="@{stacklibs}">
- <patternset refid="server.lib.patternset"/>
- </fileset>
- </copy>
-
- </sequential>
- </macrodef>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-5.0.0 -->
- <!-- ================================================================== -->
-
- <macrodef name="macro-deploy-cxf500">
- <attribute name="stacklibs"/>
- <attribute name="thirdpartylibs"/>
- <sequential>
- <fail message="Not available: ${jboss500.available.file}" unless="jboss500.available"/>
- <macro-deploy-framework thirdpartylibs="@{thirdpartylibs}"/>
- <macro-deploy-cxf50x stacklibs="@{stacklibs}" thirdpartylibs="@{thirdpartylibs}"/>
- <macro-deploy-jbossws jbosshome="${jboss500.home}" sarname="jbossws-cxf50.sar" stacklibs="@{stacklibs}" thirdpartylibs="@{thirdpartylibs}"/>
- </sequential>
- </macrodef>
-
- <!-- Remove jbossws/cxf from jboss500 -->
- <macrodef name="macro-undeploy-cxf500">
- <sequential>
- <fail message="Not available: ${jboss500.available.file}" unless="jboss500.available"/>
- <macro-undeploy-jbossws jbosshome="${jboss500.home}"/>
- </sequential>
- </macrodef>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-5.0.1 -->
- <!-- ================================================================== -->
-
- <macrodef name="macro-deploy-cxf501">
- <attribute name="stacklibs"/>
- <attribute name="thirdpartylibs"/>
- <sequential>
- <fail message="Not available: ${jboss501.available.file}" unless="jboss501.available"/>
- <macro-deploy-framework thirdpartylibs="@{thirdpartylibs}"/>
- <macro-deploy-cxf50x stacklibs="@{stacklibs}" thirdpartylibs="@{thirdpartylibs}"/>
- <macro-deploy-jbossws jbosshome="${jboss501.home}" sarname="jbossws-cxf50.sar" stacklibs="@{stacklibs}" thirdpartylibs="@{thirdpartylibs}"/>
- </sequential>
- </macrodef>
-
- <!-- Remove jbossws/cxf from jboss501 -->
- <macrodef name="macro-undeploy-cxf501">
- <sequential>
- <fail message="Not available: ${jboss501.available.file}" unless="jboss501.available"/>
- <macro-undeploy-jbossws jbosshome="${jboss501.home}"/>
- </sequential>
- </macrodef>
-
-</project>
\ No newline at end of file
Modified: stack/cxf/trunk/build.xml
===================================================================
--- stack/cxf/trunk/build.xml 2008-03-13 08:42:17 UTC (rev 5953)
+++ stack/cxf/trunk/build.xml 2008-03-13 11:24:53 UTC (rev 5954)
@@ -17,10 +17,12 @@
<import file="${basedir}/ant-import/build-setup.xml"/>
<import file="${basedir}/ant-import/build-bin-dist.xml"/>
+ <import file="${basedir}/ant-import/build-prepare-deploy.xml"/>
<import file="${basedir}/ant-import/build-deploy.xml"/>
<import file="${basedir}/ant-import/build-release.xml"/>
<import file="${basedir}/ant-import/build-testsuite.xml"/>
<import file="${basedir}/ant-import/build-thirdparty.xml"/>
+ <import file="${basedir}/ant-import/jbossws-deploy-macros.xml"/>
<!-- ================================================================== -->
<!-- Setup -->
@@ -38,6 +40,12 @@
<property name="cxf.output.deploy.dir" value="${cxf.output.dir}/deploy"/>
<property name="cxf.output.etc.dir" value="${cxf.output.dir}/etc"/>
<property name="cxf.output.lib.dir" value="${cxf.output.dir}/lib"/>
+ <property name="cxf.output.resources.dir" value="${cxf.output.dir}/resources"/>
+
+ <property name="deploy.artifacts.dir" value="${cxf.output.deploy.dir}-artifacts"/>
+ <property name="deploy.structure.jboss42" value="${cxf.output.deploy.dir}-jboss42"/>
+ <property name="deploy.structure.jboss50" value="${cxf.output.deploy.dir}-jboss50"/>
+ <property name="jbossws.default.deploy.conf" value="${cxf.dir}/ant-import/jbossws-default-deploy.conf"/>
<!-- ================================================================== -->
<!-- Initialization -->
@@ -59,7 +67,7 @@
| documentation compiles.
-->
- <target name="compile" depends="init,compile-classes,compile-etc" description="Compile all source files."/>
+ <target name="compile" depends="init,compile-classes,compile-etc,compile-resources" description="Compile all source files."/>
<!-- Compile java sources -->
<target name="compile-classes" depends="compile-classes-cxf"/>
@@ -90,6 +98,42 @@
</copy>
</target>
+ <!-- Compile resource files -->
+ <target name="compile-resources" depends="init">
+
+ <!-- Concat jbossws-cxf50-beans.xml -->
+ <mkdir dir="${cxf.output.resources.dir}"/>
+ <concat destfile="${cxf.output.resources.dir}/jbossws-cxf50-beans.xml">
+ <header trimleading="yes">
+ <deployment xmlns="urn:jboss:bean-deployer:2.0">
+ </header>
+ <fileset file="${cxf.resources.dir}/jbossws-cxf-config.xml"/>
+ <footer trimleading="yes">
+ </deployment>
+ </footer>
+ </concat>
+
+ <!-- Concat jboss-beans.xml -->
+ <unzip dest="${cxf.output.dir}/resources" src="${thirdparty.dir}/jbossws-jboss42-resources.zip"/>
+ <concat destfile="${cxf.output.resources.dir}/jbossws-cxf42-beans.xml">
+ <header trimleading="yes">
+ <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd" xmlns="urn:jboss:bean-deployer">
+ </header>
+ <fileset file="${cxf.resources.dir}/jbossws-cxf-config.xml"/>
+ <fileset file="${cxf.output.resources.dir}/jbossws-jboss42-config.xml"/>
+ <footer trimleading="yes">
+ </deployment>
+ </footer>
+ </concat>
+
+ <copy todir="${cxf.output.resources.dir}">
+ <fileset dir="${cxf.resources.dir}">
+ <include name="jbossws-cxf.jar/**"/>
+ <include name="jbossws-cxf.sar/**"/>
+ </fileset>
+ </copy>
+ </target>
+
<!-- ================================================================== -->
<!-- Archives -->
<!-- ================================================================== -->
@@ -97,10 +141,7 @@
<!--
| Build all jar files.
-->
- <target name="jars" depends="compile,jars-jboss42,jars-jboss50" description="Builds all jar files.">
- </target>
-
- <target name="jars-common" depends="compile">
+ <target name="jars" depends="compile" description="Builds all jar files.">
<!-- Build jbossws-cxf.jar -->
<mkdir dir="${cxf.output.lib.dir}"/>
@@ -145,7 +186,7 @@
</zip>
</target>
- <target name="jars-jboss50" depends="jars-common">
+ <target name="jars-jboss50" depends="jars">
<!-- Concat jbossws-beans.xml -->
<concat destfile="${cxf.output.lib.dir}/jbossws-cxf50/jbossws-beans.xml">
@@ -192,7 +233,7 @@
</target>
- <target name="jars-jboss42" depends="jars-common">
+ <target name="jars-jboss42" depends="jars">
<unzip dest="${cxf.output.dir}/resources" src="${thirdparty.dir}/jbossws-jboss42-resources.zip"/>
Modified: stack/cxf/trunk/src/main/distro/ant.properties.example
===================================================================
--- stack/cxf/trunk/src/main/distro/ant.properties.example 2008-03-13 08:42:17 UTC (rev 5953)
+++ stack/cxf/trunk/src/main/distro/ant.properties.example 2008-03-13 11:24:53 UTC (rev 5954)
@@ -4,11 +4,12 @@
# $Id: ant.properties.example 3137 2007-05-18 13:41:57Z thomas.diesler(a)jboss.com $
# Optional JBoss Home
-jboss500.home=(a)jboss500.home@
jboss422.home=(a)jboss422.home@
jboss423.home=(a)jboss423.home@
+jboss500.home=(a)jboss500.home@
+jboss501.home=(a)jboss501.home@
-# The JBoss server under test. This can be [jboss422|jboss423|jboss500]
+# The JBoss server under test. This can be [jboss422|jboss423|jboss500|jboss501]
jbossws.integration.target=jboss422
# The JBoss settings
Modified: stack/cxf/trunk/src/main/distro/bin-dist-build.xml
===================================================================
--- stack/cxf/trunk/src/main/distro/bin-dist-build.xml 2008-03-13 08:42:17 UTC (rev 5953)
+++ stack/cxf/trunk/src/main/distro/bin-dist-build.xml 2008-03-13 11:24:53 UTC (rev 5954)
@@ -18,14 +18,15 @@
<!-- ================================================================== -->
<property name="build.dir" value="${basedir}/build"/>
- <property name="bin.dir" value="${basedir}/bin"/>
- <property name="deploy.dir" value="${basedir}/output/deploy"/>
<property name="docs.dir" value="${basedir}/docs"/>
- <property name="lib.dir" value="${basedir}/lib"/>
+ <property name="thirdparty.dir" value="${basedir}/deploy/lib"/>
<property name="tests.dir" value="${basedir}/tests"/>
<property name="tests.output.dir" value="${basedir}/output"/>
- <property name="jbossws.default.undeploy.files" value="${build.dir}/jbossws.default.undeploy.files"/>
+ <property name="deploy.artifacts.dir" value="${basedir}/deploy"/>
+ <property name="deploy.structure.jboss42" value="${basedir}/output/deploy-jboss42"/>
+ <property name="deploy.structure.jboss50" value="${basedir}/output/deploy-jboss50"/>
+ <property name="jbossws.default.deploy.conf" value="${build.dir}/jbossws-default-deploy.conf"/>
<property file="${basedir}/ant.properties"/>
<property file="${basedir}/version.properties"/>
@@ -70,14 +71,14 @@
<condition property="jbossws.integration.jboss42" value="true">
<or>
- <equals arg1="${jbossws.integration.target}" arg2="jboss422"/>
+ <equals arg1="${jbossws.integration.target}" arg2="jboss422"/>
<equals arg1="${jbossws.integration.target}" arg2="jboss423"/>
</or>
</condition>
<condition property="jbossws.integration.jboss50" value="true">
<or>
- <equals arg1="${jbossws.integration.target}" arg2="jboss500"/>
- <equals arg1="${jbossws.integration.target}" arg2="jboss501"/>
+ <equals arg1="${jbossws.integration.target}" arg2="jboss500"/>
+ <equals arg1="${jbossws.integration.target}" arg2="jboss501"/>
</or>
</condition>
@@ -88,7 +89,7 @@
<fail message="JDK1.5 or above is required" unless="HAVE_JDK_1.5"/>
<import file="${basedir}/build/build-deploy.xml"/>
- <import file="${basedir}/build/macros-deploy-cxf.xml"/>
+ <import file="${basedir}/build/jbossws-deploy-macros.xml"/>
<import file="${basedir}/tests/ant-import/build-testsuite.xml"/>
<!-- ================================================================== -->
@@ -164,9 +165,8 @@
<target name="tests-main" depends="tests-jars" description="Build the test deployments."/>
- <!-- dummy jar targets -->
- <target name="jars-jboss50" depends="prepare"/>
- <target name="jars-jboss42" depends="prepare"/>
+ <!-- dummy targets -->
+ <target name="prepare-deploy" depends="prepare"/>
<!-- ================================================================== -->
<!-- Miscellaneous -->
Deleted: stack/cxf/trunk/src/main/distro/bin-dist-deploy.xml
===================================================================
--- stack/cxf/trunk/src/main/distro/bin-dist-deploy.xml 2008-03-13 08:42:17 UTC (rev 5953)
+++ stack/cxf/trunk/src/main/distro/bin-dist-deploy.xml 2008-03-13 11:24:53 UTC (rev 5954)
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ====================================================================== -->
-<!-- -->
-<!-- JBoss, the OpenSource J2EE webOS -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at http://www.gnu.org. -->
-<!-- -->
-<!-- ====================================================================== -->
-
-<!-- $Id: bin-dist-deploy.xml 3576 2007-06-14 09:23:52Z thomas.diesler(a)jboss.com $ -->
-
-<project>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-4.2.2 -->
- <!-- ================================================================== -->
-
- <!-- Deploy jbossws/cxf to jboss422 -->
- <target name="deploy-jboss422" depends="undeploy-jboss422,deploy-jboss422-endorsed" description="Deploy jbossws/cxf to jboss422">
- <macro-deploy-cxf422 stacklibs="${lib.dir}" thirdpartylibs="${lib.dir}"/>
- </target>
- <target name="deploy-jboss422-endorsed" depends="prepare" if="HAVE_JDK_1.6">
- <macro-deploy-endorsed jbosshome="${jboss422.home}" thirdpartylibs="${lib.dir}"/>
- </target>
-
- <!-- Remove jbossws/cxf from jboss422 -->
- <target name="undeploy-jboss422" depends="prepare" description="Remove jbossws/cxf from jboss422">
- <macro-undeploy-cxf422/>
- </target>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-4.2.3 -->
- <!-- ================================================================== -->
-
- <!-- Deploy jbossws/cxf to jboss423 -->
- <target name="deploy-jboss423" depends="undeploy-jboss423,deploy-jboss423-endorsed" description="Deploy jbossws/cxf to jboss423">
- <macro-deploy-cxf423 stacklibs="${lib.dir}" thirdpartylibs="${lib.dir}"/>
- </target>
- <target name="deploy-jboss423-endorsed" depends="prepare" if="HAVE_JDK_1.6">
- <macro-deploy-endorsed jbosshome="${jboss423.home}" thirdpartylibs="${lib.dir}"/>
- </target>
-
- <!-- Remove jbossws/cxf from jboss423 -->
- <target name="undeploy-jboss423" depends="prepare" description="Remove jbossws/cxf from jboss423">
- <macro-undeploy-cxf423/>
- </target>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-5.0.0 -->
- <!-- ================================================================== -->
-
- <!-- Deploy jbossws/cxf to jboss500 -->
- <target name="deploy-jboss500" depends="undeploy-jboss500,deploy-jboss500-endorsed" description="Deploy jbossws/cxf to jboss500">
- <macro-deploy-cxf500 stacklibs="${lib.dir}" thirdpartylibs="${lib.dir}"/>
- </target>
- <target name="deploy-jboss500-endorsed" depends="prepare" if="HAVE_JDK_1.6">
- <macro-deploy-endorsed jbosshome="${jboss500.home}" thirdpartylibs="${lib.dir}"/>
- </target>
-
- <!-- Remove jbossws/cxf from jboss500 -->
- <target name="undeploy-jboss500" depends="prepare" description="Remove jbossws/cxf from jboss500">
- <macro-undeploy-cxf500/>
- </target>
-
- <!-- ================================================================== -->
- <!-- Deployment JBoss-5.0.1 -->
- <!-- ================================================================== -->
-
- <!-- Deploy jbossws/cxf to jboss501 -->
- <target name="deploy-jboss501" depends="undeploy-jboss501,deploy-jboss501-endorsed" description="Deploy jbossws/cxf to jboss501">
- <macro-deploy-cxf501 stacklibs="${lib.dir}" thirdpartylibs="${lib.dir}"/>
- </target>
- <target name="deploy-jboss501-endorsed" depends="prepare" if="HAVE_JDK_1.6">
- <macro-deploy-endorsed jbosshome="${jboss501.home}" thirdpartylibs="${lib.dir}"/>
- </target>
-
- <!-- Remove jbossws/cxf from jboss501 -->
- <target name="undeploy-jboss501" depends="prepare" description="Remove jbossws/cxf from jboss501">
- <macro-undeploy-cxf501/>
- </target>
-
-</project>
16 years, 7 months
JBossWS SVN: r5953 - in stack/native/trunk/src/main: java/org/jboss/ws/core/client and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-03-13 04:42:17 -0400 (Thu, 13 Mar 2008)
New Revision: 5953
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureSet.java
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
Modified:
stack/native/trunk/src/main/etc/component-info.xml
stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
Log:
[JBWS-925] Add support for FastInfoset
Modified: stack/native/trunk/src/main/etc/component-info.xml
===================================================================
--- stack/native/trunk/src/main/etc/component-info.xml 2008-03-13 08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/etc/component-info.xml 2008-03-13 08:42:17 UTC (rev 5953)
@@ -63,6 +63,9 @@
<import componentref="stax-api">
<compatible version="@stax-api@"/>
</import>
+ <import componentref="sun-fi">
+ <compatible version="@sun-fi@"/>
+ </import>
<import componentref="sun-jaxb">
<compatible version="@sun-jaxb@"/>
</import>
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-13 08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-13 08:42:17 UTC (rev 5953)
@@ -30,7 +30,7 @@
import javax.xml.ws.WebServiceFeature;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.FeatureResolver;
+import org.jboss.ws.metadata.umdm.FeatureSet;
/** A wrapper object that associates the target address with some metadata
*
@@ -41,11 +41,11 @@
{
private String targetAddress;
private Map<String, Object> properties;
- private FeatureResolver features;
+ private FeatureSet features;
public EndpointInfo(EndpointMetaData epMetaData, String targetAddress, Map<String, Object> callProps)
{
- this.features = epMetaData.getFeatureResolver();
+ this.features = epMetaData.getFeatures();
this.targetAddress = targetAddress;
this.properties = callProps;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java 2008-03-13 08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java 2008-03-13 08:42:17 UTC (rev 5953)
@@ -28,7 +28,6 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.logging.Logger;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.invocation.OnewayInvocation;
import org.jboss.remoting.marshal.Marshaller;
@@ -41,9 +40,6 @@
*/
public class FastInfosetMarshaller implements Marshaller
{
- // Provide logging
- private static Logger log = Logger.getLogger(FastInfosetMarshaller.class);
-
/**
* Marshaller will need to take the dataObject and convert
* into primitive java data types and write to the
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java 2008-03-13 08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java 2008-03-13 08:42:17 UTC (rev 5953)
@@ -38,7 +38,7 @@
MessageFactoryImpl factory = super.getMessageFactory();
if (epMetaData != null)
- factory.setFeatureResolver(epMetaData.getFeatureResolver());
+ factory.setFeatures(epMetaData.getFeatures());
return factory;
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-13 08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-13 08:42:17 UTC (rev 5953)
@@ -47,7 +47,7 @@
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder;
import org.jboss.ws.feature.FastInfosetFeature;
-import org.jboss.ws.metadata.umdm.FeatureResolver;
+import org.jboss.ws.metadata.umdm.FeatureSet;
import org.jboss.wsf.common.IOUtils;
import org.jboss.wsf.spi.util.ServiceLoader;
@@ -68,7 +68,7 @@
// The style used by this MessageFactory
private Style style;
// The features used by this MessageFactory
- private FeatureResolver features = new FeatureResolver();
+ private FeatureSet features = new FeatureSet();
// Used if the style is dynamic
private boolean dynamic;
@@ -142,7 +142,7 @@
this.features.addFeature(feature);
}
- public void setFeatureResolver(FeatureResolver features)
+ public void setFeatures(FeatureSet features)
{
this.features = features;
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-13 08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-13 08:42:17 UTC (rev 5953)
@@ -151,7 +151,7 @@
// All of the registered types
private List<Class> registeredTypes = new ArrayList<Class>();
// The features defined for this endpoint
- private FeatureResolver features = new FeatureResolver();
+ private FeatureSet features = new FeatureSet();
// The documentation edfined through the @Documentation annotation
private String documentation;
@@ -374,7 +374,7 @@
return features.isFeatureEnabled(key);
}
- public FeatureResolver getFeatureResolver()
+ public FeatureSet getFeatures()
{
return features;
}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java 2008-03-13 08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java 2008-03-13 08:42:17 UTC (rev 5953)
@@ -1,68 +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.metadata.umdm;
-
-// $Id$
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.ws.WebServiceFeature;
-
-/**
- * A component that maintains a set of web service features
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2005
- */
-public class FeatureResolver
-{
- // The features defined for this endpoint
- private Set<WebServiceFeature> features = new HashSet<WebServiceFeature>();
-
- public <T extends WebServiceFeature> boolean hasFeature(Class<T> key)
- {
- return getFeature(key) != null;
- }
-
- public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T> key)
- {
- T feature = getFeature(key);
- return (feature != null ? feature.isEnabled() : false);
- }
-
- public <T extends WebServiceFeature> T getFeature(Class<T> key)
- {
- for (WebServiceFeature feature : features)
- {
- if (key == feature.getClass())
- return (T)feature;
- }
- return null;
- }
-
- public void addFeature(WebServiceFeature feature)
- {
- this.features.add(feature);
- }
-
-}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureSet.java (from rev 5951, stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureSet.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureSet.java 2008-03-13 08:42:17 UTC (rev 5953)
@@ -0,0 +1,68 @@
+/*
+ * 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.metadata.umdm;
+
+// $Id$
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * A component that maintains a set of web service features
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2005
+ */
+public class FeatureSet
+{
+ // The features defined for this endpoint
+ private Set<WebServiceFeature> features = new HashSet<WebServiceFeature>();
+
+ public <T extends WebServiceFeature> boolean hasFeature(Class<T> key)
+ {
+ return getFeature(key) != null;
+ }
+
+ public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T> key)
+ {
+ T feature = getFeature(key);
+ return (feature != null ? feature.isEnabled() : false);
+ }
+
+ public <T extends WebServiceFeature> T getFeature(Class<T> key)
+ {
+ for (WebServiceFeature feature : features)
+ {
+ if (key == feature.getClass())
+ return (T)feature;
+ }
+ return null;
+ }
+
+ public void addFeature(WebServiceFeature feature)
+ {
+ this.features.add(feature);
+ }
+
+}
Modified: stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-13 08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-13 08:42:17 UTC (rev 5953)
@@ -354,13 +354,18 @@
if (wsaTo != null)
{
log.debug("Sending response to addressing destination: " + wsaTo);
- new SOAPConnectionImpl().callOneWay((SOAPMessage)resMessage, wsaTo);
+ SOAPMessage soapMessage = (SOAPMessage)resMessage;
+ new SOAPConnectionImpl().callOneWay(soapMessage, wsaTo);
}
else
{
if (epMetaData.isFeatureEnabled(FastInfosetFeature.class) && resMessage instanceof SOAPMessage)
{
- SOAPEnvelope soapEnv = ((SOAPMessage)resMessage).getSOAPPart().getEnvelope();
+ SOAPMessage soapMessage = (SOAPMessage)resMessage;
+ if (soapMessage.getAttachments().hasNext())
+ throw new IllegalStateException("Attachments not supported with FastInfoset");
+
+ SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
DOMDocumentSerializer serializer = new DOMDocumentSerializer();
serializer.setOutputStream(output);
serializer.serialize(soapEnv);
@@ -413,7 +418,7 @@
msgFactory.setServiceMode(sepMetaData.getServiceMode());
msgFactory.setStyle(sepMetaData.getStyle());
- msgFactory.setFeatureResolver(sepMetaData.getFeatureResolver());
+ msgFactory.setFeatures(sepMetaData.getFeatures());
reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers, inputStream);
}
16 years, 7 months
JBossWS SVN: r5952 - stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-03-13 04:33:10 -0400 (Thu, 13 Mar 2008)
New Revision: 5952
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java
Log:
Enable AddressingClientTestCase, currently fails
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java 2008-03-12 21:30:58 UTC (rev 5951)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java 2008-03-13 08:33:10 UTC (rev 5952)
@@ -43,21 +43,21 @@
return new JBossWSTestSetup(AddressingClientTestCase.class, "jaxws-samples-dar.jar,jaxws-samples-dar-addressing-client.war");
}
- public void _testSync() throws Exception
+ public void testSync() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/dar?wsdl");
AddressingClient client = new AddressingClient(wsdlURL);
client.run(false);
}
- public void _testAsync() throws Exception
+ public void testAsync() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/dar?wsdl");
AddressingClient client = new AddressingClient(wsdlURL);
client.run(true);
}
- public void _testOneWay() throws Exception
+ public void testOneWay() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/dar?wsdl");
AddressingClient client = new AddressingClient(wsdlURL);
16 years, 7 months
JBossWS SVN: r5951 - stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-03-12 17:30:58 -0400 (Wed, 12 Mar 2008)
New Revision: 5951
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/UsernameAuthTestCase.java
Log:
[JBWS-1988] More test cases
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java 2008-03-12 21:30:58 UTC (rev 5951)
@@ -0,0 +1,69 @@
+/*
+ * 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.jbws1988;
+
+import org.jboss.ws.extensions.security.operation.SendUsernameOperation;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * Black box tests of the username token profile digest algorithm
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class DigestTestCase extends JBossWSTest
+{
+ public void testWithNonceAndCreated() throws Exception
+ {
+ String password = "taadtaadpstcsm";
+ String nonce = "d36e316282959a9ed4c89851497a717f";
+ String created = "2003-12-15T14:43:07Z";
+ String expectedDigest = "quR/EWLAV4xLf9Zqyw4pDmfV9OY=";
+ String digest = SendUsernameOperation.createPasswordDigest(nonce, created, password);
+ assertEquals(expectedDigest, digest);
+
+ password = "therealfrog";
+ nonce = "gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=";
+ created = "2008-03-12T17:12:31.310Z";
+ expectedDigest = "IEeuDaP/NTozwiyJHzTgBoCCDjg=";
+ digest = SendUsernameOperation.createPasswordDigest(nonce, created, password);
+ assertEquals(expectedDigest, digest);
+ }
+
+ public void testWithNonce() throws Exception
+ {
+ String password = "therealfrog";
+ String nonce = "gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=";
+ String expectedDigest = "sdA2umjMZQEY2ejbt5L6WbJOrB0=";
+ String digest = SendUsernameOperation.createPasswordDigest(nonce, null, password);
+ assertEquals(expectedDigest, digest);
+ }
+
+ public void testWithCreated() throws Exception
+ {
+ String password = "therealfrog";
+ String created = "2008-03-12T17:12:31.310Z";
+ String expectedDigest = "fwt4eF/AjmE0mvY1gI4hkAiSIbk=";
+ String digest = SendUsernameOperation.createPasswordDigest(null, created, password);
+ assertEquals(expectedDigest, digest);
+ }
+}
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java 2008-03-12 21:30:58 UTC (rev 5951)
@@ -0,0 +1,202 @@
+/*
+ * 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.jbws1988;
+
+import java.io.ByteArrayInputStream;
+import java.io.StringReader;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.WSSecurityAPI;
+import org.jboss.ws.extensions.security.WSSecurityDispatcher;
+import org.jboss.ws.metadata.wsse.Config;
+import org.jboss.ws.metadata.wsse.Username;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.w3c.dom.Element;
+
+/**
+ * Tests of the username token profile message creation/parsing
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class MessageTestCase extends JBossWSTest
+{
+ private String serverConf = "<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config' "
+ + "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "
+ + "xsi:schemaLocation='http://www.jboss.com/ws-security/config "
+ + "http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>"
+ + "<config>"
+ + "<requires/>"
+ + "</config>"
+ + "</jboss-ws-security>";
+
+ private String clientConf = "<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config' "
+ + "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "
+ + "xsi:schemaLocation='http://www.jboss.com/ws-security/config "
+ + "http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>"
+ + "<config>"
+ + "<username digestPassword='true'/>"
+ + "</config>"
+ + "</jboss-ws-security>";
+
+ private String testMessage = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"
+ + " <env:Header>"
+ + " <tns:someHeader xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'"
+ + " tns:test='hi' xmlns:tns='http://org.jboss.ws/2004'>some header value</tns:someHeader>"
+ + " </env:Header> "
+ + " <env:Body wsu:Id='element-9-1205139829909-17908832' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>"
+ + " <tns:echoString2 xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' xmlns:tns='http://org.jboss.ws/2004' "
+ + " xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>"
+ + " <string>Hello World!</string>"
+ + " </tns:echoString2>"
+ + " <tns:echoString xmlns:tns='http://org.jboss.ws/2004'>"
+ + " <string>Hello World!</string>"
+ + " </tns:echoString>"
+ + " </env:Body>"
+ + "</env:Envelope>";
+
+ public void testDecodeMessageWithNonceAndCreated() throws Exception
+ {
+ String envStr = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ "<env:Header>" +
+ "<wsse:Security env:mustUnderstand='1' xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext...' " +
+ "xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>" +
+ "<wsse:UsernameToken wsu:Id='token-1-1205341951321-19004769'>" +
+ "<wsse:Username>kermit</wsse:Username>" +
+ "<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext...'>IEeuDaP/NTozwiyJHzTgBoCCDjg=</wsse:Password>" +
+ "<wsse:Nonce EncodingType='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-secu...'>gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=</wsse:Nonce>" +
+ "<wsse:Created>CREATED</wsse:Created>" +
+ "</wsse:UsernameToken>" +
+ "</wsse:Security>" +
+ "</env:Header>" +
+ "<env:Body><ns1:echo xmlns:ns1='http://org.jboss.ws/jbws1988'><arg0>Hi!</arg0></ns1:echo></env:Body>" +
+ "</env:Envelope>";
+
+ WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(serverConf));
+
+ //"2008-03-12T17:12:31.310Z"
+ Calendar created = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
+
+ WSSecurityAPI sec = new WSSecurityDispatcher();
+ sec.decodeMessage(configuration, getMessage(created, envStr), null);
+
+ created.add(Calendar.MINUTE, -10);
+ try
+ {
+ sec.decodeMessage(configuration, getMessage(created, envStr), null);
+ fail();
+ }
+ catch (Exception e)
+ {
+ //OK
+ }
+ }
+
+ private SOAPMessage getMessage(Calendar created, String envStr) throws Exception
+ {
+ envStr = envStr.replaceAll("CREATED", SimpleTypeBindings.marshalDateTime(created));
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(envStr.getBytes());
+ MessageFactory factory = new MessageFactoryImpl();
+ return factory.createMessage(null, inputStream);
+ }
+
+
+ public void testEncodeMessageWithNonceAndCreated() throws Exception
+ {
+ WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(clientConf));
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(testMessage.getBytes());
+ MessageFactory factory = new MessageFactoryImpl();
+ SOAPMessage soapMsg = factory.createMessage(null, inputStream);
+ WSSecurityAPI sec = new WSSecurityDispatcher();
+ sec.encodeMessage(configuration, soapMsg, null, "kermit", "therealfrog");
+ Element securityEl = (Element)soapMsg.getSOAPHeader().getChildElements(Constants.WSSE_HEADER_QNAME).next();
+ Element usernameTokenEl = (Element)DOMUtils.getChildElements(securityEl, new QName(Constants.WSSE_NS, "UsernameToken")).next();
+ assertPassword(usernameTokenEl);
+ Element nonceEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS, "Nonce")).next();
+ assertNotNull(nonceEl);
+ assertNotNull(DOMUtils.getTextContent(nonceEl));
+ assertEquals(nonceEl.getAttribute("EncodingType"), Constants.WSS_SOAP_NS+"#Base64Binary");
+ Element createdEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS, "Created")).next();
+ assertNotNull(createdEl);
+ assertNotNull(DOMUtils.getTextContent(createdEl));
+ }
+
+ public void testEncodeMessageWithNonce() throws Exception
+ {
+ WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(clientConf));
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(testMessage.getBytes());
+ MessageFactory factory = new MessageFactoryImpl();
+ SOAPMessage soapMsg = factory.createMessage(null, inputStream);
+ WSSecurityAPI sec = new WSSecurityDispatcher();
+ Username username = new Username(true, true, false);
+ Config config = new Config();
+ config.setUsername(username);
+ sec.encodeMessage(configuration, soapMsg, config, "kermit", "therealfrog");
+ Element securityEl = (Element)soapMsg.getSOAPHeader().getChildElements(Constants.WSSE_HEADER_QNAME).next();
+ Element usernameTokenEl = (Element)DOMUtils.getChildElements(securityEl, new QName(Constants.WSSE_NS, "UsernameToken")).next();
+ assertPassword(usernameTokenEl);
+ Element nonceEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS, "Nonce")).next();
+ assertNotNull(nonceEl);
+ assertNotNull(DOMUtils.getTextContent(nonceEl));
+ assertEquals(nonceEl.getAttribute("EncodingType"), Constants.WSS_SOAP_NS+"#Base64Binary");
+ assertFalse(DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS, "Created")).hasNext());
+ }
+
+ public void testEncodeMessageWithCreated() throws Exception
+ {
+ WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(clientConf));
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(testMessage.getBytes());
+ MessageFactory factory = new MessageFactoryImpl();
+ SOAPMessage soapMsg = factory.createMessage(null, inputStream);
+ WSSecurityAPI sec = new WSSecurityDispatcher();
+ Username username = new Username(true, false, true);
+ Config config = new Config();
+ config.setUsername(username);
+ sec.encodeMessage(configuration, soapMsg, config, "kermit", "therealfrog");
+ Element securityEl = (Element)soapMsg.getSOAPHeader().getChildElements(Constants.WSSE_HEADER_QNAME).next();
+ Element usernameTokenEl = (Element)DOMUtils.getChildElements(securityEl, new QName(Constants.WSSE_NS, "UsernameToken")).next();
+ assertPassword(usernameTokenEl);
+ assertFalse(DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS, "Nonce")).hasNext());
+ Element createdEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS, "Created")).next();
+ assertNotNull(createdEl);
+ assertNotNull(DOMUtils.getTextContent(createdEl));
+ }
+
+ private void assertPassword(Element usernameTokenEl) {
+ Element passwordEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS, "Password")).next();
+ assertNotNull(passwordEl);
+ assertNotNull(DOMUtils.getTextContent(passwordEl));
+ assertEquals(passwordEl.getAttribute("Type"), Constants.WSSE_NS+"#PasswordDigest");
+ }
+}
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/UsernameAuthTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/UsernameAuthTestCase.java 2008-03-12 19:03:40 UTC (rev 5950)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1988/UsernameAuthTestCase.java 2008-03-12 21:30:58 UTC (rev 5951)
@@ -66,6 +66,23 @@
fail();
}
}
+
+ public void testWrongPasswordAuth() throws Exception
+ {
+ Hello port = getPort();
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+ String msg = "Hi!";
+ try
+ {
+ String result = port.echo(msg);
+ fail();
+ }
+ catch (Exception e)
+ {
+ //OK
+ }
+ }
private Hello getPort() throws Exception
{
16 years, 7 months
JBossWS SVN: r5949 - in stack/native/trunk: ant-import and 17 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-03-12 15:02:14 -0400 (Wed, 12 Mar 2008)
New Revision: 5949
Added:
stack/native/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java
stack/native/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/feature/FastInfosetFeature.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfoset.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java
stack/native/trunk/src/test/resources/jaxws/fastinfoset/
stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/web.xml
Removed:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfoset.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java
stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/web.xml
Modified:
stack/native/trunk/.classpath
stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
stack/native/trunk/ant-import-tests/build-testsuite.xml
stack/native/trunk/ant-import/build-thirdparty.xml
stack/native/trunk/ant-import/jbossws-deploy-macros.xml
stack/native/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java
stack/native/trunk/version.properties
Log:
[JBWS-925] Add support for FastInfoset
Modified: stack/native/trunk/.classpath
===================================================================
--- stack/native/trunk/.classpath 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/.classpath 2008-03-12 19:02:14 UTC (rev 5949)
@@ -39,5 +39,6 @@
<classpathentry kind="lib" path="thirdparty/jboss-jaxb-intros.jar"/>
<classpathentry kind="lib" path="thirdparty/jbossws-common.jar" sourcepath="thirdparty/jbossws-common-src.zip"/>
<classpathentry kind="lib" path="thirdparty/jbossws-spi.jar" sourcepath="thirdparty/jbossws-spi-src.zip"/>
+ <classpathentry kind="lib" path="thirdparty/FastInfoset.jar"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified: stack/native/trunk/ant-import/build-thirdparty.xml
===================================================================
--- stack/native/trunk/ant-import/build-thirdparty.xml 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/ant-import/build-thirdparty.xml 2008-03-12 19:02:14 UTC (rev 5949)
@@ -111,6 +111,7 @@
<get src="${jboss.repository}/oswego-concurrent/${oswego-concurrent}/lib/concurrent.jar" dest="${thirdparty.dir}/concurrent.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/qdox/${qdox}/lib/qdox.jar" dest="${thirdparty.dir}/qdox.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/stax-api/${stax-api}/lib/stax-api.jar" dest="${thirdparty.dir}/stax-api.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/sun-fi/${sun-fi}/lib/FastInfoset.jar" dest="${thirdparty.dir}/FastInfoset.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaf/${sun-jaf}/lib/activation.jar" dest="${thirdparty.dir}/activation.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-javamail/${sun-javamail}/lib/mail.jar" dest="${thirdparty.dir}/mail.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-api.jar" dest="${thirdparty.dir}/jaxb-api.jar" usetimestamp="true" verbose="true"/>
@@ -134,13 +135,14 @@
<target name="thirdparty-classpath" depends="thirdparty-get">
<!-- The compile classpath for jbossws core -->
- <path id="thirdparty.classpath">
+ <path id="thirdparty.classpath">
<!-- A stack MUST NOT have a compile time dependency on jbossws-framework.jar -->
<pathelement location="${thirdparty.dir}/jbossws-common.jar"/>
<pathelement location="${thirdparty.dir}/jbossws-spi.jar"/>
-
- <pathelement location="${thirdparty.dir}/ant.jar"/>
- <pathelement location="${thirdparty.dir}/activation.jar"/>
+
+ <pathelement location="${thirdparty.dir}/FastInfoset.jar"/>
+ <pathelement location="${thirdparty.dir}/ant.jar"/>
+ <pathelement location="${thirdparty.dir}/activation.jar"/>
<pathelement location="${thirdparty.dir}/dom4j.jar"/>
<pathelement location="${thirdparty.dir}/getopt.jar"/>
<pathelement location="${thirdparty.dir}/javassist.jar"/>
@@ -153,6 +155,7 @@
<pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
<pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
<pathelement location="${thirdparty.dir}/jboss-javaee.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-jaxb-intros.jar"/>
<pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
<pathelement location="${thirdparty.dir}/jboss-microcontainer.jar"/>
<pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
@@ -167,8 +170,7 @@
<pathelement location="${thirdparty.dir}/xalan.jar"/>
<pathelement location="${thirdparty.dir}/xmlsec.jar"/>
<pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-jaxb-intros.jar"/>
- </path>
+ </path>
</target>
Modified: stack/native/trunk/ant-import/jbossws-deploy-macros.xml
===================================================================
--- stack/native/trunk/ant-import/jbossws-deploy-macros.xml 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/ant-import/jbossws-deploy-macros.xml 2008-03-12 19:02:14 UTC (rev 5949)
@@ -30,6 +30,7 @@
</patternset>
<patternset id="jbossws.client.patternset">
+ <include name="**/FastInfoset.jar"/>
<include name="**/jbossws-client.jar"/>
<include name="**/jbossws-common.jar"/>
<include name="**/jbossws-framework.jar"/>
@@ -75,6 +76,7 @@
</patternset>
<patternset id="jbossws.service.lib.patternset">
+ <include name="**/FastInfoset.jar"/>
<include name="**/jboss-jaxb-intros.jar"/>
<include name="**/jbossws-core.jar"/>
<include name="**/policy.jar"/>
Modified: stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2008-03-12 19:02:14 UTC (rev 5949)
@@ -106,6 +106,13 @@
</fileset>
</jar>
+ <!-- jaxws-fastinfoset -->
+ <war warfile="${tests.output.dir}/libs/jaxws-fastinfoset.war" webxml="${tests.output.dir}/resources/jaxws/fastinfoset/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-handlerlifecycle -->
<war warfile="${tests.output.dir}/libs/jaxws-handlerlifecycle.war" webxml="${tests.output.dir}/resources/jaxws/handlerlifecycle/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Modified: stack/native/trunk/ant-import-tests/build-testsuite.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-testsuite.xml 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/ant-import-tests/build-testsuite.xml 2008-03-12 19:02:14 UTC (rev 5949)
@@ -39,6 +39,7 @@
</path>
<path id="tests.extra.classpath">
+ <pathelement location="${core.dir}/thirdparty/FastInfoset.jar"/>
<pathelement location="${core.dir}/thirdparty/jbossws-framework.jar"/>
<pathelement location="${core.dir}/thirdparty/jaxws-tools.jar"/>
<pathelement location="${core.dir}/thirdparty/policy.jar"/>
Copied: stack/native/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,46 @@
+/*
+ * 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.annotation;
+
+// $Id$
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * A endpoint feature meta annotation
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 29-Feb-2008
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.ANNOTATION_TYPE })
+public @interface EndpointFeature {
+
+ /**
+ * The id of this endpoint feature
+ */
+ String id() default "";
+
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,48 @@
+/*
+ * 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.annotation;
+
+// $Id$
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.ws.feature.FastInfosetFeature;
+
+/**
+ * This feature represents the use of FastInfoset
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 29-Feb-2008
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.TYPE })
+@EndpointFeature( id = FastInfosetFeature.ID)
+public @interface FastInfoset {
+
+ /**
+ * Specifies if the feature is enabled or disabled
+ */
+ boolean enabled() default true;
+}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -29,6 +29,7 @@
import java.lang.annotation.Target;
import org.jboss.ws.extensions.validation.StrictlyValidErrorHandler;
+import org.jboss.ws.feature.SchemaValidationFeature;
/**
* This feature represents the use of schema validation with a
@@ -39,6 +40,7 @@
*/
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = { ElementType.TYPE })
+@EndpointFeature( id = SchemaValidationFeature.ID)
public @interface SchemaValidation
{
/**
@@ -54,4 +56,9 @@
* If this is not specified the @{ValidationErrorHandler} will be used.
*/
Class errorHandler() default StrictlyValidErrorHandler.class;
+
+ /**
+ * Specifies if the feature is enabled or disabled
+ */
+ boolean enabled() default true;
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -27,7 +27,10 @@
import java.util.Map;
import java.util.Properties;
+import javax.xml.ws.WebServiceFeature;
+
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.FeatureResolver;
/** A wrapper object that associates the target address with some metadata
*
@@ -38,9 +41,11 @@
{
private String targetAddress;
private Map<String, Object> properties;
+ private FeatureResolver features;
public EndpointInfo(EndpointMetaData epMetaData, String targetAddress, Map<String, Object> callProps)
{
+ this.features = epMetaData.getFeatureResolver();
this.targetAddress = targetAddress;
this.properties = callProps;
@@ -81,6 +86,11 @@
return targetAddress;
}
+ public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T> key)
+ {
+ return features.isFeatureEnabled(key);
+ }
+
public boolean equals(Object obj)
{
if (!(obj instanceof EndpointInfo))
Copied: stack/native/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.client;
+
+// $Id$
+
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.soap.FastInfosetMarshaller;
+import org.jboss.ws.core.soap.FastInfosetUnMarshaller;
+
+/**
+ * SOAPConnection implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Mar-2008
+ */
+public class FastInfosetConnectionHTTP extends SOAPProtocolConnectionHTTP
+{
+ public UnMarshaller getUnmarshaller()
+ {
+ return new FastInfosetUnMarshaller();
+ }
+
+ public Marshaller getMarshaller()
+ {
+ return new FastInfosetMarshaller();
+ }
+}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -54,10 +54,12 @@
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.config.EndpointProperty;
import org.jboss.ws.metadata.config.CommonConfig;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.extensions.wsrm.transport.RMChannel;
import org.jboss.ws.extensions.wsrm.transport.RMTransportHelper;
import org.jboss.ws.extensions.wsrm.transport.RMMetadata;
+import org.jboss.ws.feature.FastInfosetFeature;
/**
* SOAPConnection implementation.
@@ -306,12 +308,14 @@
// May be overridden through endpoint config
if (msgContext != null)
{
- CommonConfig config = msgContext.getEndpointMetaData().getConfig();
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ CommonConfig config = epMetaData.getConfig();
// chunksize settings
String chunkSizeValue = config.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
int chunkSize = chunkSizeValue != null ? Integer.valueOf(chunkSizeValue) : -1;
- if (chunkSize > 0)
+ boolean isFastInfoset = epMetaData.isFeatureEnabled(FastInfosetFeature.class);
+ if (chunkSize > 0 && isFastInfoset == false)
{
clientConfig.put(EndpointProperty.CHUNKED_ENCODING_SIZE, chunkSizeValue);
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.core.client;
+import org.jboss.ws.feature.FastInfosetFeature;
import org.jboss.wsf.spi.util.ServiceLoader;
// $Id$
@@ -48,6 +49,9 @@
if (key == null)
throw new IllegalArgumentException("Cannot obtain remote connetion for: " + targetAddress);
+ if (epInfo.isFeatureEnabled(FastInfosetFeature.class))
+ key += ".fastinfoset";
+
RemoteConnection con = (RemoteConnection)ServiceLoader.loadService(key, null);
if (con == null)
throw new IllegalArgumentException("Cannot obtain remote connetion for: " + key);
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -24,18 +24,15 @@
// $Id$
import java.io.IOException;
-import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
-import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import org.jboss.remoting.marshal.Marshaller;
import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.ws.WSException;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.soap.SOAPMessageMarshaller;
import org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP;
@@ -46,7 +43,6 @@
*
* @author Thomas.Diesler(a)jboss.org
* @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
- *
* @since 02-Apr-2007
*/
public class SOAPProtocolConnectionHTTP extends HTTPRemotingConnection
@@ -87,9 +83,9 @@
protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
{
super.populateHeaders(reqMessage, metadata);
-
+
Properties props = (Properties)metadata.get("HEADER");
-
+
// R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
// with a quoted value equal to the value of the soapAction attribute of
// soapbind:operation, if present in the corresponding WSDL description.
@@ -115,6 +111,6 @@
{
props.put("SOAPAction", "\"\"");
}
-
+
}
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -560,12 +560,11 @@
{
if (features != null)
{
- Set<WebServiceFeature> featureSet = new HashSet<WebServiceFeature>();
- for (WebServiceFeature feature : features)
- featureSet.add(feature);
-
EndpointMetaData epMetaData = ((StubExt)stub).getEndpointMetaData();
- epMetaData.setWebServiceFeatures(featureSet);
+ for (WebServiceFeature feature : features)
+ {
+ epMetaData.addFeature(feature);
+ }
}
}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.Constants;
+import org.jboss.ws.core.CommonSOAPFaultException;
+import org.jboss.wsf.common.DOMUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import com.sun.xml.fastinfoset.dom.DOMDocumentParser;
+
+/**
+ * A SOAPEnvelope builder for FastInfoset
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class FastInfosetEnvelopeBuilder extends EnvelopeBuilderDOM
+{
+ @Override
+ public SOAPEnvelope build(SOAPMessage soapMessage, InputStream ins, boolean ignoreParseError) throws IOException, SOAPException
+ {
+ // Parse the XML input stream
+ Element domEnv = null;
+ try
+ {
+ DOMDocumentParser parser = new DOMDocumentParser();
+ Document resDoc = DOMUtils.getDocumentBuilder().newDocument();
+ parser.parse(resDoc, ins);
+ domEnv = resDoc.getDocumentElement();
+ }
+ catch (Exception ex)
+ {
+ if (ignoreParseError)
+ {
+ return null;
+ }
+ QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
+ throw new CommonSOAPFaultException(faultCode, ex.getMessage());
+ }
+
+ return build(soapMessage, domEnv);
+ }
+
+ @Override
+ public SOAPEnvelope build(SOAPMessage soapMessage, Reader reader, boolean ignoreParseError) throws IOException, SOAPException
+ {
+ throw new NotImplementedException();
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.invocation.OnewayInvocation;
+import org.jboss.remoting.marshal.Marshaller;
+
+import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Mar-2008
+ */
+public class FastInfosetMarshaller implements Marshaller
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(FastInfosetMarshaller.class);
+
+ /**
+ * Marshaller will need to take the dataObject and convert
+ * into primitive java data types and write to the
+ * given output.
+ *
+ * @param dataObject Object to be writen to output
+ * @param output The data output to write the object
+ * data to.
+ */
+ public void write(Object dataObject, OutputStream output) throws IOException
+ {
+ if (dataObject instanceof InvocationRequest)
+ dataObject = ((InvocationRequest)dataObject).getParameter();
+
+ if (dataObject instanceof OnewayInvocation)
+ dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
+
+ if ((dataObject instanceof SOAPMessage) == false)
+ throw new IllegalArgumentException("Not a SOAPMessage: " + dataObject);
+
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)dataObject;
+ if (soapMessage.getAttachments().hasNext())
+ throw new IllegalStateException("Attachments not supported with FastInfoset");
+
+ try
+ {
+ SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
+ DOMDocumentSerializer serializer = new DOMDocumentSerializer();
+ serializer.setOutputStream(output);
+ serializer.serialize(soapEnv);
+ }
+ catch (SOAPException ex)
+ {
+ IOException ioex = new IOException("Cannot serialize SOAP Envelope");
+ ioex.initCause(ex);
+ throw ioex;
+ }
+ }
+
+ public Marshaller cloneMarshaller() throws CloneNotSupportedException
+ {
+ return new FastInfosetMarshaller();
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Mar-2008
+ */
+public class FastInfosetUnMarshaller extends SOAPMessageUnMarshallerHTTP
+{
+ @Override
+ protected MessageFactoryImpl getMessageFactory()
+ {
+ CommonMessageContext context = MessageContextAssociation.peekMessageContext();
+ EndpointMetaData epMetaData = context != null ? context.getEndpointMetaData() : null;
+
+ MessageFactoryImpl factory = super.getMessageFactory();
+ if (epMetaData != null)
+ factory.setFeatureResolver(epMetaData.getFeatureResolver());
+
+ return factory;
+ }
+
+}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -39,12 +39,15 @@
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service.Mode;
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder;
+import org.jboss.ws.feature.FastInfosetFeature;
+import org.jboss.ws.metadata.umdm.FeatureResolver;
import org.jboss.wsf.common.IOUtils;
import org.jboss.wsf.spi.util.ServiceLoader;
@@ -64,21 +67,18 @@
private Mode serviceMode;
// The style used by this MessageFactory
private Style style;
+ // The features used by this MessageFactory
+ private FeatureResolver features = new FeatureResolver();
// Used if the style is dynamic
private boolean dynamic;
- private EnvelopeBuilder envelopeBuilder;
-
public MessageFactoryImpl()
{
envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
- envelopeBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), EnvelopeBuilderDOM.class.getName());
}
public MessageFactoryImpl(String protocol) throws SOAPException
{
- envelopeBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), EnvelopeBuilderDOM.class.getName());
-
if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol) || SOAPConstants.DEFAULT_SOAP_PROTOCOL.equals(protocol))
envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol))
@@ -137,6 +137,16 @@
this.serviceMode = serviceMode;
}
+ public void addFeature(WebServiceFeature feature)
+ {
+ this.features.addFeature(feature);
+ }
+
+ public void setFeatureResolver(FeatureResolver features)
+ {
+ this.features = features;
+ }
+
/**
* Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope,
* SOAPBody, and SOAPHeader objects. Profile-specific message factories can
@@ -255,11 +265,19 @@
soapMessage.setAttachments(attachments);
// Get the SOAPEnvelope builder
+ EnvelopeBuilder envBuilder;
+ if (features.isFeatureEnabled(FastInfosetFeature.class))
+ {
+ envBuilder = new FastInfosetEnvelopeBuilder();
+ }
+ else
+ {
+ envBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), null);
+ }
- envelopeBuilder.setStyle(getStyle());
-
// Build the payload
- envelopeBuilder.build(soapMessage, inputStream, ignoreParseError);
+ envBuilder.setStyle(getStyle());
+ envBuilder.build(soapMessage, inputStream, ignoreParseError);
}
return soapMessage;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -100,7 +100,7 @@
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- feature = epMetaData.getWebServiceFeature(SchemaValidationFeature.class);
+ feature = epMetaData.getFeature(SchemaValidationFeature.class);
URL xsdURL = feature.getSchemaLocation() != null ? new URL(feature.getSchemaLocation()) : null;
if (xsdURL == null)
{
@@ -139,7 +139,7 @@
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (msgContext != null)
- feature = msgContext.getEndpointMetaData().getWebServiceFeature(SchemaValidationFeature.class);
+ feature = msgContext.getEndpointMetaData().getFeature(SchemaValidationFeature.class);
return feature != null ? feature.isEnabled() : false;
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -49,7 +49,7 @@
try
{
- SOAPMessage soapMsg = new MessageFactoryImpl().createMessage(null, inputStream, true);
+ SOAPMessage soapMsg = getMessageFactory().createMessage(null, inputStream, true);
return soapMsg;
}
@@ -62,6 +62,11 @@
}
}
+ protected MessageFactoryImpl getMessageFactory()
+ {
+ return new MessageFactoryImpl();
+ }
+
public void setClassLoader(ClassLoader classloader)
{
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -81,7 +81,7 @@
if (resCode != HttpServletResponse.SC_NO_CONTENT)
{
MimeHeaders mimeHeaders = getMimeHeaders(metadata);
- soapMsg = new MessageFactoryImpl().createMessage(mimeHeaders, inputStream, true);
+ soapMsg = getMessageFactory().createMessage(mimeHeaders, inputStream, true);
}
return soapMsg;
@@ -95,6 +95,11 @@
}
}
+ protected MessageFactoryImpl getMessageFactory()
+ {
+ return new MessageFactoryImpl();
+ }
+
/**
* Set the class loader to use for unmarhsalling. This may
* be needed when need to have access to class definitions that
Copied: stack/native/trunk/src/main/java/org/jboss/ws/feature/FastInfosetFeature.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/feature/FastInfosetFeature.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/feature/FastInfosetFeature.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/feature/FastInfosetFeature.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,69 @@
+/*
+ * 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.feature;
+
+// $Id$
+
+import javax.xml.ws.WebServiceFeature;
+
+import org.jboss.ws.Constants;
+
+/**
+ * This feature represents the use of FastInfoset
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 29-Feb-2008
+ */
+public final class FastInfosetFeature extends WebServiceFeature
+{
+ /**
+ * Constant value identifying the SchemaValidationFeature
+ */
+ public static final String ID = Constants.NS_JBOSSWS_URI + "/features/fastinfoset";
+
+ /**
+ * Create an <code>SchemaValidationFeature</code>.
+ * The instance created will be enabled.
+ */
+ public FastInfosetFeature()
+ {
+ this.enabled = true;
+ }
+
+ /**
+ * Creates an <code>SchemaValidationFeature</code>.
+ *
+ * @param enabled specifies if this feature should be enabled or not
+ */
+ public FastInfosetFeature(boolean enabled)
+ {
+ this.enabled = enabled;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getID()
+ {
+ return ID;
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,108 @@
+/*
+ * 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.metadata.builder.jaxws;
+
+// $Id$
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.net.URL;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.annotation.FastInfoset;
+import org.jboss.ws.annotation.SchemaValidation;
+import org.jboss.ws.feature.FastInfosetFeature;
+import org.jboss.ws.feature.SchemaValidationFeature;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.xml.sax.ErrorHandler;
+
+/**
+ * Process EndpointFeature annotations
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class EndpointFeatureProcessor
+{
+ protected void processEndpointFeatures(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
+ {
+ for (Annotation an : sepClass.getAnnotations())
+ {
+ if (an.annotationType() == SchemaValidation.class)
+ {
+ processSchemaValidation(dep, sepMetaData, sepClass);
+ }
+ else if (an.annotationType() == FastInfoset.class)
+ {
+ processFastInfoset(dep, sepMetaData, sepClass);
+ }
+ }
+ }
+
+ private void processFastInfoset(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
+ {
+ FastInfoset anFeature = sepClass.getAnnotation(FastInfoset.class);
+ FastInfosetFeature feature = new FastInfosetFeature(anFeature.enabled());
+ sepMetaData.addFeature(feature);
+ }
+
+ private void processSchemaValidation(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
+ {
+ SchemaValidation anFeature = sepClass.getAnnotation(SchemaValidation.class);
+ SchemaValidationFeature feature = new SchemaValidationFeature(anFeature.enabled());
+
+ String xsdLoc = anFeature.schemaLocation();
+ if (xsdLoc.length() > 0)
+ {
+ if (dep instanceof ArchiveDeployment)
+ {
+ try
+ {
+ URL xsdURL = ((ArchiveDeployment)dep).getMetaDataFileURL(xsdLoc);
+ xsdLoc = xsdURL.toExternalForm();
+ }
+ catch (IOException ex)
+ {
+ throw new WSException("Cannot load schema: " + xsdLoc, ex);
+ }
+ }
+ feature.setSchemaLocation(xsdLoc);
+ }
+
+ Class handlerClass = anFeature.errorHandler();
+ if (handlerClass != null)
+ {
+ try
+ {
+ ErrorHandler errorHandler = (ErrorHandler)handlerClass.newInstance();
+ feature.setErrorHandler(errorHandler);
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot instanciate error handler: " + handlerClass, ex);
+ }
+ }
+ sepMetaData.addFeature(feature);
+ }
+}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -24,7 +24,6 @@
// $Id$
import java.io.File;
-import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@@ -60,7 +59,6 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.annotation.Documentation;
-import org.jboss.ws.annotation.SchemaValidation;
import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
import org.jboss.ws.core.jaxws.JAXBContextFactory;
import org.jboss.ws.core.jaxws.WrapperGenerator;
@@ -72,7 +70,6 @@
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.extensions.xop.jaxws.AttachmentScanResult;
import org.jboss.ws.extensions.xop.jaxws.ReflectiveAttachmentRefScanner;
-import org.jboss.ws.feature.SchemaValidationFeature;
import org.jboss.ws.metadata.accessor.JAXBAccessorFactoryCreator;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -91,8 +88,6 @@
import org.jboss.ws.metadata.wsdl.WSDLMIMEPart;
import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.HandlerChainsObjectFactory;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
@@ -102,7 +97,6 @@
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
-import org.xml.sax.ErrorHandler;
import com.sun.xml.bind.api.JAXBRIContext;
import com.sun.xml.bind.api.TypeReference;
@@ -554,10 +548,10 @@
String tns = epMetaData.getPortName().getNamespaceURI();
String portTypeName = epMetaData.getPortName().getLocalPart();
String opName = opMetaData.getQName().getLocalPart();
- addrExt.setInboundAction(tns + "/" + portTypeName + "/" + opName + "Request");
+ addrExt.setInboundAction(tns + "/" + portTypeName + "/" + opName + "Request");
if (!opMetaData.isOneWay())
- addrExt.setOutboundAction(tns + "/" + portTypeName + "/" + opName + "Response");
+ addrExt.setOutboundAction(tns + "/" + portTypeName + "/" + opName + "Response");
}
opMetaData.addExtension(addrExt);
@@ -598,7 +592,7 @@
throw new IllegalArgumentException("@SOAPBinding must be specified using DOCUMENT style when placed on a method");
opMetaData.setParameterStyle(anBinding.parameterStyle());
}
-
+
if (method.isAnnotationPresent(Documentation.class))
{
opMetaData.setDocumentation(method.getAnnotation(Documentation.class).content());
@@ -1040,46 +1034,4 @@
{
this.wrapperGenerator = wrapperGenerator;
}
-
- protected void processWebServiceFeatures(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
- {
- if (sepClass.isAnnotationPresent(SchemaValidation.class))
- {
- SchemaValidation anValidation = sepClass.getAnnotation(SchemaValidation.class);
- SchemaValidationFeature feature = new SchemaValidationFeature();
-
- String xsdLoc = anValidation.schemaLocation();
- if (xsdLoc.length() > 0)
- {
- if (dep instanceof ArchiveDeployment)
- {
- try
- {
- URL xsdURL = ((ArchiveDeployment)dep).getMetaDataFileURL(xsdLoc);
- xsdLoc = xsdURL.toExternalForm();
- }
- catch (IOException ex)
- {
- throw new WSException("Cannot load schema: " + xsdLoc, ex);
- }
- }
- feature.setSchemaLocation(xsdLoc);
- }
-
- Class handlerClass = anValidation.errorHandler();
- if (handlerClass != null)
- {
- try
- {
- ErrorHandler errorHandler = (ErrorHandler)handlerClass.newInstance();
- feature.setErrorHandler(errorHandler);
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot instanciate error handler: " + handlerClass, ex);
- }
- }
- sepMetaData.addWebServiceFeature(feature);
- }
- }
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -139,7 +139,8 @@
processEndpointConfig(dep, sepMetaData, sepClass, linkName);
// process web service features
- processWebServiceFeatures(dep, sepMetaData, sepClass);
+ EndpointFeatureProcessor epFeatureProcessor = new EndpointFeatureProcessor();
+ epFeatureProcessor.processEndpointFeatures(dep, sepMetaData, sepClass);
// Process endpoint documentation
if (seiClass.isAnnotationPresent(Documentation.class))
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -28,6 +28,11 @@
* @version $Id$
* @since 14.12.2006
*/
+
+/**
+ * Refactor this to use features
+ */
+@Deprecated
public class EndpointProperty
{
public final static String MTOM_THRESHOLD = "http://org.jboss.ws/mtom#threshold";
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -63,6 +63,7 @@
import org.jboss.ws.core.soap.Use;
import org.jboss.ws.extensions.wsrm.config.RMConfig;
import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
+import org.jboss.ws.feature.FastInfosetFeature;
import org.jboss.ws.metadata.accessor.AccessorFactory;
import org.jboss.ws.metadata.accessor.AccessorFactoryCreator;
import org.jboss.ws.metadata.accessor.JAXBAccessorFactoryCreator;
@@ -150,7 +151,7 @@
// All of the registered types
private List<Class> registeredTypes = new ArrayList<Class>();
// The features defined for this endpoint
- private Set<WebServiceFeature> features = new HashSet<WebServiceFeature>();
+ private FeatureResolver features = new FeatureResolver();
// The documentation edfined through the @Documentation annotation
private String documentation;
@@ -363,29 +364,24 @@
this.properties = properties;
}
- public <T extends WebServiceFeature> T getWebServiceFeature(Class<T> key)
+ public <T extends WebServiceFeature> T getFeature(Class<T> key)
{
- for (WebServiceFeature feature : features)
- {
- if (key == feature.getClass())
- return (T)feature;
- }
- return null;
+ return features.getFeature(key);
}
- public Set<WebServiceFeature> getWebServiceFeatures()
+ public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T> key)
{
- return features;
+ return features.isFeatureEnabled(key);
}
-
- public void addWebServiceFeature(WebServiceFeature feature)
+
+ public FeatureResolver getFeatureResolver()
{
- this.features.add(feature);
+ return features;
}
- public void setWebServiceFeatures(Set<WebServiceFeature> features)
+ public void addFeature(WebServiceFeature feature)
{
- this.features = features;
+ this.features.addFeature(feature);
}
public String getDocumentation()
Copied: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,68 @@
+/*
+ * 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.metadata.umdm;
+
+// $Id$
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * A component that maintains a set of web service features
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2005
+ */
+public class FeatureResolver
+{
+ // The features defined for this endpoint
+ private Set<WebServiceFeature> features = new HashSet<WebServiceFeature>();
+
+ public <T extends WebServiceFeature> boolean hasFeature(Class<T> key)
+ {
+ return getFeature(key) != null;
+ }
+
+ public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T> key)
+ {
+ T feature = getFeature(key);
+ return (feature != null ? feature.isEnabled() : false);
+ }
+
+ public <T extends WebServiceFeature> T getFeature(Class<T> key)
+ {
+ for (WebServiceFeature feature : features)
+ {
+ if (key == feature.getClass())
+ return (T)feature;
+ }
+ return null;
+ }
+
+ public void addFeature(WebServiceFeature feature)
+ {
+ this.features.add(feature);
+ }
+
+}
Modified: stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -80,6 +80,7 @@
import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.feature.FastInfosetFeature;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
@@ -97,6 +98,8 @@
import org.jboss.wsf.common.IOUtils;
import org.w3c.dom.Document;
+import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
+
/**
* A request handler
*
@@ -310,7 +313,7 @@
boolean isWsrmMessage = rmResCtx != null;
boolean isWsrmOneWay = isWsrmMessage && (Boolean)rmResCtx.get(RMConstant.ONE_WAY_OPERATION);
if ((outStream != null) && (isWsrmOneWay == false)) // RM hack
- sendResponse(outStream, msgContext, isFault);
+ sendResponse(endpoint, outStream, isFault);
}
catch (Exception ex)
{
@@ -331,9 +334,12 @@
}
}
- private void sendResponse(OutputStream outputStream, CommonMessageContext msgContext, boolean isFault) throws SOAPException, IOException
+ private void sendResponse(Endpoint endpoint, OutputStream output, boolean isFault) throws SOAPException, IOException
{
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+
String wsaTo = null;
// Get the destination from the AddressingProperties
@@ -352,7 +358,17 @@
}
else
{
- resMessage.writeTo(outputStream);
+ if (epMetaData.isFeatureEnabled(FastInfosetFeature.class) && resMessage instanceof SOAPMessage)
+ {
+ SOAPEnvelope soapEnv = ((SOAPMessage)resMessage).getSOAPPart().getEnvelope();
+ DOMDocumentSerializer serializer = new DOMDocumentSerializer();
+ serializer.setOutputStream(output);
+ serializer.serialize(soapEnv);
+ }
+ else
+ {
+ resMessage.writeTo(output);
+ }
}
}
@@ -397,6 +413,7 @@
msgFactory.setServiceMode(sepMetaData.getServiceMode());
msgFactory.setStyle(sepMetaData.getStyle());
+ msgFactory.setFeatureResolver(sepMetaData.getFeatureResolver());
reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers, inputStream);
}
Copied: stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset (from rev 5948, stack/native/branches/tdiesler/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset)
===================================================================
--- stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset (rev 0)
+++ stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1 @@
+org.jboss.ws.core.client.FastInfosetConnectionHTTP
\ No newline at end of file
Copied: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset (from rev 5948, stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset)
Deleted: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfoset.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfoset.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfoset.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -1,34 +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.test.ws.jaxws.fastinfoset;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-@WebService(targetNamespace = "http://org.jboss.ws/fastinfoset")
-@SOAPBinding(style = SOAPBinding.Style.RPC)
-public interface FastInfoset
-{
- @WebMethod
- String echo(String code);
-}
Copied: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfoset.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfoset.java)
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfoset.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfoset.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,34 @@
+/*
+ * 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.fastinfoset;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(targetNamespace = "http://org.jboss.ws/fastinfoset")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface FastInfoset
+{
+ @WebMethod
+ String echo(String code);
+}
Deleted: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -1,120 +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.test.ws.jaxws.fastinfoset;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.feature.FastInfosetFeature;
-import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jvnet.fastinfoset.FastInfosetException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import com.sun.xml.fastinfoset.dom.DOMDocumentParser;
-import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
-
-/**
- * Test FastInfoset functionality
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 12-Mar-2008
- */
-public class FastInfosetAPITestCase extends JBossWSTest
-{
- public void testSimple() throws Exception
- {
- String srcXML = "<root>hello world</root>";
- ByteArrayInputStream bais = getFastInputStream(srcXML);
- Document resDoc = getFastDocument(bais);
- String resXML = DOMWriter.printNode(resDoc, false);
- assertEquals(srcXML, resXML);
- }
-
- public void testSimpleNamespace() throws Exception
- {
- String srcXML = "<root xmlns='http://somens'>hello world</root>";
- ByteArrayInputStream bais = getFastInputStream(srcXML);
- Document resDoc = getFastDocument(bais);
- String resXML = DOMWriter.printNode(resDoc, false);
- assertEquals(srcXML, resXML);
- }
-
- public void testPrefixedNamespace() throws Exception
- {
- String srcXML = "<ns1:root xmlns:ns1='http://somens'>hello world</ns1:root>";
- ByteArrayInputStream bais = getFastInputStream(srcXML);
- Document resDoc = getFastDocument(bais);
- String resXML = DOMWriter.printNode(resDoc, false);
- assertEquals(srcXML, resXML);
- }
-
- public void testMessageFactory() throws Exception
- {
- String srcXML =
- "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Body>" +
- " <ns1:echo xmlns:ns1='http://org.jboss.ws/fastinfoset'><arg0>hello world</arg0></ns1:echo>" +
- " </env:Body>" +
- "</env:Envelope>";
-
- Element srcEnv = DOMUtils.parse(srcXML);
- ByteArrayInputStream bais = getFastInputStream(srcXML);
-
- MessageFactoryImpl factory = new MessageFactoryImpl();
- factory.addFeature(new FastInfosetFeature());
- SOAPMessage soapMessage = factory.createMessage(null, bais);
- SOAPEnvelope resEnv = soapMessage.getSOAPPart().getEnvelope();
- assertEquals(srcEnv, resEnv);
- }
-
- private ByteArrayInputStream getFastInputStream(String srcXML) throws IOException
- {
- DOMDocumentSerializer serializer = new DOMDocumentSerializer();
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- serializer.setOutputStream(baos);
- Element srcRoot = DOMUtils.parse(srcXML);
- serializer.serialize(srcRoot);
-
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- return bais;
- }
-
- private Document getFastDocument(ByteArrayInputStream bais) throws FastInfosetException, IOException
- {
- DOMDocumentParser parser = new DOMDocumentParser();
- Document resDoc = DOMUtils.getDocumentBuilder().newDocument();
- parser.parse(resDoc, bais);
- return resDoc;
- }
-}
Copied: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java)
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,120 @@
+/*
+ * 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.fastinfoset;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.feature.FastInfosetFeature;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jvnet.fastinfoset.FastInfosetException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import com.sun.xml.fastinfoset.dom.DOMDocumentParser;
+import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
+
+/**
+ * Test FastInfoset functionality
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class FastInfosetAPITestCase extends JBossWSTest
+{
+ public void testSimple() throws Exception
+ {
+ String srcXML = "<root>hello world</root>";
+ ByteArrayInputStream bais = getFastInputStream(srcXML);
+ Document resDoc = getFastDocument(bais);
+ String resXML = DOMWriter.printNode(resDoc, false);
+ assertEquals(srcXML, resXML);
+ }
+
+ public void testSimpleNamespace() throws Exception
+ {
+ String srcXML = "<root xmlns='http://somens'>hello world</root>";
+ ByteArrayInputStream bais = getFastInputStream(srcXML);
+ Document resDoc = getFastDocument(bais);
+ String resXML = DOMWriter.printNode(resDoc, false);
+ assertEquals(srcXML, resXML);
+ }
+
+ public void testPrefixedNamespace() throws Exception
+ {
+ String srcXML = "<ns1:root xmlns:ns1='http://somens'>hello world</ns1:root>";
+ ByteArrayInputStream bais = getFastInputStream(srcXML);
+ Document resDoc = getFastDocument(bais);
+ String resXML = DOMWriter.printNode(resDoc, false);
+ assertEquals(srcXML, resXML);
+ }
+
+ public void testMessageFactory() throws Exception
+ {
+ String srcXML =
+ "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <env:Body>" +
+ " <ns1:echo xmlns:ns1='http://org.jboss.ws/fastinfoset'><arg0>hello world</arg0></ns1:echo>" +
+ " </env:Body>" +
+ "</env:Envelope>";
+
+ Element srcEnv = DOMUtils.parse(srcXML);
+ ByteArrayInputStream bais = getFastInputStream(srcXML);
+
+ MessageFactoryImpl factory = new MessageFactoryImpl();
+ factory.addFeature(new FastInfosetFeature());
+ SOAPMessage soapMessage = factory.createMessage(null, bais);
+ SOAPEnvelope resEnv = soapMessage.getSOAPPart().getEnvelope();
+ assertEquals(srcEnv, resEnv);
+ }
+
+ private ByteArrayInputStream getFastInputStream(String srcXML) throws IOException
+ {
+ DOMDocumentSerializer serializer = new DOMDocumentSerializer();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ serializer.setOutputStream(baos);
+ Element srcRoot = DOMUtils.parse(srcXML);
+ serializer.serialize(srcRoot);
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ return bais;
+ }
+
+ private Document getFastDocument(ByteArrayInputStream bais) throws FastInfosetException, IOException
+ {
+ DOMDocumentParser parser = new DOMDocumentParser();
+ Document resDoc = DOMUtils.getDocumentBuilder().newDocument();
+ parser.parse(resDoc, bais);
+ return resDoc;
+ }
+}
Deleted: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -1,45 +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.test.ws.jaxws.fastinfoset;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.FastInfoset;
-
-@WebService(targetNamespace = "http://org.jboss.ws/fastinfoset")
-@SOAPBinding(style = SOAPBinding.Style.RPC)
-@FastInfoset
-public class FastInfosetEndpoint
-{
- // provide logging
- private static Logger log = Logger.getLogger(FastInfosetEndpoint.class);
-
- @WebMethod
- public String echo(String code)
- {
- log.info(code);
- return code;
- }
-}
Copied: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java)
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,45 @@
+/*
+ * 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.fastinfoset;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.FastInfoset;
+
+@WebService(targetNamespace = "http://org.jboss.ws/fastinfoset")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@FastInfoset
+public class FastInfosetEndpoint
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(FastInfosetEndpoint.class);
+
+ @WebMethod
+ public String echo(String code)
+ {
+ log.info(code);
+ return code;
+ }
+}
Deleted: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -1,96 +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.test.ws.jaxws.fastinfoset;
-
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service21;
-
-import junit.framework.Test;
-
-import org.jboss.ws.feature.FastInfosetFeature;
-import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-import org.w3c.dom.Element;
-
-import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
-
-/**
- * Test FastInfoset functionality
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 12-Mar-2008
- */
-public class FastInfosetTestCase extends JBossWSTest
-{
- public static Test suite()
- {
- return new JBossWSTestSetup(FastInfosetTestCase.class, "jaxws-fastinfoset.war");
- }
-
- public void testURLConnection() throws Exception
- {
- String reqEnv =
- "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Body>" +
- " <ns1:echo xmlns:ns1='http://org.jboss.ws/fastinfoset'><arg0>hello world</arg0></ns1:echo>" +
- " </env:Body>" +
- "</env:Envelope>";
-
- String targetAddress = "http://" + getServerHost() + ":8080/jaxws-fastinfoset";
- HttpURLConnection con = (HttpURLConnection)new URL(targetAddress).openConnection();
- con.setRequestProperty("Content-Type", "text/xml; charset=UTF-8");
- con.setRequestMethod("POST");
- con.setDoOutput(true);
- con.connect();
-
- OutputStream outs = con.getOutputStream();
- DOMDocumentSerializer serializer = new DOMDocumentSerializer();
- serializer.setOutputStream(outs);
-
- Element srcRoot = DOMUtils.parse(reqEnv);
- serializer.serialize(srcRoot);
- outs.close();
-
- int resCode = con.getResponseCode();
- assertEquals(200, resCode);
- }
-
- public void _testSimple() throws Exception
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-fastinfoset?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/fastinfoset", "FastInfosetEndpointService");
- Service21 service = Service21.create(wsdlURL, serviceName);
-
- FastInfosetFeature feature = new FastInfosetFeature(false);
- FastInfoset port = service.getPort(FastInfoset.class, feature);
- String retStr = port.echo("hello world");
- assertEquals("hello world", retStr);
- }
-
-}
Copied: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java (from rev 5948, stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java)
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,96 @@
+/*
+ * 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.fastinfoset;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service21;
+
+import junit.framework.Test;
+
+import org.jboss.ws.feature.FastInfosetFeature;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Element;
+
+import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
+
+/**
+ * Test FastInfoset functionality
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class FastInfosetTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(FastInfosetTestCase.class, "jaxws-fastinfoset.war");
+ }
+
+ public void testURLConnection() throws Exception
+ {
+ String reqEnv =
+ "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <env:Body>" +
+ " <ns1:echo xmlns:ns1='http://org.jboss.ws/fastinfoset'><arg0>hello world</arg0></ns1:echo>" +
+ " </env:Body>" +
+ "</env:Envelope>";
+
+ String targetAddress = "http://" + getServerHost() + ":8080/jaxws-fastinfoset";
+ HttpURLConnection con = (HttpURLConnection)new URL(targetAddress).openConnection();
+ con.setRequestProperty("Content-Type", "text/xml; charset=UTF-8");
+ con.setRequestMethod("POST");
+ con.setDoOutput(true);
+ con.connect();
+
+ OutputStream outs = con.getOutputStream();
+ DOMDocumentSerializer serializer = new DOMDocumentSerializer();
+ serializer.setOutputStream(outs);
+
+ Element srcRoot = DOMUtils.parse(reqEnv);
+ serializer.serialize(srcRoot);
+ outs.close();
+
+ int resCode = con.getResponseCode();
+ assertEquals(200, resCode);
+ }
+
+ public void testRoundTrip() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-fastinfoset?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/fastinfoset", "FastInfosetEndpointService");
+ Service21 service = Service21.create(wsdlURL, serviceName);
+
+ FastInfosetFeature feature = new FastInfosetFeature();
+ FastInfoset port = service.getPort(FastInfoset.class, feature);
+ String retStr = port.echo("hello world");
+ assertEquals("hello world", retStr);
+ }
+
+}
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java 2008-03-12 19:02:14 UTC (rev 5949)
@@ -43,21 +43,21 @@
return new JBossWSTestSetup(AddressingClientTestCase.class, "jaxws-samples-dar.jar,jaxws-samples-dar-addressing-client.war");
}
- public void testSync() throws Exception
+ public void _testSync() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/dar?wsdl");
AddressingClient client = new AddressingClient(wsdlURL);
client.run(false);
}
- public void testAsync() throws Exception
+ public void _testAsync() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/dar?wsdl");
AddressingClient client = new AddressingClient(wsdlURL);
client.run(true);
}
- public void testOneWay() throws Exception
+ public void _testOneWay() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/dar?wsdl");
AddressingClient client = new AddressingClient(wsdlURL);
Copied: stack/native/trunk/src/test/resources/jaxws/fastinfoset (from rev 5948, stack/native/branches/tdiesler/trunk/src/test/resources/jaxws/fastinfoset)
Copied: stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF (from rev 5948, stack/native/branches/tdiesler/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF)
Deleted: stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/web.xml
===================================================================
--- stack/native/branches/tdiesler/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/web.xml 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/web.xml 2008-03-12 19:02:14 UTC (rev 5949)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <servlet>
- <servlet-name>FastInfosetEndpoint</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.fastinfoset.FastInfosetEndpoint</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>FastInfosetEndpoint</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-</web-app>
\ No newline at end of file
Copied: stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/web.xml (from rev 5948, stack/native/branches/tdiesler/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/web.xml)
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/fastinfoset/WEB-INF/web.xml 2008-03-12 19:02:14 UTC (rev 5949)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>FastInfosetEndpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.fastinfoset.FastInfosetEndpoint</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>FastInfosetEndpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Modified: stack/native/trunk/version.properties
===================================================================
--- stack/native/trunk/version.properties 2008-03-12 18:34:32 UTC (rev 5948)
+++ stack/native/trunk/version.properties 2008-03-12 19:02:14 UTC (rev 5949)
@@ -62,6 +62,7 @@
junit=3.8.1
oswego-concurrent=1.3.4
qdox=1.4
+sun-fi=1.2.2
sun-jaf=1.1
sun-javamail=1.4
sun-servlet=2.4
16 years, 7 months
JBossWS SVN: r5948 - in stack/native/branches/tdiesler/trunk/src: main/java/org/jboss/ws/core/client and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-03-12 14:34:32 -0400 (Wed, 12 Mar 2008)
New Revision: 5948
Removed:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java
stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java
Log:
More on FastInfoset
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2008-03-12 17:38:20 UTC (rev 5947)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2008-03-12 18:34:32 UTC (rev 5948)
@@ -54,10 +54,12 @@
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.config.EndpointProperty;
import org.jboss.ws.metadata.config.CommonConfig;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.extensions.wsrm.transport.RMChannel;
import org.jboss.ws.extensions.wsrm.transport.RMTransportHelper;
import org.jboss.ws.extensions.wsrm.transport.RMMetadata;
+import org.jboss.ws.feature.FastInfosetFeature;
/**
* SOAPConnection implementation.
@@ -306,12 +308,14 @@
// May be overridden through endpoint config
if (msgContext != null)
{
- CommonConfig config = msgContext.getEndpointMetaData().getConfig();
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ CommonConfig config = epMetaData.getConfig();
// chunksize settings
String chunkSizeValue = config.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
int chunkSize = chunkSizeValue != null ? Integer.valueOf(chunkSizeValue) : -1;
- if (chunkSize > 0)
+ boolean isFastInfoset = epMetaData.isFeatureEnabled(FastInfosetFeature.class);
+ if (chunkSize > 0 && isFastInfoset == false)
{
clientConfig.put(EndpointProperty.CHUNKED_ENCODING_SIZE, chunkSizeValue);
}
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java 2008-03-12 17:38:20 UTC (rev 5947)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java 2008-03-12 18:34:32 UTC (rev 5948)
@@ -59,6 +59,7 @@
DOMDocumentParser parser = new DOMDocumentParser();
Document resDoc = DOMUtils.getDocumentBuilder().newDocument();
parser.parse(resDoc, ins);
+ domEnv = resDoc.getDocumentElement();
}
catch (Exception ex)
{
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-12 17:38:20 UTC (rev 5947)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-12 18:34:32 UTC (rev 5948)
@@ -39,6 +39,7 @@
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service.Mode;
import org.jboss.logging.Logger;
@@ -136,6 +137,11 @@
this.serviceMode = serviceMode;
}
+ public void addFeature(WebServiceFeature feature)
+ {
+ this.features.addFeature(feature);
+ }
+
public void setFeatureResolver(FeatureResolver features)
{
this.features = features;
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java 2008-03-12 17:38:20 UTC (rev 5947)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java 2008-03-12 18:34:32 UTC (rev 5948)
@@ -28,6 +28,11 @@
* @version $Id$
* @since 14.12.2006
*/
+
+/**
+ * Refactor this to use features
+ */
+@Deprecated
public class EndpointProperty
{
public final static String MTOM_THRESHOLD = "http://org.jboss.ws/mtom#threshold";
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-12 17:38:20 UTC (rev 5947)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-12 18:34:32 UTC (rev 5948)
@@ -63,6 +63,7 @@
import org.jboss.ws.core.soap.Use;
import org.jboss.ws.extensions.wsrm.config.RMConfig;
import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
+import org.jboss.ws.feature.FastInfosetFeature;
import org.jboss.ws.metadata.accessor.AccessorFactory;
import org.jboss.ws.metadata.accessor.AccessorFactoryCreator;
import org.jboss.ws.metadata.accessor.JAXBAccessorFactoryCreator;
@@ -368,6 +369,11 @@
return features.getFeature(key);
}
+ public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T> key)
+ {
+ return features.isFeatureEnabled(key);
+ }
+
public FeatureResolver getFeatureResolver()
{
return features;
Modified: stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java 2008-03-12 17:38:20 UTC (rev 5947)
+++ stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetAPITestCase.java 2008-03-12 18:34:32 UTC (rev 5948)
@@ -23,10 +23,21 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.feature.FastInfosetFeature;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.test.JBossWSTest;
+import org.jvnet.fastinfoset.FastInfosetException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -43,58 +54,67 @@
{
public void testSimple() throws Exception
{
- DOMDocumentSerializer serializer = new DOMDocumentSerializer();
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- serializer.setOutputStream(baos);
-
String srcXML = "<root>hello world</root>";
- Element srcRoot = DOMUtils.parse(srcXML);
- serializer.serialize(srcRoot);
-
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- DOMDocumentParser parser = new DOMDocumentParser();
- Document resDoc = DOMUtils.getDocumentBuilder().newDocument();
- parser.parse(resDoc, bais);
-
+ ByteArrayInputStream bais = getFastInputStream(srcXML);
+ Document resDoc = getFastDocument(bais);
String resXML = DOMWriter.printNode(resDoc, false);
assertEquals(srcXML, resXML);
}
public void testSimpleNamespace() throws Exception
{
- DOMDocumentSerializer serializer = new DOMDocumentSerializer();
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- serializer.setOutputStream(baos);
-
String srcXML = "<root xmlns='http://somens'>hello world</root>";
- Element srcRoot = DOMUtils.parse(srcXML);
- serializer.serialize(srcRoot);
-
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- DOMDocumentParser parser = new DOMDocumentParser();
- Document resDoc = DOMUtils.getDocumentBuilder().newDocument();
- parser.parse(resDoc, bais);
-
+ ByteArrayInputStream bais = getFastInputStream(srcXML);
+ Document resDoc = getFastDocument(bais);
String resXML = DOMWriter.printNode(resDoc, false);
assertEquals(srcXML, resXML);
}
public void testPrefixedNamespace() throws Exception
{
+ String srcXML = "<ns1:root xmlns:ns1='http://somens'>hello world</ns1:root>";
+ ByteArrayInputStream bais = getFastInputStream(srcXML);
+ Document resDoc = getFastDocument(bais);
+ String resXML = DOMWriter.printNode(resDoc, false);
+ assertEquals(srcXML, resXML);
+ }
+
+ public void testMessageFactory() throws Exception
+ {
+ String srcXML =
+ "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <env:Body>" +
+ " <ns1:echo xmlns:ns1='http://org.jboss.ws/fastinfoset'><arg0>hello world</arg0></ns1:echo>" +
+ " </env:Body>" +
+ "</env:Envelope>";
+
+ Element srcEnv = DOMUtils.parse(srcXML);
+ ByteArrayInputStream bais = getFastInputStream(srcXML);
+
+ MessageFactoryImpl factory = new MessageFactoryImpl();
+ factory.addFeature(new FastInfosetFeature());
+ SOAPMessage soapMessage = factory.createMessage(null, bais);
+ SOAPEnvelope resEnv = soapMessage.getSOAPPart().getEnvelope();
+ assertEquals(srcEnv, resEnv);
+ }
+
+ private ByteArrayInputStream getFastInputStream(String srcXML) throws IOException
+ {
DOMDocumentSerializer serializer = new DOMDocumentSerializer();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
serializer.setOutputStream(baos);
-
- String srcXML = "<ns1:root xmlns:ns1='http://somens'>hello world</ns1:root>";
Element srcRoot = DOMUtils.parse(srcXML);
serializer.serialize(srcRoot);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ return bais;
+ }
+
+ private Document getFastDocument(ByteArrayInputStream bais) throws FastInfosetException, IOException
+ {
DOMDocumentParser parser = new DOMDocumentParser();
Document resDoc = DOMUtils.getDocumentBuilder().newDocument();
parser.parse(resDoc, bais);
-
- String resXML = DOMWriter.printNode(resDoc, false);
- assertEquals(srcXML, resXML);
+ return resDoc;
}
}
Modified: stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java 2008-03-12 17:38:20 UTC (rev 5947)
+++ stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java 2008-03-12 18:34:32 UTC (rev 5948)
@@ -21,7 +21,11 @@
*/
package org.jboss.test.ws.jaxws.fastinfoset;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
import java.net.URL;
+import java.net.URLConnection;
import javax.xml.namespace.QName;
import javax.xml.ws.Service21;
@@ -29,9 +33,13 @@
import junit.framework.Test;
import org.jboss.ws.feature.FastInfosetFeature;
+import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Element;
+import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
+
/**
* Test FastInfoset functionality
*
@@ -45,15 +53,44 @@
return new JBossWSTestSetup(FastInfosetTestCase.class, "jaxws-fastinfoset.war");
}
- public void testSimple() throws Exception
+ public void testURLConnection() throws Exception
{
+ String reqEnv =
+ "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <env:Body>" +
+ " <ns1:echo xmlns:ns1='http://org.jboss.ws/fastinfoset'><arg0>hello world</arg0></ns1:echo>" +
+ " </env:Body>" +
+ "</env:Envelope>";
+
+ String targetAddress = "http://" + getServerHost() + ":8080/jaxws-fastinfoset";
+ HttpURLConnection con = (HttpURLConnection)new URL(targetAddress).openConnection();
+ con.setRequestProperty("Content-Type", "text/xml; charset=UTF-8");
+ con.setRequestMethod("POST");
+ con.setDoOutput(true);
+ con.connect();
+
+ OutputStream outs = con.getOutputStream();
+ DOMDocumentSerializer serializer = new DOMDocumentSerializer();
+ serializer.setOutputStream(outs);
+
+ Element srcRoot = DOMUtils.parse(reqEnv);
+ serializer.serialize(srcRoot);
+ outs.close();
+
+ int resCode = con.getResponseCode();
+ assertEquals(200, resCode);
+ }
+
+ public void _testSimple() throws Exception
+ {
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-fastinfoset?wsdl");
QName serviceName = new QName("http://org.jboss.ws/fastinfoset", "FastInfosetEndpointService");
Service21 service = Service21.create(wsdlURL, serviceName);
- FastInfosetFeature feature = new FastInfosetFeature();
+ FastInfosetFeature feature = new FastInfosetFeature(false);
FastInfoset port = service.getPort(FastInfoset.class, feature);
String retStr = port.echo("hello world");
assertEquals("hello world", retStr);
}
+
}
16 years, 7 months
JBossWS SVN: r5947 - stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-03-12 13:38:20 -0400 (Wed, 12 Mar 2008)
New Revision: 5947
Modified:
stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java
Log:
disable tests
Modified: stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java 2008-03-12 17:37:07 UTC (rev 5946)
+++ stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.java 2008-03-12 17:38:20 UTC (rev 5947)
@@ -43,21 +43,21 @@
return new JBossWSTestSetup(AddressingClientTestCase.class, "jaxws-samples-dar.jar,jaxws-samples-dar-addressing-client.war");
}
- public void testSync() throws Exception
+ public void _testSync() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/dar?wsdl");
AddressingClient client = new AddressingClient(wsdlURL);
client.run(false);
}
- public void testAsync() throws Exception
+ public void _testAsync() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/dar?wsdl");
AddressingClient client = new AddressingClient(wsdlURL);
client.run(true);
}
- public void testOneWay() throws Exception
+ public void _testOneWay() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/dar?wsdl");
AddressingClient client = new AddressingClient(wsdlURL);
16 years, 7 months
JBossWS SVN: r5946 - in stack/native/branches/tdiesler/trunk: src/main/java/org/jboss/ws/annotation and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-03-12 13:37:07 -0400 (Wed, 12 Mar 2008)
New Revision: 5946
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
stack/native/branches/tdiesler/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset
Removed:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java
Modified:
stack/native/branches/tdiesler/trunk/ant-import/build-thirdparty.xml
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java
Log:
More on FastInfoset
Modified: stack/native/branches/tdiesler/trunk/ant-import/build-thirdparty.xml
===================================================================
--- stack/native/branches/tdiesler/trunk/ant-import/build-thirdparty.xml 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/ant-import/build-thirdparty.xml 2008-03-12 17:37:07 UTC (rev 5946)
@@ -135,13 +135,14 @@
<target name="thirdparty-classpath" depends="thirdparty-get">
<!-- The compile classpath for jbossws core -->
- <path id="thirdparty.classpath">
+ <path id="thirdparty.classpath">
<!-- A stack MUST NOT have a compile time dependency on jbossws-framework.jar -->
<pathelement location="${thirdparty.dir}/jbossws-common.jar"/>
<pathelement location="${thirdparty.dir}/jbossws-spi.jar"/>
-
- <pathelement location="${thirdparty.dir}/ant.jar"/>
- <pathelement location="${thirdparty.dir}/activation.jar"/>
+
+ <pathelement location="${thirdparty.dir}/FastInfoset.jar"/>
+ <pathelement location="${thirdparty.dir}/ant.jar"/>
+ <pathelement location="${thirdparty.dir}/activation.jar"/>
<pathelement location="${thirdparty.dir}/dom4j.jar"/>
<pathelement location="${thirdparty.dir}/getopt.jar"/>
<pathelement location="${thirdparty.dir}/javassist.jar"/>
@@ -154,6 +155,7 @@
<pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
<pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
<pathelement location="${thirdparty.dir}/jboss-javaee.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-jaxb-intros.jar"/>
<pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
<pathelement location="${thirdparty.dir}/jboss-microcontainer.jar"/>
<pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
@@ -168,8 +170,7 @@
<pathelement location="${thirdparty.dir}/xalan.jar"/>
<pathelement location="${thirdparty.dir}/xmlsec.jar"/>
<pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-jaxb-intros.jar"/>
- </path>
+ </path>
</target>
Added: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java (rev 0)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -0,0 +1,46 @@
+/*
+ * 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.annotation;
+
+// $Id$
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * A endpoint feature meta annotation
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 29-Feb-2008
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.ANNOTATION_TYPE })
+public @interface EndpointFeature {
+
+ /**
+ * The id of this endpoint feature
+ */
+ String id() default "";
+
+}
Property changes on: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java (rev 0)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -0,0 +1,48 @@
+/*
+ * 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.annotation;
+
+// $Id$
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.ws.feature.FastInfosetFeature;
+
+/**
+ * This feature represents the use of FastInfoset
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 29-Feb-2008
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.TYPE })
+@EndpointFeature( id = FastInfosetFeature.ID)
+public @interface FastInfoset {
+
+ /**
+ * Specifies if the feature is enabled or disabled
+ */
+ boolean enabled() default true;
+}
Property changes on: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -29,6 +29,7 @@
import java.lang.annotation.Target;
import org.jboss.ws.extensions.validation.StrictlyValidErrorHandler;
+import org.jboss.ws.feature.SchemaValidationFeature;
/**
* This feature represents the use of schema validation with a
@@ -39,6 +40,7 @@
*/
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = { ElementType.TYPE })
+@EndpointFeature( id = SchemaValidationFeature.ID)
public @interface SchemaValidation
{
/**
@@ -54,4 +56,9 @@
* If this is not specified the @{ValidationErrorHandler} will be used.
*/
Class errorHandler() default StrictlyValidErrorHandler.class;
+
+ /**
+ * Specifies if the feature is enabled or disabled
+ */
+ boolean enabled() default true;
}
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -27,7 +27,10 @@
import java.util.Map;
import java.util.Properties;
+import javax.xml.ws.WebServiceFeature;
+
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.FeatureResolver;
/** A wrapper object that associates the target address with some metadata
*
@@ -38,9 +41,11 @@
{
private String targetAddress;
private Map<String, Object> properties;
+ private FeatureResolver features;
public EndpointInfo(EndpointMetaData epMetaData, String targetAddress, Map<String, Object> callProps)
{
+ this.features = epMetaData.getFeatureResolver();
this.targetAddress = targetAddress;
this.properties = callProps;
@@ -81,6 +86,11 @@
return targetAddress;
}
+ public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T> key)
+ {
+ return features.isFeatureEnabled(key);
+ }
+
public boolean equals(Object obj)
{
if (!(obj instanceof EndpointInfo))
Added: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java (rev 0)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.client;
+
+// $Id$
+
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.soap.FastInfosetMarshaller;
+import org.jboss.ws.core.soap.FastInfosetUnMarshaller;
+
+/**
+ * SOAPConnection implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Mar-2008
+ */
+public class FastInfosetConnectionHTTP extends SOAPProtocolConnectionHTTP
+{
+ public UnMarshaller getUnmarshaller()
+ {
+ return new FastInfosetUnMarshaller();
+ }
+
+ public Marshaller getMarshaller()
+ {
+ return new FastInfosetMarshaller();
+ }
+}
Property changes on: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.core.client;
+import org.jboss.ws.feature.FastInfosetFeature;
import org.jboss.wsf.spi.util.ServiceLoader;
// $Id$
@@ -48,6 +49,9 @@
if (key == null)
throw new IllegalArgumentException("Cannot obtain remote connetion for: " + targetAddress);
+ if (epInfo.isFeatureEnabled(FastInfosetFeature.class))
+ key += ".fastinfoset";
+
RemoteConnection con = (RemoteConnection)ServiceLoader.loadService(key, null);
if (con == null)
throw new IllegalArgumentException("Cannot obtain remote connetion for: " + key);
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -24,18 +24,15 @@
// $Id$
import java.io.IOException;
-import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
-import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import org.jboss.remoting.marshal.Marshaller;
import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.ws.WSException;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.soap.SOAPMessageMarshaller;
import org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP;
@@ -46,7 +43,6 @@
*
* @author Thomas.Diesler(a)jboss.org
* @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
- *
* @since 02-Apr-2007
*/
public class SOAPProtocolConnectionHTTP extends HTTPRemotingConnection
@@ -87,9 +83,9 @@
protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
{
super.populateHeaders(reqMessage, metadata);
-
+
Properties props = (Properties)metadata.get("HEADER");
-
+
// R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
// with a quoted value equal to the value of the soapAction attribute of
// soapbind:operation, if present in the corresponding WSDL description.
@@ -115,6 +111,6 @@
{
props.put("SOAPAction", "\"\"");
}
-
+
}
}
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -560,12 +560,11 @@
{
if (features != null)
{
- Set<WebServiceFeature> featureSet = new HashSet<WebServiceFeature>();
- for (WebServiceFeature feature : features)
- featureSet.add(feature);
-
EndpointMetaData epMetaData = ((StubExt)stub).getEndpointMetaData();
- epMetaData.setWebServiceFeatures(featureSet);
+ for (WebServiceFeature feature : features)
+ {
+ epMetaData.addFeature(feature);
+ }
}
}
Added: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java (rev 0)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.Constants;
+import org.jboss.ws.core.CommonSOAPFaultException;
+import org.jboss.wsf.common.DOMUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import com.sun.xml.fastinfoset.dom.DOMDocumentParser;
+
+/**
+ * A SOAPEnvelope builder for FastInfoset
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class FastInfosetEnvelopeBuilder extends EnvelopeBuilderDOM
+{
+ @Override
+ public SOAPEnvelope build(SOAPMessage soapMessage, InputStream ins, boolean ignoreParseError) throws IOException, SOAPException
+ {
+ // Parse the XML input stream
+ Element domEnv = null;
+ try
+ {
+ DOMDocumentParser parser = new DOMDocumentParser();
+ Document resDoc = DOMUtils.getDocumentBuilder().newDocument();
+ parser.parse(resDoc, ins);
+ }
+ catch (Exception ex)
+ {
+ if (ignoreParseError)
+ {
+ return null;
+ }
+ QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
+ throw new CommonSOAPFaultException(faultCode, ex.getMessage());
+ }
+
+ return build(soapMessage, domEnv);
+ }
+
+ @Override
+ public SOAPEnvelope build(SOAPMessage soapMessage, Reader reader, boolean ignoreParseError) throws IOException, SOAPException
+ {
+ throw new NotImplementedException();
+ }
+}
Property changes on: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java (rev 0)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.invocation.OnewayInvocation;
+import org.jboss.remoting.marshal.Marshaller;
+
+import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Mar-2008
+ */
+public class FastInfosetMarshaller implements Marshaller
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(FastInfosetMarshaller.class);
+
+ /**
+ * Marshaller will need to take the dataObject and convert
+ * into primitive java data types and write to the
+ * given output.
+ *
+ * @param dataObject Object to be writen to output
+ * @param output The data output to write the object
+ * data to.
+ */
+ public void write(Object dataObject, OutputStream output) throws IOException
+ {
+ if (dataObject instanceof InvocationRequest)
+ dataObject = ((InvocationRequest)dataObject).getParameter();
+
+ if (dataObject instanceof OnewayInvocation)
+ dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
+
+ if ((dataObject instanceof SOAPMessage) == false)
+ throw new IllegalArgumentException("Not a SOAPMessage: " + dataObject);
+
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)dataObject;
+ if (soapMessage.getAttachments().next() != null)
+ throw new IllegalStateException("Attachments not supported with FastInfoset");
+
+ try
+ {
+ SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
+ DOMDocumentSerializer serializer = new DOMDocumentSerializer();
+ serializer.setOutputStream(output);
+ serializer.serialize(soapEnv);
+ }
+ catch (SOAPException ex)
+ {
+ IOException ioex = new IOException("Cannot serialize SOAP Envelope");
+ ioex.initCause(ex);
+ throw ioex;
+ }
+ }
+
+ public Marshaller cloneMarshaller() throws CloneNotSupportedException
+ {
+ return new FastInfosetMarshaller();
+ }
+}
Property changes on: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java (rev 0)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Mar-2008
+ */
+public class FastInfosetUnMarshaller extends SOAPMessageUnMarshallerHTTP
+{
+ @Override
+ protected MessageFactoryImpl getMessageFactory()
+ {
+ CommonMessageContext context = MessageContextAssociation.peekMessageContext();
+ EndpointMetaData epMetaData = context != null ? context.getEndpointMetaData() : null;
+
+ MessageFactoryImpl factory = super.getMessageFactory();
+ if (epMetaData != null)
+ factory.setFeatureResolver(epMetaData.getFeatureResolver());
+
+ return factory;
+ }
+
+}
Property changes on: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -45,6 +45,8 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder;
+import org.jboss.ws.feature.FastInfosetFeature;
+import org.jboss.ws.metadata.umdm.FeatureResolver;
import org.jboss.wsf.common.IOUtils;
import org.jboss.wsf.spi.util.ServiceLoader;
@@ -64,21 +66,18 @@
private Mode serviceMode;
// The style used by this MessageFactory
private Style style;
+ // The features used by this MessageFactory
+ private FeatureResolver features = new FeatureResolver();
// Used if the style is dynamic
private boolean dynamic;
- private EnvelopeBuilder envelopeBuilder;
-
public MessageFactoryImpl()
{
envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
- envelopeBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), EnvelopeBuilderDOM.class.getName());
}
public MessageFactoryImpl(String protocol) throws SOAPException
{
- envelopeBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), EnvelopeBuilderDOM.class.getName());
-
if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol) || SOAPConstants.DEFAULT_SOAP_PROTOCOL.equals(protocol))
envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol))
@@ -137,6 +136,11 @@
this.serviceMode = serviceMode;
}
+ public void setFeatureResolver(FeatureResolver features)
+ {
+ this.features = features;
+ }
+
/**
* Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope,
* SOAPBody, and SOAPHeader objects. Profile-specific message factories can
@@ -255,11 +259,19 @@
soapMessage.setAttachments(attachments);
// Get the SOAPEnvelope builder
+ EnvelopeBuilder envBuilder;
+ if (features.isFeatureEnabled(FastInfosetFeature.class))
+ {
+ envBuilder = new FastInfosetEnvelopeBuilder();
+ }
+ else
+ {
+ envBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), null);
+ }
- envelopeBuilder.setStyle(getStyle());
-
// Build the payload
- envelopeBuilder.build(soapMessage, inputStream, ignoreParseError);
+ envBuilder.setStyle(getStyle());
+ envBuilder.build(soapMessage, inputStream, ignoreParseError);
}
return soapMessage;
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -100,7 +100,7 @@
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- feature = epMetaData.getWebServiceFeature(SchemaValidationFeature.class);
+ feature = epMetaData.getFeature(SchemaValidationFeature.class);
URL xsdURL = feature.getSchemaLocation() != null ? new URL(feature.getSchemaLocation()) : null;
if (xsdURL == null)
{
@@ -139,7 +139,7 @@
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (msgContext != null)
- feature = msgContext.getEndpointMetaData().getWebServiceFeature(SchemaValidationFeature.class);
+ feature = msgContext.getEndpointMetaData().getFeature(SchemaValidationFeature.class);
return feature != null ? feature.isEnabled() : false;
}
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -49,7 +49,7 @@
try
{
- SOAPMessage soapMsg = new MessageFactoryImpl().createMessage(null, inputStream, true);
+ SOAPMessage soapMsg = getMessageFactory().createMessage(null, inputStream, true);
return soapMsg;
}
@@ -62,6 +62,11 @@
}
}
+ protected MessageFactoryImpl getMessageFactory()
+ {
+ return new MessageFactoryImpl();
+ }
+
public void setClassLoader(ClassLoader classloader)
{
}
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -81,7 +81,7 @@
if (resCode != HttpServletResponse.SC_NO_CONTENT)
{
MimeHeaders mimeHeaders = getMimeHeaders(metadata);
- soapMsg = new MessageFactoryImpl().createMessage(mimeHeaders, inputStream, true);
+ soapMsg = getMessageFactory().createMessage(mimeHeaders, inputStream, true);
}
return soapMsg;
@@ -95,6 +95,11 @@
}
}
+ protected MessageFactoryImpl getMessageFactory()
+ {
+ return new MessageFactoryImpl();
+ }
+
/**
* Set the class loader to use for unmarhsalling. This may
* be needed when need to have access to class definitions that
Added: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java (rev 0)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -0,0 +1,108 @@
+/*
+ * 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.metadata.builder.jaxws;
+
+// $Id$
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.net.URL;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.annotation.FastInfoset;
+import org.jboss.ws.annotation.SchemaValidation;
+import org.jboss.ws.feature.FastInfosetFeature;
+import org.jboss.ws.feature.SchemaValidationFeature;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.xml.sax.ErrorHandler;
+
+/**
+ * Process EndpointFeature annotations
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class EndpointFeatureProcessor
+{
+ protected void processEndpointFeatures(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
+ {
+ for (Annotation an : sepClass.getAnnotations())
+ {
+ if (an.annotationType() == SchemaValidation.class)
+ {
+ processSchemaValidation(dep, sepMetaData, sepClass);
+ }
+ else if (an.annotationType() == FastInfoset.class)
+ {
+ processFastInfoset(dep, sepMetaData, sepClass);
+ }
+ }
+ }
+
+ private void processFastInfoset(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
+ {
+ FastInfoset anFeature = sepClass.getAnnotation(FastInfoset.class);
+ FastInfosetFeature feature = new FastInfosetFeature(anFeature.enabled());
+ sepMetaData.addFeature(feature);
+ }
+
+ private void processSchemaValidation(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
+ {
+ SchemaValidation anFeature = sepClass.getAnnotation(SchemaValidation.class);
+ SchemaValidationFeature feature = new SchemaValidationFeature(anFeature.enabled());
+
+ String xsdLoc = anFeature.schemaLocation();
+ if (xsdLoc.length() > 0)
+ {
+ if (dep instanceof ArchiveDeployment)
+ {
+ try
+ {
+ URL xsdURL = ((ArchiveDeployment)dep).getMetaDataFileURL(xsdLoc);
+ xsdLoc = xsdURL.toExternalForm();
+ }
+ catch (IOException ex)
+ {
+ throw new WSException("Cannot load schema: " + xsdLoc, ex);
+ }
+ }
+ feature.setSchemaLocation(xsdLoc);
+ }
+
+ Class handlerClass = anFeature.errorHandler();
+ if (handlerClass != null)
+ {
+ try
+ {
+ ErrorHandler errorHandler = (ErrorHandler)handlerClass.newInstance();
+ feature.setErrorHandler(errorHandler);
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot instanciate error handler: " + handlerClass, ex);
+ }
+ }
+ sepMetaData.addFeature(feature);
+ }
+}
Property changes on: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -24,7 +24,6 @@
// $Id$
import java.io.File;
-import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@@ -60,7 +59,6 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.annotation.Documentation;
-import org.jboss.ws.annotation.SchemaValidation;
import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
import org.jboss.ws.core.jaxws.JAXBContextFactory;
import org.jboss.ws.core.jaxws.WrapperGenerator;
@@ -72,7 +70,6 @@
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.extensions.xop.jaxws.AttachmentScanResult;
import org.jboss.ws.extensions.xop.jaxws.ReflectiveAttachmentRefScanner;
-import org.jboss.ws.feature.SchemaValidationFeature;
import org.jboss.ws.metadata.accessor.JAXBAccessorFactoryCreator;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -91,8 +88,6 @@
import org.jboss.ws.metadata.wsdl.WSDLMIMEPart;
import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.HandlerChainsObjectFactory;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
@@ -102,7 +97,6 @@
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
-import org.xml.sax.ErrorHandler;
import com.sun.xml.bind.api.JAXBRIContext;
import com.sun.xml.bind.api.TypeReference;
@@ -554,10 +548,10 @@
String tns = epMetaData.getPortName().getNamespaceURI();
String portTypeName = epMetaData.getPortName().getLocalPart();
String opName = opMetaData.getQName().getLocalPart();
- addrExt.setInboundAction(tns + "/" + portTypeName + "/" + opName + "Request");
+ addrExt.setInboundAction(tns + "/" + portTypeName + "/" + opName + "Request");
if (!opMetaData.isOneWay())
- addrExt.setOutboundAction(tns + "/" + portTypeName + "/" + opName + "Response");
+ addrExt.setOutboundAction(tns + "/" + portTypeName + "/" + opName + "Response");
}
opMetaData.addExtension(addrExt);
@@ -598,7 +592,7 @@
throw new IllegalArgumentException("@SOAPBinding must be specified using DOCUMENT style when placed on a method");
opMetaData.setParameterStyle(anBinding.parameterStyle());
}
-
+
if (method.isAnnotationPresent(Documentation.class))
{
opMetaData.setDocumentation(method.getAnnotation(Documentation.class).content());
@@ -1040,46 +1034,4 @@
{
this.wrapperGenerator = wrapperGenerator;
}
-
- protected void processWebServiceFeatures(Deployment dep, ServerEndpointMetaData sepMetaData, Class<?> sepClass)
- {
- if (sepClass.isAnnotationPresent(SchemaValidation.class))
- {
- SchemaValidation anValidation = sepClass.getAnnotation(SchemaValidation.class);
- SchemaValidationFeature feature = new SchemaValidationFeature();
-
- String xsdLoc = anValidation.schemaLocation();
- if (xsdLoc.length() > 0)
- {
- if (dep instanceof ArchiveDeployment)
- {
- try
- {
- URL xsdURL = ((ArchiveDeployment)dep).getMetaDataFileURL(xsdLoc);
- xsdLoc = xsdURL.toExternalForm();
- }
- catch (IOException ex)
- {
- throw new WSException("Cannot load schema: " + xsdLoc, ex);
- }
- }
- feature.setSchemaLocation(xsdLoc);
- }
-
- Class handlerClass = anValidation.errorHandler();
- if (handlerClass != null)
- {
- try
- {
- ErrorHandler errorHandler = (ErrorHandler)handlerClass.newInstance();
- feature.setErrorHandler(errorHandler);
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot instanciate error handler: " + handlerClass, ex);
- }
- }
- sepMetaData.addWebServiceFeature(feature);
- }
- }
}
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -139,7 +139,8 @@
processEndpointConfig(dep, sepMetaData, sepClass, linkName);
// process web service features
- processWebServiceFeatures(dep, sepMetaData, sepClass);
+ EndpointFeatureProcessor epFeatureProcessor = new EndpointFeatureProcessor();
+ epFeatureProcessor.processEndpointFeatures(dep, sepMetaData, sepClass);
// Process endpoint documentation
if (seiClass.isAnnotationPresent(Documentation.class))
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -150,7 +150,7 @@
// All of the registered types
private List<Class> registeredTypes = new ArrayList<Class>();
// The features defined for this endpoint
- private Set<WebServiceFeature> features = new HashSet<WebServiceFeature>();
+ private FeatureResolver features = new FeatureResolver();
// The documentation edfined through the @Documentation annotation
private String documentation;
@@ -363,31 +363,21 @@
this.properties = properties;
}
- public <T extends WebServiceFeature> T getWebServiceFeature(Class<T> key)
+ public <T extends WebServiceFeature> T getFeature(Class<T> key)
{
- for (WebServiceFeature feature : features)
- {
- if (key == feature.getClass())
- return (T)feature;
- }
- return null;
+ return features.getFeature(key);
}
- public Set<WebServiceFeature> getWebServiceFeatures()
+ public FeatureResolver getFeatureResolver()
{
return features;
}
- public void addWebServiceFeature(WebServiceFeature feature)
+ public void addFeature(WebServiceFeature feature)
{
- this.features.add(feature);
+ this.features.addFeature(feature);
}
- public void setWebServiceFeatures(Set<WebServiceFeature> features)
- {
- this.features = features;
- }
-
public String getDocumentation()
{
return documentation;
Added: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java (rev 0)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -0,0 +1,68 @@
+/*
+ * 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.metadata.umdm;
+
+// $Id$
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * A component that maintains a set of web service features
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2005
+ */
+public class FeatureResolver
+{
+ // The features defined for this endpoint
+ private Set<WebServiceFeature> features = new HashSet<WebServiceFeature>();
+
+ public <T extends WebServiceFeature> boolean hasFeature(Class<T> key)
+ {
+ return getFeature(key) != null;
+ }
+
+ public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T> key)
+ {
+ T feature = getFeature(key);
+ return (feature != null ? feature.isEnabled() : false);
+ }
+
+ public <T extends WebServiceFeature> T getFeature(Class<T> key)
+ {
+ for (WebServiceFeature feature : features)
+ {
+ if (key == feature.getClass())
+ return (T)feature;
+ }
+ return null;
+ }
+
+ public void addFeature(WebServiceFeature feature)
+ {
+ this.features.add(feature);
+ }
+
+}
Property changes on: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -1,66 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Axis" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.jboss.ws.soap;
-
-// $Id$
-
-
-/**
- * Included for backwards compatibility
- * @deprecated
- */
-public class SOAPConnectionFactoryImpl extends org.jboss.ws.core.soap.SOAPConnectionFactoryImpl
-{
-}
Modified: stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -397,6 +397,7 @@
msgFactory.setServiceMode(sepMetaData.getServiceMode());
msgFactory.setStyle(sepMetaData.getStyle());
+ msgFactory.setFeatureResolver(sepMetaData.getFeatureResolver());
reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers, inputStream);
}
Added: stack/native/branches/tdiesler/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset
===================================================================
--- stack/native/branches/tdiesler/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset (rev 0)
+++ stack/native/branches/tdiesler/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset 2008-03-12 17:37:07 UTC (rev 5946)
@@ -0,0 +1 @@
+org.jboss.ws.core.client.FastInfosetConnectionHTTP
\ No newline at end of file
Modified: stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java
===================================================================
--- stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java 2008-03-12 16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java 2008-03-12 17:37:07 UTC (rev 5946)
@@ -26,9 +26,11 @@
import javax.jws.soap.SOAPBinding;
import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.FastInfoset;
@WebService(targetNamespace = "http://org.jboss.ws/fastinfoset")
@SOAPBinding(style = SOAPBinding.Style.RPC)
+@FastInfoset
public class FastInfosetEndpoint
{
// provide logging
16 years, 7 months
JBossWS SVN: r5945 - in stack/native/trunk/src: main/java/org/jboss/ws/extensions/security/nonce and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-03-12 12:13:36 -0400 (Wed, 12 Mar 2008)
New Revision: 5945
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceGenerator.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DummyNonceStore.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceGenerator.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceStore.java
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/Util.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SendUsernameOperation.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
stack/native/trunk/src/main/resources/schema/jboss-ws-security_1_0.xsd
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java
stack/native/trunk/src/test/resources/jaxws/jbws1988/META-INF/jboss-service.xml
Log:
[JBWS-1988] Nonce factory, generator and store
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -34,6 +34,7 @@
import org.jboss.ws.extensions.security.element.Token;
import org.jboss.ws.extensions.security.element.UsernameToken;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.extensions.security.nonce.NonceFactory;
import org.jboss.ws.extensions.security.operation.DecryptionOperation;
import org.jboss.ws.extensions.security.operation.ReceiveUsernameOperation;
import org.jboss.ws.extensions.security.operation.RequireEncryptionOperation;
@@ -57,6 +58,8 @@
private SecurityHeader header;
private Document message;
+
+ private NonceFactory nonceFactory;
private SecurityStore store;
@@ -64,10 +67,11 @@
private HashSet<String> encryptedIds = new HashSet<String>();
- public SecurityDecoder(SecurityStore store)
+ public SecurityDecoder(SecurityStore store, NonceFactory nonceFactory)
{
org.apache.xml.security.Init.init();
this.store = store;
+ this.nonceFactory = nonceFactory;
}
/**
@@ -77,9 +81,9 @@
* @param SecurityStore the security store that contains key and trust information
* @param now The timestamp to use as the current time when validating a message expiration
*/
- public SecurityDecoder(SecurityStore store, Calendar now)
+ public SecurityDecoder(SecurityStore store, Calendar now, NonceFactory nonceFactory)
{
- this(store);
+ this(store, nonceFactory);
this.now = now;
}
@@ -113,7 +117,7 @@
for (Token token : header.getTokens())
{
if (token instanceof UsernameToken)
- new ReceiveUsernameOperation(header, store).process(message, token);
+ new ReceiveUsernameOperation(header, store, (nonceFactory != null ? nonceFactory.getStore() : null)).process(message, token);
}
signedIds.clear();
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/Util.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/Util.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/Util.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -23,14 +23,12 @@
//$Id$
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.List;
import javax.xml.namespace.QName;
-import org.jboss.util.Base64;
+import org.jboss.ws.WSException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -41,20 +39,7 @@
public class Util
{
public static int count = 0;
- private static SecureRandom pseudoRng;
- static
- {
- try
- {
- pseudoRng = SecureRandom.getInstance("SHA1PRNG");
- pseudoRng.setSeed(System.currentTimeMillis());
- }
- catch (NoSuchAlgorithmException e)
- {
- }
- }
-
public static String assignWsuId(Element element)
{
String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
@@ -233,10 +218,21 @@
return id.toString();
}
- public static String generateNonce()
+ @SuppressWarnings("unchecked")
+ public static <T> T loadFactory(Class<T> factoryType, String factoryClassName, Class<? extends T> defaultFactoryClassName)
{
- byte[] bytes = new byte[32];
- pseudoRng.nextBytes(bytes);
- return Base64.encodeBytes(bytes);
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ String name = factoryClassName != null ? factoryClassName : System.getProperty(factoryType.getName());
+ if (name == null)
+ name = defaultFactoryClassName.getName();
+ try
+ {
+ Class<T> cl = (Class<T>)loader.loadClass(name);
+ return cl.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new WSException(e);
+ }
}
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -35,6 +35,8 @@
import org.jboss.ws.core.CommonSOAPFaultException;
import org.jboss.ws.extensions.security.exception.InvalidSecurityHeaderException;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.extensions.security.nonce.DefaultNonceFactory;
+import org.jboss.ws.extensions.security.nonce.NonceFactory;
import org.jboss.ws.extensions.security.operation.EncodingOperation;
import org.jboss.ws.extensions.security.operation.EncryptionOperation;
//import org.jboss.ws.extensions.security.operation.OperationDescription;
@@ -156,7 +158,8 @@
{
SecurityStore securityStore = new SecurityStore(configuration.getKeyStoreURL(), configuration.getKeyStoreType(), configuration.getKeyStorePassword(),
configuration.getKeyPasswords(), configuration.getTrustStoreURL(), configuration.getTrustStoreType(), configuration.getTrustStorePassword());
- SecurityDecoder decoder = new SecurityDecoder(securityStore);
+ NonceFactory factory = Util.loadFactory(NonceFactory.class, configuration.getNonceFactory(), DefaultNonceFactory.class);
+ SecurityDecoder decoder = new SecurityDecoder(securityStore, factory);
decoder.decode(message.getSOAPPart(), secHeaderElement);
@@ -200,7 +203,8 @@
Username username = config.getUsername();
if (username != null && user != null && password != null)
{
- operations.add(new SendUsernameOperation(user, password, username.isDigestPassword(), username.isUseNonce(), username.isUseCreated()));
+ NonceFactory factory = Util.loadFactory(NonceFactory.class, configuration.getNonceFactory(), DefaultNonceFactory.class);
+ operations.add(new SendUsernameOperation(user, password, username.isDigestPassword(), username.isUseNonce(), username.isUseCreated(), factory.getGenerator()));
}
Sign sign = config.getSign();
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceFactory.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceFactory.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -0,0 +1,45 @@
+/*
+* 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.security.nonce;
+
+//$Id$
+
+/**
+ * The default nonce factory
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class DefaultNonceFactory implements NonceFactory
+{
+
+ public NonceGenerator getGenerator()
+ {
+ return new DefaultNonceGenerator();
+ }
+
+ public NonceStore getStore()
+ {
+ return new DummyNonceStore();
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceGenerator.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceGenerator.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceGenerator.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -0,0 +1,60 @@
+/*
+* 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.security.nonce;
+
+//$Id$
+
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+
+import org.jboss.util.Base64;
+
+/**
+ * A simple nonce generator using a SecureRandom instance.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class DefaultNonceGenerator implements NonceGenerator
+{
+ private static SecureRandom pseudoRng;
+
+ static
+ {
+ try
+ {
+ pseudoRng = SecureRandom.getInstance("SHA1PRNG");
+ pseudoRng.setSeed(System.currentTimeMillis());
+ }
+ catch (NoSuchAlgorithmException e)
+ {
+ }
+ }
+
+ public String generateNonce()
+ {
+ byte[] bytes = new byte[32];
+ pseudoRng.nextBytes(bytes);
+ return Base64.encodeBytes(bytes);
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DefaultNonceGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DummyNonceStore.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DummyNonceStore.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DummyNonceStore.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -0,0 +1,47 @@
+/*
+* 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.security.nonce;
+
+import org.jboss.logging.Logger;
+
+//$Id$
+
+/**
+ * A dummy nonce store providing no actual
+ * security increase against replay attacks.
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+public class DummyNonceStore implements NonceStore
+{
+
+ public boolean hasNonce(String nonce)
+ {
+ return false;
+ }
+
+ public void putNonce(String nonce)
+ {
+ Logger.getLogger(this.getClass()).warn("Please consider using a real nonce store to increase security against replay attacks.");
+ }
+
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/DummyNonceStore.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceFactory.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceFactory.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.nonce;
+
+//$Id$
+
+/**
+ * Generic interface for a factory of nonce generator and nonce store.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ *
+ */
+public interface NonceFactory
+{
+ public NonceGenerator getGenerator();
+
+ public NonceStore getStore();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceGenerator.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceGenerator.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceGenerator.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -0,0 +1,35 @@
+/*
+* 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.security.nonce;
+
+//$Id$
+
+/**
+ * Simple interface for a generator of nonces.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public interface NonceGenerator
+{
+ public String generateNonce();
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceStore.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceStore.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceStore.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -0,0 +1,49 @@
+/*
+* 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.security.nonce;
+
+//$Id$
+
+/**
+ * A nonce store collects recently used nonces.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ *
+ */
+public interface NonceStore
+{
+ /**
+ * Checks whether the store contains the provided nonce.
+ *
+ * @param nonce
+ * @return True if the provided nonce has been recently put in the store
+ */
+ public boolean hasNonce(String nonce);
+
+ /**
+ * Put the given nonce in the store.
+ *
+ * @param nonce
+ */
+ public void putNonce(String nonce);
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/nonce/NonceStore.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -23,6 +23,8 @@
// $Id$
+import java.util.Calendar;
+
import javax.security.auth.callback.CallbackHandler;
import org.jboss.logging.Logger;
@@ -34,23 +36,28 @@
import org.jboss.ws.extensions.security.element.Token;
import org.jboss.ws.extensions.security.element.UsernameToken;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.extensions.security.nonce.NonceStore;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.invocation.SecurityAdaptor;
import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+import org.jboss.xb.binding.SimpleTypeBindings;
import org.w3c.dom.Document;
public class ReceiveUsernameOperation implements TokenOperation
{
private SecurityHeader header;
private SecurityStore store;
+ private NonceStore nonceStore;
+ private static final int TIMESTAMP_FRESHNESS_THRESHOLD = 300;
private SecurityAdaptorFactory secAdapterfactory;
- public ReceiveUsernameOperation(SecurityHeader header, SecurityStore store)
+ public ReceiveUsernameOperation(SecurityHeader header, SecurityStore store, NonceStore nonceStore)
{
this.header = header;
this.store = store;
+ this.nonceStore = nonceStore;
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
secAdapterfactory = spiProvider.getSPI(SecurityAdaptorFactory.class);
@@ -64,10 +71,30 @@
Logger.getLogger(this.getClass()).info("Password: " + user.getPassword());
if (user.isDigest())
{
+ verifyUsernameToken(user);
CallbackHandler handler = new UsernameTokenCallbackHandler(user.getNonce(), user.getCreated());
CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
}
securityAdaptor.setPrincipal(new SimplePrincipal(user.getUsername()));
securityAdaptor.setCredential(user.getPassword());
}
+
+ private void verifyUsernameToken(UsernameToken token) throws WSSecurityException
+ {
+ if (token.getCreated() != null)
+ {
+ Calendar cal = SimpleTypeBindings.unmarshalDateTime(token.getCreated());
+ Calendar ref = Calendar.getInstance();
+ ref.add(Calendar.SECOND, -TIMESTAMP_FRESHNESS_THRESHOLD);
+ if (ref.after(cal))
+ throw new WSSecurityException("Request rejected since a stale timestamp has been provided: " + token.getCreated());
+ }
+ String nonce = token.getNonce();
+ if (nonce != null)
+ {
+ if (nonceStore.hasNonce(nonce))
+ throw new WSSecurityException("Request rejected since a message with the same nonce has been recently received; nonce = " + nonce);
+ nonceStore.putNonce(nonce);
+ }
+ }
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SendUsernameOperation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SendUsernameOperation.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/operation/SendUsernameOperation.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -36,12 +36,12 @@
import org.jboss.logging.Logger;
import org.jboss.security.Base64Encoder;
import org.jboss.ws.extensions.security.SecurityStore;
-import org.jboss.ws.extensions.security.Util;
import org.jboss.ws.extensions.security.auth.callback.UsernameTokenCallback;
import org.jboss.ws.extensions.security.auth.callback.UsernameTokenCallbackHandler;
import org.jboss.ws.extensions.security.element.SecurityHeader;
import org.jboss.ws.extensions.security.element.UsernameToken;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.extensions.security.nonce.NonceGenerator;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.w3c.dom.Document;
@@ -54,25 +54,26 @@
private boolean digestPassword;
private boolean useNonce;
private boolean useCreated;
+ private NonceGenerator nonceGenerator;
- public SendUsernameOperation(String username, String credential, boolean digestPassword, boolean useNonce, boolean useCreated)
+ public SendUsernameOperation(String username, String credential, boolean digestPassword, boolean useNonce, boolean useCreated, NonceGenerator nonceGenerator)
{
this.username = username;
this.credential = credential;
this.digestPassword = digestPassword;
this.useNonce = useNonce;
this.useCreated = useCreated;
+ this.nonceGenerator = nonceGenerator;
}
public void process(Document message, SecurityHeader header, SecurityStore store) throws WSSecurityException
{
String created = useCreated ? getCurrentTimestampAsString() : null;
- String nonce = useNonce ? Util.generateNonce() : null;
+ String nonce = useNonce ? nonceGenerator.generateNonce() : null;
String password = digestPassword ? createPasswordDigest(nonce, created, credential) : credential;
header.addToken(new UsernameToken(username, password, message, digestPassword, nonce, created));
}
-
private static String getCurrentTimestampAsString()
{
Calendar timestamp = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -46,6 +46,7 @@
private String trustStoreType;
private String trustStorePassword;
private HashMap<String, String> keyPasswords = new HashMap<String, String>();
+ private String nonceFactory;
public WSSecurityConfiguration()
{
@@ -165,4 +166,14 @@
{
this.keyPasswords = keyPasswords;
}
+
+ public String getNonceFactory()
+ {
+ return nonceFactory;
+ }
+
+ public void setNonceFactory(String nonceFactory)
+ {
+ this.nonceFactory = nonceFactory;
+ }
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -51,7 +51,7 @@
public static String CLIENT_RESOURCE_NAME = "jboss-wsse-client.xml";
- private static HashMap options = new HashMap(6);
+ private static HashMap options = new HashMap(7);
static
{
@@ -61,6 +61,7 @@
options.put("trust-store-file", "setTrustStoreFile");
options.put("trust-store-type", "setTrustStoreType");
options.put("trust-store-password", "setTrustStorePassword");
+ options.put("nonce-factory-class", "setNonceFactory");
}
// provide logging
@@ -147,7 +148,7 @@
if (method == null)
return;
- // Dispatch to propper initializer
+ // Dispatch to proper initializer
try
{
WSSecurityConfiguration.class.getMethod(method, new Class[] { String.class }).invoke(configuration, new Object[] { value });
Modified: stack/native/trunk/src/main/resources/schema/jboss-ws-security_1_0.xsd
===================================================================
--- stack/native/trunk/src/main/resources/schema/jboss-ws-security_1_0.xsd 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/main/resources/schema/jboss-ws-security_1_0.xsd 2008-03-12 16:13:36 UTC (rev 5945)
@@ -48,6 +48,11 @@
<xs:documentation>The WSDL port.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="nonce-factory-class" type="xs:string" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>This specifies the nonce factory class name. It is used to get the custom generator and store of nonces.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -95,7 +95,7 @@
cal.set(Calendar.MINUTE, 22);
cal.set(Calendar.SECOND, 25);
- SecurityDecoder decoder = new SecurityDecoder(new SecurityStore(), cal);
+ SecurityDecoder decoder = new SecurityDecoder(new SecurityStore(), cal, null);
decoder.decode(soapEnv.getOwnerDocument());
decoder.complete();
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -59,7 +59,7 @@
/**
* Simple WS-Security round trip test
- *
+ *
* @author <a href="mailto:jason.greene@jboss.com>Jason T. Greene</a>
*/
public class RoundTripTestCase extends JBossWSTest
@@ -95,7 +95,7 @@
env = soapMsg.getSOAPPart().getEnvelope();
doc = env.getOwnerDocument();
- SecurityDecoder decoder = new SecurityDecoder(new SecurityStore());
+ SecurityDecoder decoder = new SecurityDecoder(new SecurityStore(), null);
decoder.decode(doc);
decoder.verify(buildRequireOperations());
decoder.complete();
@@ -106,53 +106,40 @@
assertEquals(inputString, DOMWriter.printNode(doc, true));
}
-
+
public void testRoundTripUsingAPI() throws Exception
{
- String envStr = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"
- + " <env:Header>"
+ String envStr = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + " <env:Header>"
+ " <tns:someHeader xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'"
- + " tns:test='hi' xmlns:tns='http://org.jboss.ws/2004'>some header value</tns:someHeader>"
- + " </env:Header> "
+ + " tns:test='hi' xmlns:tns='http://org.jboss.ws/2004'>some header value</tns:someHeader>" + " </env:Header> "
+ " <env:Body wsu:Id='element-9-1205139829909-17908832' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>"
+ " <tns:echoString2 xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' xmlns:tns='http://org.jboss.ws/2004' "
- + " xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>"
- + " <string>Hello World!</string>"
- + " </tns:echoString2>"
- + " <tns:echoString xmlns:tns='http://org.jboss.ws/2004'>"
- + " <string>Hello World!</string>"
- + " </tns:echoString>"
- + " </env:Body>"
- + "</env:Envelope>";
+ + " xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>" + " <string>Hello World!</string>"
+ + " </tns:echoString2>" + " <tns:echoString xmlns:tns='http://org.jboss.ws/2004'>" + " <string>Hello World!</string>" + " </tns:echoString>"
+ + " </env:Body>" + "</env:Envelope>";
String conf = "<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
- + " xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>"
- + " <config>"
- + " <encrypt type='x509v3' alias='wsse'/>"
- + " <sign alias='wsse'/>"
- + " <username/>"
- + " <requires>"
- + " <encryption/>"
- + " <signature/>"
- + " </requires>"
- + " </config>"
- + "</jboss-ws-security>";
+ + " xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>" + " <config>"
+ + " <encrypt type='x509v3' alias='wsse'/>" + " <sign alias='wsse'/>" + " <username/>" + " <requires>" + " <encryption/>"
+ + " <signature/>" + " </requires>" + " </config>" + "</jboss-ws-security>";
WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(conf));
ByteArrayInputStream inputStream = new ByteArrayInputStream(envStr.getBytes());
MessageFactory factory = new MessageFactoryImpl();
SOAPMessage soapMsg = factory.createMessage(null, inputStream);
String expected = DOMWriter.printNode(soapMsg.getSOAPPart().getEnvelope(), true);
-
+
WSSecurityAPI sec = new WSSecurityDispatcher();
sec.encodeMessage(configuration, soapMsg, null, "kermit", "thefrog");
sec.decodeMessage(configuration, soapMsg, null);
-
+
String actual = DOMWriter.printNode(soapMsg.getSOAPPart().getEnvelope(), true);
assertEquals(expected, actual);
}
- // WS-Security leaves wsu:id attributes around on elements which are not cleaned
- // up due to performance reasons. This, however, breaks comparisons, so we manually
+ // WS-Security leaves wsu:id attributes around on elements which are not
+ // cleaned
+ // up due to performance reasons. This, however, breaks comparisons, so we
+ // manually
// fix this for tests.
private void cleanupWsuIds(Element element)
{
@@ -192,7 +179,7 @@
targets.add(target);
operations.add(new EncryptionOperation(targets, "wsse", null, null, null));
- operations.add(new SendUsernameOperation("hi", "there",false,false,false));
+ operations.add(new SendUsernameOperation("hi", "there", false, false, false, null));
return operations;
}
@@ -206,7 +193,7 @@
name = new QName("http://org.jboss.ws/2004", "someHeader");
target = new QNameTarget(name);
targets.add(target);
- //targets.add(new WsuIdTarget("timestamp"));
+ // targets.add(new WsuIdTarget("timestamp"));
LinkedList operations = new LinkedList();
operations.add(new RequireSignatureOperation(targets));
operations.add(new RequireEncryptionOperation(targets));
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java 2008-03-12 16:13:36 UTC (rev 5945)
@@ -72,7 +72,7 @@
cal.set(Calendar.MINUTE, 32);
cal.set(Calendar.SECOND, 25);
- SecurityDecoder decoder = new SecurityDecoder(new SecurityStore(), cal);
+ SecurityDecoder decoder = new SecurityDecoder(new SecurityStore(), cal, null);
decoder.decode(doc);
decoder.complete();
@@ -107,7 +107,7 @@
cal.set(Calendar.SECOND, 40);
- SecurityDecoder decoder = new SecurityDecoder(new SecurityStore(), cal);
+ SecurityDecoder decoder = new SecurityDecoder(new SecurityStore(), cal, null);
decoder.decode(doc);
decoder.complete();
Modified: stack/native/trunk/src/test/resources/jaxws/jbws1988/META-INF/jboss-service.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/jbws1988/META-INF/jboss-service.xml 2008-03-12 16:03:34 UTC (rev 5944)
+++ stack/native/trunk/src/test/resources/jaxws/jbws1988/META-INF/jboss-service.xml 2008-03-12 16:13:36 UTC (rev 5945)
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<server>
+ <!-- ==================================================================== -->
+ <!-- Dynamic login config to install the login module using digest -->
+ <!-- ==================================================================== -->
<mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
name="jboss:service=DynamicLoginConfig">
<attribute name="AuthConfig">META-INF/login-config.xml</attribute>
16 years, 7 months