[jboss-cvs] JBossAS SVN: r92677 - in branches/JBPAPP_5_0/webservices/src/etc: examples and 26 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 21 12:12:40 EDT 2009


Author: alessio.soldano at jboss.com
Date: 2009-08-21 12:12:38 -0400 (Fri, 21 Aug 2009)
New Revision: 92677

Added:
   branches/JBPAPP_5_0/webservices/src/etc/examples/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/build.xml
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/jndi.properties
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/log4j.xml
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/tst.policy
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousProxyTestCase.java
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/Endpoint.java
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/EndpointBean.java
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/web.xml
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/wsdl/
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/wsdl/TestService.wsdl
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/test-excludes-cxf.txt
   branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/test-excludes-native.txt
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/build.xml
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/jndi.properties
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/log4j.xml
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/tst.policy
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/Endpoint.java
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/META-INF/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/META-INF/jboss.xml
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/jboss-web.xml
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/web.xml
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/test-excludes-cxf.txt
   branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/test-excludes-native.txt
Log:
[JBPAPP-840] Adding some examples


Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/build.xml
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/build.xml	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/build.xml	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,321 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+To run the example, set JBOSS_HOME and run ant (with no parameters)
+-->
+
+<project default="run">
+
+   <description>JBossWS EAP samples - asynchronous</description>
+
+   <target name="prepare">
+    <property environment="ENV"/>
+    <property name="jboss.home" value="${ENV.JBOSS_HOME}" />
+    <property name="jboss.server.instance" value="default"/>
+    <property name="jboss.lib" value="${jboss.home}/lib"/>
+    <property name="jboss.client" value="${jboss.home}/client"/>
+    <property name="jboss.server" value="${jboss.home}/server/${jboss.server.instance}"/>
+    <property name="jboss.server.lib" value="${jboss.home}/common/lib"/>
+    <property name="jboss.server.deploy" value="${jboss.server}/deploy"/>
+    <property name="jboss.server.deployers" value="${jboss.server}/deployers"/>
+    <property name="endorsed.dirs" value="${jboss.home}/lib/endorsed"/>
+    <property name="tests.output.dir" value="./tests-output"/>
+    <property name="tests.dir" value="."/>
+    <property name="jboss.bind.address" value="localhost"/>
+   </target>
+   
+   <target name="init" depends="prepare">
+    <condition property="valid.jboss.home" value="true">
+      <not>
+        <contains string="${ENV.JBOSS_HOME}" substring="{ENV.JBOSS_HOME}"/>
+      </not>
+    </condition>
+    <fail message="Please make sure the JBOSS_HOME environment property is correctly set." unless="valid.jboss.home"/>
+    <!-- Check the jbossws stack installed on JBoss AS -->
+    <condition property="native-stack" value="true">
+      <available file="${jboss.client}/jbossws-native-client.jar"/>
+    </condition>
+    <condition property="cxf-stack" value="true">
+      <available file="${jboss.client}/jbossws-cxf-client.jar"/>
+    </condition>
+    <condition property="excludesfile" value="./resources/test-excludes-native.txt">
+      <isset property="native-stack"/>
+    </condition>
+    <condition property="excludesfile" value="./resources/test-excludes-cxf.txt">
+      <isset property="cxf-stack"/>
+    </condition>
+   </target>
+  
+  <target name="tests-init" depends="init,native-stack-classpath,cxf-stack-classpath,tests-classpath">
+    <property name="jbossws.test.log" value="${tests.output.dir}"/>
+  </target>
+
+  <target name="native-stack-classpath" if="native-stack">
+    <path id="ws.stack.classpath">
+      <pathelement location="${jboss.client}/jbossws-native-client.jar"/>
+    </path>
+  </target>
+
+  <target name="cxf-stack-classpath" if="cxf-stack">
+    <path id="ws.stack.classpath">
+      <pathelement location="${jboss.client}/jbossws-cxf-client.jar"/>
+    </path>
+  </target>
+
+  <target name="tests-classpath" depends="tests-classpath-jboss51">
+    <!-- Compile classpath -->
+    <path id="tests.javac.classpath">
+      <path refid="ws.stack.classpath"/>
+      <path refid="integration.target.javac.classpath"/>
+    </path>
+    <!-- Client run classpath -->
+    <path id="tests.client.classpath">
+      <path refid="ws.stack.classpath"/>
+      <path refid="integration.target.client.classpath"/>
+    </path>
+  </target>
+
+  <!-- This adds to the classpath the AS libraries that are most frequently used/required in WS apps -->
+  <target name="tests-classpath-jboss51" depends="tests-prepare">
+    <path id="integration.target.javac.classpath">
+      <pathelement location="${jboss.client}/activation.jar"/>
+      <pathelement location="${jboss.client}/jaxws-tools.jar"/>
+      <pathelement location="${jboss.client}/jboss-annotations-ejb3.jar"/>
+      <pathelement location="${jboss.client}/jboss-appclient.jar"/>
+      <pathelement location="${jboss.client}/jboss-common-core.jar"/>
+      <pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
+      <pathelement location="${jboss.client}/jboss-ejb3-ext-api.jar"/>
+      <pathelement location="${jboss.client}/jboss-logging-spi.jar"/>
+      <pathelement location="${jboss.client}/jboss-metadata.jar"/>
+      <pathelement location="${jboss.client}/jboss-remoting.jar"/>
+      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
+      <pathelement location="${jboss.client}/mail.jar"/>
+      <pathelement location="${jboss.client}/stax-api.jar"/>
+      <pathelement location="${jboss.client}/wsdl4j.jar"/>
+      <pathelement location="${jboss.server.lib}/jboss-javaee.jar"/>
+      <pathelement location="${jboss.server.lib}/jbosssx.jar"/>
+      <pathelement location="${jboss.server.lib}/servlet-api.jar"/>
+    </path>
+    <path id="integration.target.client.classpath">
+      <pathelement location="${jboss.client}/activation.jar"/>
+      <pathelement location="${jboss.client}/javassist.jar"/>
+      <pathelement location="${jboss.client}/jaxb-api.jar"/>
+      <pathelement location="${jboss.client}/jaxb-impl.jar"/>
+      <pathelement location="${jboss.client}/jaxb-xjc.jar"/>
+      <pathelement location="${jboss.client}/jboss-appclient.jar"/>
+      <pathelement location="${jboss.client}/jboss-ejb3-ext-api.jar"/>
+      <pathelement location="${jboss.client}/jbossws-jboss50.jar"/>
+      <pathelement location="${jboss.client}/jboss-metadata.jar"/>
+      <pathelement location="${jboss.client}/jboss-remoting.jar"/>
+      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
+      <pathelement location="${jboss.client}/jbossall-client.jar"/>
+      <pathelement location="${jboss.client}/jaxws-tools.jar"/>
+      <pathelement location="${jboss.client}/log4j.jar"/>
+      <pathelement location="${jboss.client}/mail.jar"/>
+      <pathelement location="${jboss.client}/stax-api.jar"/>
+      <pathelement location="${jboss.client}/trove.jar"/>
+      <pathelement location="${jboss.client}/jboss-javaee.jar"/>
+      <pathelement location="${jboss.lib}/jboss-classloader.jar"/>
+      <pathelement location="${jboss.lib}/jboss-classloading.jar"/>
+      <pathelement location="${jboss.lib}/jboss-classloading-vfs.jar"/>
+      <pathelement location="${jboss.lib}/jboss-dependency.jar"/>
+      <pathelement location="${jboss.lib}/jboss-vfs.jar"/>
+      <pathelement location="${jboss.lib}/jboss-kernel.jar"/>
+      <pathelement location="${jboss.lib}/jboss-reflect.jar"/>
+      <pathelement location="${jboss.server.lib}/jboss.jar"/>
+      <pathelement location="${jboss.server.lib}/jbosssx.jar"/>
+      <pathelement location="${jboss.server.lib}/jnpserver.jar"/>
+      <pathelement location="${jboss.server.lib}/jboss-ejb3-core.jar"/>
+      <pathelement location="${tools.jar}"/>
+      <pathelement location="${jboss.server.deploy}/jbossweb.sar/jbossweb.jar"/>
+    </path>
+  </target>
+
+  <target name="tests-prepare" depends="prepare">
+    <!-- Verify availabililty of tools.jar -->
+    <condition property="tools.jar" value="${java.home}/lib/tools.jar">
+      <available file="${java.home}/lib/tools.jar"/>
+    </condition>
+    <condition property="tools.jar" value="${java.home}/../lib/tools.jar">
+      <available file="${java.home}/../lib/tools.jar"/>
+    </condition>
+    <!-- [JBWS-2113] tools.jar not available on Mac OS X -->
+    <condition property="tools.jar" value="${java.home}/../Classes/classes.jar">
+      <available file="${java.home}/../Classes/classes.jar"/>
+    </condition>
+    <fail message="Not available: ${java.home}/lib/tools.jar, ${java.home}/../lib/tools.jar" unless="tools.jar"/>
+    <mkdir dir="${tests.output.dir}"/>
+    <delete file="${tests.output.dir}/test.log" failonerror="false"/>
+    <echo/>
+    <echo message="-----------------------------------------------"/>
+    <echo message="jboss.home   = ${jboss.home}"/>
+    <echo message="excludesfile = ${excludesfile}"/>
+    <echo message="java.home    = ${java.home}"/>
+    <echo message="jboss.bind   = ${jboss.bind.address}"/>
+    <echo message="-----------------------------------------------"/>
+    <tstamp>
+      <format property="build.id" pattern="yyyyMMddHHmm"/>
+    </tstamp>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Compile                                                            -->
+  <!-- ================================================================== -->
+  
+  <target name="compile" depends="tests-init" description="Compile sources">
+    <macro-compile-classes srcdir="${tests.dir}/java" excludesfile="${excludesfile}"/>
+  </target>
+
+  
+  
+  <!-- ================================================================== -->
+  <!-- Building                                                           -->
+  <!-- ================================================================== -->
+  
+  <!-- Copy resources -->
+  <target name="copy-resources" depends="tests-init">
+    <macro-copy-resources srcdir="${tests.dir}"/>
+  </target>
+  
+  <target name="jars" depends="compile,copy-resources" description="Generates the deployment packages for this example">
+    <mkdir dir="${tests.output.dir}/test-libs"/>
+     <!-- This actually builds the jaxws-samples-asynchronous deployment package -->
+     <war warfile="${tests.output.dir}/test-libs/jaxws-samples-asynchronous.war" webxml="${tests.output.dir}/test-resources/WEB-INF/web.xml">
+       <classes dir="${tests.output.dir}/test-classes">
+         <include name="org/jboss/test/ws/jaxws/samples/asynchronous/Endpoint.class"/>
+         <include name="org/jboss/test/ws/jaxws/samples/asynchronous/EndpointBean.class"/>
+       </classes>
+     </war>
+  </target>
+    
+  <!-- ================================================================== -->
+  <!-- Testing                                                            -->
+  <!-- ================================================================== -->
+  
+  <!-- Run all unit tests and generate a report -->
+  <target name="run" depends="jars" description="Run all tests included in the example">
+    <antcall target="run-internal">
+      <param name="include.wildcard" value="org/jboss/test/ws/**/*TestCase.class"/>
+      <param name="exclude.wildcard" value="no-wildcard-exclude-see-excludesfile"/>
+      <param name="haltonfailure" value="false"/>
+    </antcall>
+  </target>
+  
+  <target name="run-internal" depends="tests-init">
+    <mkdir dir="${tests.output.dir}/test-reports"/>
+    <echo/>
+    <echo message="-----------------------------------------------"/>
+    <echo message="One or more JUnit tests will now be performed; "/>
+    <echo message="each test does the following: "/>
+    <echo message="- deploys a sample server application "/>
+    <echo message="  (containing one or more webservice endpoints)"/>
+    <echo message="  to the running JBoss instance"/>
+    <echo message="- invokes the webservice endpoint(s) acting as "/>
+    <echo message="  a client for that application"/>
+    <echo message="- undeploys the sample server application "/>
+    <echo/>
+    <echo message="Deployed archives dir: ${tests.output.dir}/test-libs"/>
+    <echo message="-----------------------------------------------"/>
+    <echo/>
+    <junit printsummary="yes" showoutput="yes" haltonfailure="${haltonfailure}">
+      <jvmarg value="-Djava.security.manager"/>
+      <jvmarg value="-ea"/>
+      <sysproperty key="jdk.home" value="${env.JAVA_HOME}"/>
+      <sysproperty key="log4j.output.dir" value="${tests.output.dir}"/>
+      <sysproperty key="java.endorsed.dirs" value="${endorsed.dirs}"/>
+      <sysproperty key="java.naming.provider.url" value="jnp://${jboss.bind.address}:1099"/>
+      <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.virtual.protocol"/>
+      <sysproperty key="java.security.policy" value="${tests.output.dir}/test-classes/tst.policy"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.wsf.common.logging.JDKLogManager"/>
+      <sysproperty key="jboss.home" value="${jboss.home}"/>
+      <sysproperty key="jboss.server.instance" value="${jboss.server.instance}"/>
+      <sysproperty key="jboss.bind.address" value="${jboss.bind.address}"/>
+      <sysproperty key="jbossws.integration.target" value="jboss510"/>
+      <sysproperty key="jmx.authentication.username" value="${jmx.authentication.username}"/>
+      <sysproperty key="jmx.authentication.password" value="${jmx.authentication.password}"/>
+      <sysproperty key="test.archive.directory" value="${tests.output.dir}/test-libs"/>
+      <sysproperty key="test.classes.directory" value="${tests.output.dir}/test-classes"/>
+      <sysproperty key="test.resources.directory" value="${tests.output.dir}/test-resources"/>
+      <classpath>
+        <path refid="tests.client.classpath"/>
+        <pathelement location="${tests.output.dir}/test-classes"/>
+      </classpath>
+      <formatter type="plain" usefile="true"/>
+      <formatter type="xml" usefile="true"/>
+      <batchtest todir="${tests.output.dir}/test-reports" fork="true">
+        <fileset dir="${tests.output.dir}/test-classes" includes="${include.wildcard}" excludes="${exclude.wildcard}"/>
+      </batchtest>
+    </junit>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Miscellaneous                                                       -->
+  <!-- ================================================================== -->
+  
+  <target name="clean" depends="prepare" description="Cleans up generated files.">
+    <delete dir="${tests.output.dir}"/>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Macro                                                              -->
+  <!-- ================================================================== -->
+
+  <macrodef name="macro-compile-classes">
+    <attribute name="excludesfile"/>
+    <attribute name="srcdir"/>
+    <sequential>
+      <mkdir dir="${tests.output.dir}/test-classes"/>
+      <javac destdir="${tests.output.dir}/test-classes" debug="${javac.debug}" encoding="utf-8" verbose="${javac.verbose}" deprecation="${javac.deprecation}"
+        failonerror="${javac.fail.onerror}" excludesfile="${excludesfile}">
+        <src path="@{srcdir}"/>
+        <classpath refid="tests.javac.classpath"/>
+      </javac>
+    </sequential>
+  </macrodef>
+
+  <macrodef name="macro-copy-resources">
+    <attribute name="srcdir"/>
+    <sequential>
+      <!-- copy etc -->
+      <copy todir="${tests.output.dir}/test-classes">
+        <fileset dir="@{srcdir}/etc">
+          <include name="jndi.properties"/>
+          <include name="tst.policy"/>
+          <include name="log4j.xml"/>
+        </fileset>
+        <filterset>
+          <filter token="jboss.bind.address" value="${jboss.bind.address}"/>
+        </filterset>
+      </copy>
+      
+      <!-- copy handler definitions -->
+      <copy todir="${tests.output.dir}/test-classes">
+        <fileset dir="@{srcdir}/java">
+          <include name="**/*.xml"/>
+        </fileset>
+      </copy>
+      
+      <!-- copy non binary files -->
+      <copy todir="${tests.output.dir}/test-resources">
+        <fileset dir="@{srcdir}/resources">
+          <include name="**/*.wsdl"/>
+          <include name="**/*.xml"/>
+        </fileset>
+        <filterset>
+          <filter token="java.home" value="${java.home}"/>
+          <filter token="tests.output.dir" value="${tests.output.dir}"/>
+          <filter token="wsdl-publish-location" value="${tests.output.dir}/wsdl-publish"/>
+        </filterset>
+      </copy>
+      
+      <!-- Copy binary files -->
+      <copy todir="${tests.output.dir}/test-resources">
+        <fileset dir="@{srcdir}/resources">
+          <exclude name="**/*.wsdl"/>
+          <exclude name="**/*.xml"/>
+        </fileset>
+      </copy>
+    </sequential>
+  </macrodef>
+
+</project>


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/build.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/jndi.properties
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/jndi.properties	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/jndi.properties	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://@jboss.bind.address@:1099
\ No newline at end of file

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/log4j.xml
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/log4j.xml	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/log4j.xml	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!--
+| For more configuration infromation and examples see the Jakarta Log4j
+| owebsite: http://jakarta.apache.org/log4j
+-->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+  <!-- ================================= -->
+  <!-- Preserve messages in a local file -->
+  <!-- ================================= -->
+
+  <!-- A time/date based rolling appender -->
+  <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
+    <param name="File" value="${log4j.output.dir}/test.log"/>
+    <param name="Append" value="true"/>
+
+    <!-- Rollover at midnight each day -->
+    <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+    <layout class="org.apache.log4j.PatternLayout">
+      <!-- The default pattern: Date Priority [Category] Message\n -->
+      <param name="ConversionPattern" value="%d %-5p [%c:%L] %m%n"/>
+    </layout>
+  </appender>
+
+  <!-- ============================== -->
+  <!-- Append messages to the console -->
+  <!-- ============================== -->
+
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Threshold" value="INFO"/>
+    <param name="Target" value="System.out"/>
+
+    <layout class="org.apache.log4j.PatternLayout">
+      <!-- The default pattern: Date Priority [Category] Message\n -->
+      <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+    </layout>
+  </appender>
+
+  <!-- ================ -->
+  <!-- Limit categories -->
+  <!-- ================ -->
+
+  <category name="org.jboss.ws">
+    <priority value="DEBUG"/>
+  </category>
+
+  <category name="org.jboss.test.ws">
+    <priority value="TRACE"/>
+  </category>
+
+  <category name="org.apache.cxf">
+    <priority value="TRACE"/>
+  </category>
+  
+  <!-- Apache security is verbose --> 
+  <category name="org.apache.xml.security">
+    <priority value="INFO"/>
+  </category>
+
+  <!-- ======================= -->
+  <!-- Setup the Root category -->
+  <!-- ======================= -->
+
+  <root>
+    <!--appender-ref ref="CONSOLE"/-->
+    <appender-ref ref="FILE"/>
+  </root>
+
+</log4j:configuration>


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/log4j.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/tst.policy
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/tst.policy	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/etc/tst.policy	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,4 @@
+grant {
+	permission java.security.AllPermission;
+};
+

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.asynchronous;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Response;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Element;
+
+/**
+ * Test JAXWS asynchrous dispatch
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 12-Aug-2006
+ */
+public class AsynchronousDispatchTestCase extends JBossWSTest
+{
+   private String targetNS = "http://org.jboss.ws/jaxws/asynchronous";
+   private String reqPayload = "<ns2:echo xmlns:ns2='" + targetNS + "'><String_1>Hello</String_1></ns2:echo>";
+   private Exception handlerException;
+   private boolean asyncHandlerCalled;
+
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(AsynchronousDispatchTestCase.class, "jaxws-samples-asynchronous.war");
+   }
+
+   public void testInvokeAsynch() throws Exception
+   {
+      Source reqObj = new StreamSource(new StringReader(reqPayload));
+      Response response = createDispatch().invokeAsync(reqObj);
+      verifyResponse((Source)response.get(3000, TimeUnit.MILLISECONDS));
+   }
+
+   public void testInvokeAsynchHandler() throws Exception
+   {
+      AsyncHandler handler = new AsyncHandler()
+      {
+         public void handleResponse(Response response)
+         {
+            try
+            {
+               verifyResponse((Source)response.get());
+               asyncHandlerCalled = true;
+            }
+            catch (Exception ex)
+            {
+               handlerException = ex;
+            }
+         }
+      };
+      StreamSource reqObj = new StreamSource(new StringReader(reqPayload));
+      Future future = createDispatch().invokeAsync(reqObj, handler);
+      future.get(1000, TimeUnit.MILLISECONDS);
+
+      if (handlerException != null)
+         throw handlerException;
+
+      assertTrue("Async handler called", asyncHandlerCalled);
+   }
+
+   private Dispatch createDispatch() throws MalformedURLException
+   {
+      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-asynchronous?wsdl");
+      QName serviceName = new QName(targetNS, "EndpointBeanService");
+      QName portName = new QName(targetNS, "EndpointPort");
+      Service service = Service.create(wsdlURL, serviceName);
+      Dispatch dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
+      return dispatch;
+   }
+
+   private void verifyResponse(Source result) throws IOException
+   {
+      Element docElement = DOMUtils.sourceToElement(result);
+      Element retElement = DOMUtils.getFirstChildElement(docElement);
+      assertEquals("result", retElement.getNodeName());
+      assertEquals("Hello", retElement.getTextContent());
+   }
+}


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousProxyTestCase.java
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousProxyTestCase.java	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousProxyTestCase.java	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.asynchronous;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test JAXWS asynchrous proxy
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 12-Aug-2006
+ */
+public class AsynchronousProxyTestCase extends JBossWSTest
+{
+   private String targetNS = "http://org.jboss.ws/jaxws/asynchronous";
+   private Exception handlerException;
+   private boolean asyncHandlerCalled;
+
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(AsynchronousProxyTestCase.class, "jaxws-samples-asynchronous.war");
+   }
+
+   public void testInvokeSync() throws Exception
+   {
+      Endpoint port = createProxy();
+      String retStr = port.echo("Hello");
+      assertEquals("Hello", retStr);
+   }
+
+   public void testInvokeAsync() throws Exception
+   {
+      Endpoint port = createProxy();
+      Response response = port.echoAsync("Async");
+
+      // access future
+      String retStr = (String) response.get();
+      assertEquals("Async", retStr);
+   }
+
+   public void testInvokeAsyncHandler() throws Exception
+   {
+      AsyncHandler<String> handler = new AsyncHandler<String>()
+      {
+         public void handleResponse(Response response)
+         {
+            try
+            {
+               System.out.println("AsyncHandler.handleResponse() method called");
+               String retStr = (String) response.get(5000, TimeUnit.MILLISECONDS);
+               assertEquals("Hello", retStr);
+               asyncHandlerCalled = true;
+            }
+            catch (Exception ex)
+            {
+               handlerException = ex;
+            }
+         }
+      };
+
+      Endpoint port = createProxy();
+      Future future = port.echoAsync("Hello", handler);
+      long start = System.currentTimeMillis();
+      future.get(5000, TimeUnit.MILLISECONDS);
+      long end = System.currentTimeMillis();
+      System.out.println("Time spent in future.get() was " + (end - start) + "milliseconds");
+
+      if (handlerException != null)
+         throw handlerException;
+
+      assertTrue("Async handler called", asyncHandlerCalled);
+   }
+
+   private Endpoint createProxy() throws MalformedURLException
+   {
+      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-asynchronous?wsdl");
+      QName serviceName = new QName(targetNS, "EndpointBeanService");
+      Service service = Service.create(wsdlURL, serviceName);
+      return (Endpoint)service.getPort(Endpoint.class);
+   }
+}


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousProxyTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/Endpoint.java
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/Endpoint.java	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/Endpoint.java	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.asynchronous;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+ at WebService(name = "Endpoint", targetNamespace = "http://org.jboss.ws/jaxws/asynchronous")
+ at SOAPBinding(style = Style.RPC)
+public interface Endpoint
+{
+   @WebMethod(operationName = "echo")
+   public Response<String> echoAsync(@WebParam(name = "String_1") String string1);
+
+   @WebMethod(operationName = "echo")
+   public Future<?> echoAsync(@WebParam(name = "String_1") String string1, @WebParam(name = "asyncHandler") AsyncHandler<String> asyncHandler);
+
+   @WebMethod
+   @WebResult(name = "result")
+   public String echo(@WebParam(name = "String_1") String string1);
+}


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/Endpoint.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/EndpointBean.java
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/EndpointBean.java	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/EndpointBean.java	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.asynchronous;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+import org.jboss.logging.Logger;
+
+ at WebService(name = "Endpoint", targetNamespace = "http://org.jboss.ws/jaxws/asynchronous")
+ at SOAPBinding(style = Style.RPC)
+public class EndpointBean
+{
+   private static Logger log = Logger.getLogger(EndpointBean.class);
+
+   @WebMethod
+   @WebResult(name = "result")
+   public String echo(@WebParam(name = "String_1") String msg)
+   {
+      log.info("echo: " + msg);
+      return msg;
+   }
+}


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/java/org/jboss/test/ws/jaxws/samples/asynchronous/EndpointBean.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/web.xml
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/web.xml	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/web.xml	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app 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"
+  version="2.4">
+
+  <servlet>
+    <servlet-name>Endpoint</servlet-name>
+    <servlet-class>org.jboss.test.ws.jaxws.samples.asynchronous.EndpointBean</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>Endpoint</servlet-name>
+    <url-pattern>/*</url-pattern>
+  </servlet-mapping>
+
+</web-app>
+


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/wsdl/TestService.wsdl	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/wsdl/TestService.wsdl	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,44 @@
+<!--
+  This wsdl is only used for client artifact generation
+  
+  wsimport -keep -verbose -d ../../../java ./WEB-INF/wsdl/TestService.wsdl
+-->
+<definitions name='EndpointService' targetNamespace='http://org.jboss.ws/jaxws/asynchronous' xmlns='http://schemas.xmlsoap.org/wsdl/'
+  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/jaxws/asynchronous' xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+  xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
+  
+  <jaxws:bindings>
+    <jaxws:package name="org.jboss.test.ws.jaxws.asynchronous"/>
+    <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
+  </jaxws:bindings>
+  
+  <message name='Endpoint_echoResponse'>
+    <part name='result' type='xsd:string'/>
+  </message>
+  <message name='Endpoint_echo'>
+    <part name='String_1' type='xsd:string'/>
+  </message>
+  <portType name='Endpoint'>
+    <operation name='echo' parameterOrder='String_1'>
+      <input message='tns:Endpoint_echo'/>
+      <output message='tns:Endpoint_echoResponse'/>
+    </operation>
+  </portType>
+  <binding name='EndpointBinding' type='tns:Endpoint'>
+    <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+    <operation name='echo'>
+      <soap:operation soapAction=''/>
+      <input>
+        <soap:body namespace='http://org.jboss.ws/jaxws/asynchronous' use='literal'/>
+      </input>
+      <output>
+        <soap:body namespace='http://org.jboss.ws/jaxws/asynchronous' use='literal'/>
+      </output>
+    </operation>
+  </binding>
+  <service name='EndpointService'>
+    <port binding='tns:EndpointBinding' name='EndpointPort'>
+      <soap:address location='http://tdvaio:8080/jaxws-samples-asynchronous/Endpoint'/>
+    </port>
+  </service>
+</definitions>
\ No newline at end of file


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/WEB-INF/wsdl/TestService.wsdl
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/test-excludes-cxf.txt
===================================================================


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/test-excludes-cxf.txt
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/test-excludes-native.txt
===================================================================


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/asynchronous/resources/test-excludes-native.txt
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/build.xml
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/build.xml	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/build.xml	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,331 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+To run the example, set JBOSS_HOME and run ant (with no parameters)
+-->
+
+<project default="run">
+
+   <description>JBossWS EAP samples - context</description>
+
+   <target name="prepare">
+    <property environment="ENV"/>
+    <property name="jboss.home" value="${ENV.JBOSS_HOME}" />
+    <property name="jboss.server.instance" value="default"/>
+    <property name="jboss.lib" value="${jboss.home}/lib"/>
+    <property name="jboss.client" value="${jboss.home}/client"/>
+    <property name="jboss.server" value="${jboss.home}/server/${jboss.server.instance}"/>
+    <property name="jboss.server.lib" value="${jboss.home}/common/lib"/>
+    <property name="jboss.server.deploy" value="${jboss.server}/deploy"/>
+    <property name="jboss.server.deployers" value="${jboss.server}/deployers"/>
+    <property name="endorsed.dirs" value="${jboss.home}/lib/endorsed"/>
+    <property name="tests.output.dir" value="./tests-output"/>
+    <property name="tests.dir" value="."/>
+    <property name="jboss.bind.address" value="localhost"/>
+   </target>
+   
+   <target name="init" depends="prepare">
+    <condition property="valid.jboss.home" value="true">
+      <not>
+        <contains string="${ENV.JBOSS_HOME}" substring="{ENV.JBOSS_HOME}"/>
+      </not>
+    </condition>
+    <fail message="Please make sure the JBOSS_HOME environment property is correctly set." unless="valid.jboss.home"/>
+    <!-- Check the jbossws stack installed on JBoss AS -->
+    <condition property="native-stack" value="true">
+      <available file="${jboss.client}/jbossws-native-client.jar"/>
+    </condition>
+    <condition property="cxf-stack" value="true">
+      <available file="${jboss.client}/jbossws-cxf-client.jar"/>
+    </condition>
+    <condition property="excludesfile" value="./resources/test-excludes-native.txt">
+      <isset property="native-stack"/>
+    </condition>
+    <condition property="excludesfile" value="./resources/test-excludes-cxf.txt">
+      <isset property="cxf-stack"/>
+    </condition>
+   </target>
+  
+  <target name="tests-init" depends="init,native-stack-classpath,cxf-stack-classpath,tests-classpath">
+    <property name="jbossws.test.log" value="${tests.output.dir}"/>
+  </target>
+
+  <target name="native-stack-classpath" if="native-stack">
+    <path id="ws.stack.classpath">
+      <pathelement location="${jboss.client}/jbossws-native-client.jar"/>
+    </path>
+  </target>
+
+  <target name="cxf-stack-classpath" if="cxf-stack">
+    <path id="ws.stack.classpath">
+      <pathelement location="${jboss.client}/jbossws-cxf-client.jar"/>
+    </path>
+  </target>
+
+  <target name="tests-classpath" depends="tests-classpath-jboss51">
+    <!-- Compile classpath -->
+    <path id="tests.javac.classpath">
+      <path refid="ws.stack.classpath"/>
+      <path refid="integration.target.javac.classpath"/>
+    </path>
+    <!-- Client run classpath -->
+    <path id="tests.client.classpath">
+      <path refid="ws.stack.classpath"/>
+      <path refid="integration.target.client.classpath"/>
+    </path>
+  </target>
+
+  <!-- This adds to the classpath the AS libraries that are most frequently used/required in WS apps -->
+  <target name="tests-classpath-jboss51" depends="tests-prepare">
+    <path id="integration.target.javac.classpath">
+      <pathelement location="${jboss.client}/activation.jar"/>
+      <pathelement location="${jboss.client}/jaxws-tools.jar"/>
+      <pathelement location="${jboss.client}/jboss-annotations-ejb3.jar"/>
+      <pathelement location="${jboss.client}/jboss-appclient.jar"/>
+      <pathelement location="${jboss.client}/jboss-common-core.jar"/>
+      <pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
+      <pathelement location="${jboss.client}/jboss-ejb3-ext-api.jar"/>
+      <pathelement location="${jboss.client}/jboss-logging-spi.jar"/>
+      <pathelement location="${jboss.client}/jboss-metadata.jar"/>
+      <pathelement location="${jboss.client}/jboss-remoting.jar"/>
+      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
+      <pathelement location="${jboss.client}/mail.jar"/>
+      <pathelement location="${jboss.client}/stax-api.jar"/>
+      <pathelement location="${jboss.client}/wsdl4j.jar"/>
+      <pathelement location="${jboss.server.lib}/jboss-javaee.jar"/>
+      <pathelement location="${jboss.server.lib}/jbosssx.jar"/>
+      <pathelement location="${jboss.server.lib}/servlet-api.jar"/>
+    </path>
+    <path id="integration.target.client.classpath">
+      <pathelement location="${jboss.client}/activation.jar"/>
+      <pathelement location="${jboss.client}/javassist.jar"/>
+      <pathelement location="${jboss.client}/jaxb-api.jar"/>
+      <pathelement location="${jboss.client}/jaxb-impl.jar"/>
+      <pathelement location="${jboss.client}/jaxb-xjc.jar"/>
+      <pathelement location="${jboss.client}/jboss-appclient.jar"/>
+      <pathelement location="${jboss.client}/jboss-ejb3-ext-api.jar"/>
+      <pathelement location="${jboss.client}/jbossws-jboss50.jar"/>
+      <pathelement location="${jboss.client}/jboss-metadata.jar"/>
+      <pathelement location="${jboss.client}/jboss-remoting.jar"/>
+      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
+      <pathelement location="${jboss.client}/jbossall-client.jar"/>
+      <pathelement location="${jboss.client}/jaxws-tools.jar"/>
+      <pathelement location="${jboss.client}/log4j.jar"/>
+      <pathelement location="${jboss.client}/mail.jar"/>
+      <pathelement location="${jboss.client}/stax-api.jar"/>
+      <pathelement location="${jboss.client}/trove.jar"/>
+      <pathelement location="${jboss.client}/jboss-javaee.jar"/>
+      <pathelement location="${jboss.lib}/jboss-classloader.jar"/>
+      <pathelement location="${jboss.lib}/jboss-classloading.jar"/>
+      <pathelement location="${jboss.lib}/jboss-classloading-vfs.jar"/>
+      <pathelement location="${jboss.lib}/jboss-dependency.jar"/>
+      <pathelement location="${jboss.lib}/jboss-vfs.jar"/>
+      <pathelement location="${jboss.lib}/jboss-kernel.jar"/>
+      <pathelement location="${jboss.lib}/jboss-reflect.jar"/>
+      <pathelement location="${jboss.server.lib}/jboss.jar"/>
+      <pathelement location="${jboss.server.lib}/jbosssx.jar"/>
+      <pathelement location="${jboss.server.lib}/jnpserver.jar"/>
+      <pathelement location="${jboss.server.lib}/jboss-ejb3-core.jar"/>
+      <pathelement location="${tools.jar}"/>
+      <pathelement location="${jboss.server.deploy}/jbossweb.sar/jbossweb.jar"/>
+    </path>
+  </target>
+
+  <target name="tests-prepare" depends="prepare">
+    <!-- Verify availabililty of tools.jar -->
+    <condition property="tools.jar" value="${java.home}/lib/tools.jar">
+      <available file="${java.home}/lib/tools.jar"/>
+    </condition>
+    <condition property="tools.jar" value="${java.home}/../lib/tools.jar">
+      <available file="${java.home}/../lib/tools.jar"/>
+    </condition>
+    <!-- [JBWS-2113] tools.jar not available on Mac OS X -->
+    <condition property="tools.jar" value="${java.home}/../Classes/classes.jar">
+      <available file="${java.home}/../Classes/classes.jar"/>
+    </condition>
+    <fail message="Not available: ${java.home}/lib/tools.jar, ${java.home}/../lib/tools.jar" unless="tools.jar"/>
+    <mkdir dir="${tests.output.dir}"/>
+    <delete file="${tests.output.dir}/test.log" failonerror="false"/>
+    <echo/>
+    <echo message="-----------------------------------------------"/>
+    <echo message="jboss.home   = ${jboss.home}"/>
+    <echo message="excludesfile = ${excludesfile}"/>
+    <echo message="java.home    = ${java.home}"/>
+    <echo message="jboss.bind   = ${jboss.bind.address}"/>
+    <echo message="-----------------------------------------------"/>
+    <tstamp>
+      <format property="build.id" pattern="yyyyMMddHHmm"/>
+    </tstamp>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Compile                                                            -->
+  <!-- ================================================================== -->
+  
+  <target name="compile" depends="tests-init" description="Compile sources">
+    <macro-compile-classes srcdir="${tests.dir}/java" excludesfile="${excludesfile}"/>
+  </target>
+
+  
+  
+  <!-- ================================================================== -->
+  <!-- Building                                                           -->
+  <!-- ================================================================== -->
+  
+  <!-- Copy resources -->
+  <target name="copy-resources" depends="tests-init">
+    <macro-copy-resources srcdir="${tests.dir}"/>
+  </target>
+  
+  <target name="jars" depends="compile,copy-resources" description="Generates the deployment packages for this example">
+    <mkdir dir="${tests.output.dir}/test-libs"/>
+     <!-- This actually builds the jaxws-samples-asynchronous deployment package -->
+     <war warfile="${tests.output.dir}/test-libs/jaxws-samples-context.war" webxml="${tests.output.dir}/test-resources/WEB-INF/web.xml">
+      <classes dir="${tests.output.dir}/test-classes">
+        <include name="org/jboss/test/ws/jaxws/samples/context/EndpointJSE.class"/>
+      </classes>
+      <webinf dir="${tests.output.dir}/test-resources/WEB-INF">
+        <include name="jboss-web.xml"/>
+      </webinf>
+    </war>
+    <jar jarfile="${tests.output.dir}/test-libs/jaxws-samples-context.jar">
+      <fileset dir="${tests.output.dir}/test-classes">
+        <include name="org/jboss/test/ws/jaxws/samples/context/EndpointEJB.class"/>
+      </fileset>
+      <metainf dir="${tests.output.dir}/test-resources/META-INF">
+        <include name="jboss.xml"/>
+      </metainf>
+    </jar>
+  </target>
+    
+  <!-- ================================================================== -->
+  <!-- Testing                                                            -->
+  <!-- ================================================================== -->
+  
+  <!-- Run all unit tests and generate a report -->
+  <target name="run" depends="jars" description="Run all tests included in the example">
+    <antcall target="run-internal">
+      <param name="include.wildcard" value="org/jboss/test/ws/**/*TestCase.class"/>
+      <param name="exclude.wildcard" value="no-wildcard-exclude-see-excludesfile"/>
+      <param name="haltonfailure" value="false"/>
+    </antcall>
+  </target>
+  
+  <target name="run-internal" depends="tests-init">
+    <mkdir dir="${tests.output.dir}/test-reports"/>
+    <echo/>
+    <echo message="-----------------------------------------------"/>
+    <echo message="One or more JUnit tests will now be performed; "/>
+    <echo message="each test does the following: "/>
+    <echo message="- deploys a sample server application "/>
+    <echo message="  (containing one or more webservice endpoints)"/>
+    <echo message="  to the running JBoss instance"/>
+    <echo message="- invokes the webservice endpoint(s) acting as "/>
+    <echo message="  a client for that application"/>
+    <echo message="- undeploys the sample server application "/>
+    <echo/>
+    <echo message="Deployed archives dir: ${tests.output.dir}/test-libs"/>
+    <echo message="-----------------------------------------------"/>
+    <echo/>
+    <junit printsummary="yes" showoutput="yes" haltonfailure="${haltonfailure}">
+      <jvmarg value="-Djava.security.manager"/>
+      <jvmarg value="-ea"/>
+      <sysproperty key="jdk.home" value="${env.JAVA_HOME}"/>
+      <sysproperty key="log4j.output.dir" value="${tests.output.dir}"/>
+      <sysproperty key="java.endorsed.dirs" value="${endorsed.dirs}"/>
+      <sysproperty key="java.naming.provider.url" value="jnp://${jboss.bind.address}:1099"/>
+      <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.virtual.protocol"/>
+      <sysproperty key="java.security.policy" value="${tests.output.dir}/test-classes/tst.policy"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.wsf.common.logging.JDKLogManager"/>
+      <sysproperty key="jboss.home" value="${jboss.home}"/>
+      <sysproperty key="jboss.server.instance" value="${jboss.server.instance}"/>
+      <sysproperty key="jboss.bind.address" value="${jboss.bind.address}"/>
+      <sysproperty key="jbossws.integration.target" value="jboss510"/>
+      <sysproperty key="jmx.authentication.username" value="${jmx.authentication.username}"/>
+      <sysproperty key="jmx.authentication.password" value="${jmx.authentication.password}"/>
+      <sysproperty key="test.archive.directory" value="${tests.output.dir}/test-libs"/>
+      <sysproperty key="test.classes.directory" value="${tests.output.dir}/test-classes"/>
+      <sysproperty key="test.resources.directory" value="${tests.output.dir}/test-resources"/>
+      <classpath>
+        <path refid="tests.client.classpath"/>
+        <pathelement location="${tests.output.dir}/test-classes"/>
+      </classpath>
+      <formatter type="plain" usefile="true"/>
+      <formatter type="xml" usefile="true"/>
+      <batchtest todir="${tests.output.dir}/test-reports" fork="true">
+        <fileset dir="${tests.output.dir}/test-classes" includes="${include.wildcard}" excludes="${exclude.wildcard}"/>
+      </batchtest>
+    </junit>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Miscellaneous                                                       -->
+  <!-- ================================================================== -->
+  
+  <target name="clean" depends="prepare" description="Cleans up generated files.">
+    <delete dir="${tests.output.dir}"/>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Macro                                                              -->
+  <!-- ================================================================== -->
+
+  <macrodef name="macro-compile-classes">
+    <attribute name="excludesfile"/>
+    <attribute name="srcdir"/>
+    <sequential>
+      <mkdir dir="${tests.output.dir}/test-classes"/>
+      <javac destdir="${tests.output.dir}/test-classes" debug="${javac.debug}" encoding="utf-8" verbose="${javac.verbose}" deprecation="${javac.deprecation}"
+        failonerror="${javac.fail.onerror}" excludesfile="${excludesfile}">
+        <src path="@{srcdir}"/>
+        <classpath refid="tests.javac.classpath"/>
+      </javac>
+    </sequential>
+  </macrodef>
+
+  <macrodef name="macro-copy-resources">
+    <attribute name="srcdir"/>
+    <sequential>
+      <!-- copy etc -->
+      <copy todir="${tests.output.dir}/test-classes">
+        <fileset dir="@{srcdir}/etc">
+          <include name="jndi.properties"/>
+          <include name="tst.policy"/>
+          <include name="log4j.xml"/>
+        </fileset>
+        <filterset>
+          <filter token="jboss.bind.address" value="${jboss.bind.address}"/>
+        </filterset>
+      </copy>
+      
+      <!-- copy handler definitions -->
+      <copy todir="${tests.output.dir}/test-classes">
+        <fileset dir="@{srcdir}/java">
+          <include name="**/*.xml"/>
+        </fileset>
+      </copy>
+      
+      <!-- copy non binary files -->
+      <copy todir="${tests.output.dir}/test-resources">
+        <fileset dir="@{srcdir}/resources">
+          <include name="**/*.wsdl"/>
+          <include name="**/*.xml"/>
+        </fileset>
+        <filterset>
+          <filter token="java.home" value="${java.home}"/>
+          <filter token="tests.output.dir" value="${tests.output.dir}"/>
+          <filter token="wsdl-publish-location" value="${tests.output.dir}/wsdl-publish"/>
+        </filterset>
+      </copy>
+      
+      <!-- Copy binary files -->
+      <copy todir="${tests.output.dir}/test-resources">
+        <fileset dir="@{srcdir}/resources">
+          <exclude name="**/*.wsdl"/>
+          <exclude name="**/*.xml"/>
+        </fileset>
+      </copy>
+    </sequential>
+  </macrodef>
+
+</project>


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/build.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/jndi.properties
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/jndi.properties	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/jndi.properties	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://@jboss.bind.address@:1099
\ No newline at end of file

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/log4j.xml
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/log4j.xml	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/log4j.xml	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!--
+| For more configuration infromation and examples see the Jakarta Log4j
+| owebsite: http://jakarta.apache.org/log4j
+-->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+  <!-- ================================= -->
+  <!-- Preserve messages in a local file -->
+  <!-- ================================= -->
+
+  <!-- A time/date based rolling appender -->
+  <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
+    <param name="File" value="${log4j.output.dir}/test.log"/>
+    <param name="Append" value="true"/>
+
+    <!-- Rollover at midnight each day -->
+    <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+    <layout class="org.apache.log4j.PatternLayout">
+      <!-- The default pattern: Date Priority [Category] Message\n -->
+      <param name="ConversionPattern" value="%d %-5p [%c:%L] %m%n"/>
+    </layout>
+  </appender>
+
+  <!-- ============================== -->
+  <!-- Append messages to the console -->
+  <!-- ============================== -->
+
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Threshold" value="INFO"/>
+    <param name="Target" value="System.out"/>
+
+    <layout class="org.apache.log4j.PatternLayout">
+      <!-- The default pattern: Date Priority [Category] Message\n -->
+      <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+    </layout>
+  </appender>
+
+  <!-- ================ -->
+  <!-- Limit categories -->
+  <!-- ================ -->
+
+  <category name="org.jboss.ws">
+    <priority value="DEBUG"/>
+  </category>
+
+  <category name="org.jboss.test.ws">
+    <priority value="TRACE"/>
+  </category>
+
+  <category name="org.apache.cxf">
+    <priority value="TRACE"/>
+  </category>
+  
+  <!-- Apache security is verbose --> 
+  <category name="org.apache.xml.security">
+    <priority value="INFO"/>
+  </category>
+
+  <!-- ======================= -->
+  <!-- Setup the Root category -->
+  <!-- ======================= -->
+
+  <root>
+    <!--appender-ref ref="CONSOLE"/-->
+    <appender-ref ref="FILE"/>
+  </root>
+
+</log4j:configuration>


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/log4j.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/tst.policy
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/tst.policy	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/etc/tst.policy	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,4 @@
+grant {
+	permission java.security.AllPermission;
+};
+

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/Endpoint.java
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/Endpoint.java	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/Endpoint.java	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.context;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+ at WebService(name = "Endpoint", targetNamespace = "http://org.jboss.ws/jaxws/context")
+ at SOAPBinding(style = Style.RPC)
+public interface Endpoint {
+
+    @WebMethod
+    @WebResult(targetNamespace = "http://org.jboss.ws/jaxws/context", partName = "return")
+    public String testGetMessageContext();
+
+    @WebMethod
+    @WebResult(targetNamespace = "http://org.jboss.ws/jaxws/context", partName = "return")
+    public String testMessageContextProperties();
+    
+    @WebMethod
+    @WebResult(targetNamespace = "http://org.jboss.ws/jaxws/context", partName = "return")
+    public String testGetUserPrincipal();
+
+    @WebMethod
+    @WebResult(targetNamespace = "http://org.jboss.ws/jaxws/context", partName = "return")
+    public boolean testIsUserInRole(@WebParam(name = "arg0", partName = "arg0") String arg0);
+
+}


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/Endpoint.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.context;
+
+import java.io.IOException;
+import java.security.Principal;
+
+import javax.annotation.Resource;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
+import org.jboss.wsf.spi.annotation.WebContext;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+
+ at Stateless
+ at SOAPBinding(style = Style.RPC)
+ at WebService
+(
+   name = "Endpoint",
+   serviceName="EndpointService",
+   targetNamespace = "http://org.jboss.ws/jaxws/context"
+)
+ at WebContext
+(
+   contextRoot = "/jaxws-samples-context",
+   urlPattern = "/*",
+   authMethod = AuthMethod.BASIC,
+   transportGuarantee = TransportGuarantee.NONE,
+   secureWSDLAccess = false
+)
+
+// [JBWS-1339] @Security domain vs. <security-domain> 
+//@SecurityDomain("JBossWS")
+
+ at RolesAllowed("friend")
+public class EndpointEJB
+{
+   @Resource
+   WebServiceContext wsCtx;
+
+   @WebMethod
+   public String testGetMessageContext()
+   {
+      MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
+      return msgContext == null ? "fail" : "pass";
+   }
+
+   @WebMethod
+   public String testMessageContextProperties()
+   {
+      MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
+      if (msgContext == null)
+         return "fail";
+
+      // Check standard jaxws properties
+      InputSource wsdlSource = (InputSource)msgContext.get(MessageContext.WSDL_DESCRIPTION);
+      QName service = (QName)msgContext.get(MessageContext.WSDL_SERVICE);
+      QName portType = (QName)msgContext.get(MessageContext.WSDL_INTERFACE);
+      QName port = (QName)msgContext.get(MessageContext.WSDL_PORT);
+      QName operation = (QName)msgContext.get(MessageContext.WSDL_OPERATION);
+      
+      if (!service.equals(new QName("http://org.jboss.ws/jaxws/context", "EndpointService")))
+         throw new WebServiceException("Invalid qname: " + service);
+      if (!portType.equals(new QName("http://org.jboss.ws/jaxws/context", "Endpoint")))
+         throw new WebServiceException("Invalid qname: " + portType);
+      if (!port.equals(new QName("http://org.jboss.ws/jaxws/context", "EndpointPort")))
+         throw new WebServiceException("Invalid qname: " + port);
+      if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context", "testMessageContextProperties")))
+         throw new WebServiceException("Invalid qname: " + operation);
+      
+      try
+      {
+         Element root = DOMUtils.parse(wsdlSource);
+         new DOMWriter(System.out).setPrettyprint(true).print(root);
+      }
+      catch (IOException ex)
+      {
+         throw new WebServiceException("Cannot parse MessageContext.WSDL_DESCRIPTION", ex);
+      }
+      
+      return "pass";
+   }
+
+   @WebMethod
+   public String testGetUserPrincipal()
+   {
+      Principal principal = wsCtx.getUserPrincipal();
+      return principal.getName();
+   }
+
+   @WebMethod
+   public boolean testIsUserInRole(String role)
+   {
+      return wsCtx.isUserInRole(role);
+   }
+}


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.context;
+
+import java.io.IOException;
+import java.security.Principal;
+
+import javax.annotation.Resource;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+
+ at WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://org.jboss.ws/jaxws/context")
+ at SOAPBinding(style = Style.RPC)
+public class EndpointJSE
+{
+   @Resource
+   WebServiceContext wsCtx;
+
+   @WebMethod
+   public String testGetMessageContext()
+   {
+      MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
+      return msgContext == null ? "fail" : "pass";
+   }
+
+   @WebMethod
+   public String testMessageContextProperties()
+   {
+      MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
+      if (msgContext == null)
+         return "fail";
+
+      // Check standard jaxws properties
+      InputSource wsdlSource = (InputSource)msgContext.get(MessageContext.WSDL_DESCRIPTION);
+      QName service = (QName)msgContext.get(MessageContext.WSDL_SERVICE);
+      QName portType = (QName)msgContext.get(MessageContext.WSDL_INTERFACE);
+      QName port = (QName)msgContext.get(MessageContext.WSDL_PORT);
+      QName operation = (QName)msgContext.get(MessageContext.WSDL_OPERATION);
+      
+      if (!service.equals(new QName("http://org.jboss.ws/jaxws/context", "EndpointService")))
+         throw new WebServiceException("Invalid qname: " + service);
+      if (!portType.equals(new QName("http://org.jboss.ws/jaxws/context", "Endpoint")))
+         throw new WebServiceException("Invalid qname: " + portType);
+      if (!port.equals(new QName("http://org.jboss.ws/jaxws/context", "EndpointPort")))
+         throw new WebServiceException("Invalid qname: " + port);
+      if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context", "testMessageContextProperties")))
+         throw new WebServiceException("Invalid qname: " + operation);
+
+      try
+      {
+         Element root = DOMUtils.parse(wsdlSource);
+         new DOMWriter(System.out).setPrettyprint(true).print(root);
+      }
+      catch (IOException ex)
+      {
+         throw new WebServiceException("Cannot parse MessageContext.WSDL_DESCRIPTION", ex);
+      }
+
+      return "pass";
+   }
+
+   @WebMethod
+   public String testGetUserPrincipal()
+   {
+      Principal principal = wsCtx.getUserPrincipal();
+      return principal.getName();
+   }
+
+   @WebMethod
+   public boolean testIsUserInRole(String role)
+   {
+      return wsCtx.isUserInRole(role);
+   }
+}


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.context;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test JAXWS WebServiceContext
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 29-Apr-2005
+ */
+public class WebServiceContextEJBTestCase extends JBossWSTest
+{
+   private Endpoint port;
+
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(WebServiceContextEJBTestCase.class, "jaxws-samples-context.jar");
+   }
+
+   public void setUp() throws Exception
+   {
+      if (port == null)
+      {
+         URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-context?wsdl");
+         QName qname = new QName("http://org.jboss.ws/jaxws/context", "EndpointService");
+         Service service = Service.create(wsdlURL, qname);
+         port = (Endpoint)service.getPort(Endpoint.class);
+
+         BindingProvider bp = (BindingProvider)port;
+         bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
+         bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+      }
+   }
+
+   public void testGetWebContext() throws Exception
+   {
+      String retStr = port.testGetMessageContext();
+      assertEquals("pass", retStr);
+   }
+
+   public void testMessageContextProperties() throws Exception
+   {
+      if (isIntegrationMetro())
+      {
+         System.out.println("FIXME: [JBWS-2204] Implement Metro standard message context properties");
+         return;
+      }
+      
+      if (isIntegrationCXF())
+      {
+         System.out.println("FIXME: [JBWS-2203] Implement CXF standard message context properties");
+         return;
+      }
+      
+      String retStr = port.testMessageContextProperties();
+      assertEquals("pass", retStr);
+   }
+   
+   public void testGetUserPrincipal() throws Exception
+   {
+      String retStr = port.testGetUserPrincipal();
+      assertEquals("kermit", retStr);
+   }
+
+   public void testIsUserInRole() throws Exception
+   {
+      assertTrue("kermit is my friend", port.testIsUserInRole("friend"));
+   }
+}


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.context;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test JAXWS WebServiceContext
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 29-Apr-2005
+ */
+public class WebServiceContextJSETestCase extends JBossWSTest
+{
+   private Endpoint port;
+   
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(WebServiceContextJSETestCase.class, "jaxws-samples-context.war");
+   }
+
+   public void setUp() throws Exception
+   {
+      if (port == null)
+      {
+         URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-context?wsdl");
+         QName qname = new QName("http://org.jboss.ws/jaxws/context", "EndpointService");
+         Service service = Service.create(wsdlURL, qname);
+         port =  (Endpoint)service.getPort(Endpoint.class);
+         
+         BindingProvider bp = (BindingProvider)port;
+         bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
+         bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+      }   
+   }
+
+   public void testGetWebContext() throws Exception
+   {
+      String retStr = port.testGetMessageContext();
+      assertEquals("pass", retStr);
+   }
+
+   public void testMessageContextProperties() throws Exception
+   {
+      if (isIntegrationMetro())
+      {
+         System.out.println("FIXME: [JBWS-2204] Implement Metro standard message context properties");
+         return;
+      }
+      
+      if (isIntegrationCXF())
+      {
+         System.out.println("FIXME: [JBWS-2203] Implement CXF standard message context properties");
+         return;
+      }
+      
+      String retStr = port.testMessageContextProperties();
+      assertEquals("pass", retStr);
+   }
+
+   public void testGetUserPrincipal() throws Exception
+   {
+      String retStr = port.testGetUserPrincipal();
+      assertEquals("kermit", retStr);
+   }
+
+   public void testIsUserInRole() throws Exception
+   {
+      assertTrue("kermit is my friend", port.testIsUserInRole("friend"));
+   }
+}


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/META-INF/jboss.xml
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/META-INF/jboss.xml	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/META-INF/jboss.xml	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
+
+<jboss>
+  
+  <!-- [JBWS-1339] @Security domain vs. <security-domain> -->
+  <security-domain>java:/jaas/JBossWS</security-domain>
+  
+</jboss>
\ No newline at end of file


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/META-INF/jboss.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/jboss-web.xml
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/jboss-web.xml	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/jboss-web.xml	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+  <security-domain>java:/jaas/JBossWS</security-domain>
+</jboss-web>
\ No newline at end of file


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/web.xml
===================================================================
--- branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/web.xml	                        (rev 0)
+++ branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/web.xml	2009-08-21 16:12:38 UTC (rev 92677)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app 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" version="2.4">
+  
+  <servlet>
+    <servlet-name>TestService</servlet-name>
+    <servlet-class>org.jboss.test.ws.jaxws.samples.context.EndpointJSE</servlet-class>
+  </servlet>
+  
+  <servlet-mapping>
+    <servlet-name>TestService</servlet-name>
+    <url-pattern>/*</url-pattern>
+  </servlet-mapping>
+  
+  <security-constraint>
+    <web-resource-collection>
+      <web-resource-name>TestService</web-resource-name>
+      <url-pattern>/*</url-pattern>
+      <http-method>POST</http-method>
+    </web-resource-collection>
+    <auth-constraint>
+      <role-name>friend</role-name>
+    </auth-constraint>
+    <user-data-constraint>
+      <transport-guarantee>NONE</transport-guarantee>
+    </user-data-constraint>
+  </security-constraint>
+  <login-config>
+    <auth-method>BASIC</auth-method>
+    <realm-name>Security Realm</realm-name>
+  </login-config>
+  <security-role>
+    <role-name>friend</role-name>
+  </security-role>
+  
+</web-app>
+


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/test-excludes-cxf.txt
===================================================================


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/test-excludes-cxf.txt
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/test-excludes-native.txt
===================================================================


Property changes on: branches/JBPAPP_5_0/webservices/src/etc/examples/context/resources/test-excludes-native.txt
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jboss-cvs-commits mailing list