cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r793097 - in /cxf/sandbox/benson/cxf1670: ./ META-INF/ META-INF/cxf/ config/ dist/ interface/ interface/dist/ interface/src/ interface/src/com/ interface/src/com/xconnect/ interface/src/com/xconnect/cxfTest/ lib/ src/ src/com/ src/com/kayot...
Date Fri, 10 Jul 2009 20:17:30 GMT
Author: bimargulies
Date: Fri Jul 10 20:17:28 2009
New Revision: 793097

URL: http://svn.apache.org/viewvc?rev=793097&view=rev
Log:
Example to try to debug CXF-1670

Added:
    cxf/sandbox/benson/cxf1670/
    cxf/sandbox/benson/cxf1670/Instructions.txt   (with props)
    cxf/sandbox/benson/cxf1670/META-INF/
    cxf/sandbox/benson/cxf1670/META-INF/cxf/
    cxf/sandbox/benson/cxf1670/META-INF/cxf/org.apache.cxf.Logger
    cxf/sandbox/benson/cxf1670/build.xml   (with props)
    cxf/sandbox/benson/cxf1670/config/
    cxf/sandbox/benson/cxf1670/config/log4j.properties   (with props)
    cxf/sandbox/benson/cxf1670/dist/
    cxf/sandbox/benson/cxf1670/dist/peopleSvc.war   (with props)
    cxf/sandbox/benson/cxf1670/interface/
    cxf/sandbox/benson/cxf1670/interface/build.xml   (with props)
    cxf/sandbox/benson/cxf1670/interface/dist/
    cxf/sandbox/benson/cxf1670/interface/dist/PeopleSvc.jar   (with props)
    cxf/sandbox/benson/cxf1670/interface/src/
    cxf/sandbox/benson/cxf1670/interface/src/com/
    cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/
    cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/
    cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Address.java   (with props)
    cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Person.java   (with props)
    cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/PersonServices.java   (with props)
    cxf/sandbox/benson/cxf1670/lib/
    cxf/sandbox/benson/cxf1670/lib/FastInfoset-1.2.2.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/XmlSchema-1.4.3.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/commons-logging-1.1.1.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/cxf-2.1.4.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/jaxb-impl-2.1.9.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/jaxen-1.1.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/jdom-1.0.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/junit-4.5.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/log4j-1.2.15.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/neethi-2.0.4.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/serializer.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/spring-beans-2.0.8.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/spring-context-2.0.8.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/spring-core-2.0.8.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/spring-web-2.0.8.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/wsdl4j-1.6.2.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/wss4j-1.5.5.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/wstx-asl-3.2.6.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/xalan-2.7.1.jar   (with props)
    cxf/sandbox/benson/cxf1670/lib/xml-resolver-1.2.jar   (with props)
    cxf/sandbox/benson/cxf1670/src/
    cxf/sandbox/benson/cxf1670/src/com/
    cxf/sandbox/benson/cxf1670/src/com/kayote/
    cxf/sandbox/benson/cxf1670/src/com/kayote/Utils/
    cxf/sandbox/benson/cxf1670/src/com/kayote/Utils/KayoteUtil.java   (with props)
    cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/
    cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/LoggingHandler.java   (with props)
    cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/SOAPFaultOutInterceptor.java   (with props)
    cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/WsClient.java   (with props)
    cxf/sandbox/benson/cxf1670/src/com/xconnect/
    cxf/sandbox/benson/cxf1670/src/com/xconnect/cxfTest/
    cxf/sandbox/benson/cxf1670/src/com/xconnect/cxfTest/PersonServicesImpl.java   (with props)
    cxf/sandbox/benson/cxf1670/test/
    cxf/sandbox/benson/cxf1670/test/src/
    cxf/sandbox/benson/cxf1670/test/src/com/
    cxf/sandbox/benson/cxf1670/test/src/com/xconnect/
    cxf/sandbox/benson/cxf1670/test/src/com/xconnect/cxfTest/
    cxf/sandbox/benson/cxf1670/test/src/com/xconnect/cxfTest/PersonTest.java   (with props)
    cxf/sandbox/benson/cxf1670/web/
    cxf/sandbox/benson/cxf1670/web/META-INF/
    cxf/sandbox/benson/cxf1670/web/META-INF/MANIFEST.MF
    cxf/sandbox/benson/cxf1670/web/META-INF/context.xml   (with props)
    cxf/sandbox/benson/cxf1670/web/WEB-INF/
    cxf/sandbox/benson/cxf1670/web/WEB-INF/beans.xml   (with props)
    cxf/sandbox/benson/cxf1670/web/WEB-INF/lib/
    cxf/sandbox/benson/cxf1670/web/WEB-INF/web.xml   (with props)

Added: cxf/sandbox/benson/cxf1670/Instructions.txt
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/Instructions.txt?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/Instructions.txt (added)
+++ cxf/sandbox/benson/cxf1670/Instructions.txt Fri Jul 10 20:17:28 2009
@@ -0,0 +1,23 @@
+CXF Example
+
+Building the example:
+
+	Use the build.xml file in the root of the project
+
+	ant all - creates dist\peopleSvc.war
+	ant deploy - copies the war file to your Tomcat webapps folder. 
+
+Running the example:
+
+	Web Service component:
+
+		Start Tomcat
+		
+		
+	JUnit test:
+		ant test - runs the test in PersonTest test class, generating junit\TEST-com.xconnect.cxfTest.PersonTest.xml. You can see the results on the console, or generate a browsable report, described next.
+		
+View the JUnit test report:
+
+	ant test-report - generates browsable reportof the testcases results from junit\TEST-com.xconnect.cxfTest.PersonTest.xml, in the junit\index.html file.
+	
\ No newline at end of file

Propchange: cxf/sandbox/benson/cxf1670/Instructions.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/benson/cxf1670/Instructions.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cxf/sandbox/benson/cxf1670/META-INF/cxf/org.apache.cxf.Logger
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/META-INF/cxf/org.apache.cxf.Logger?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/META-INF/cxf/org.apache.cxf.Logger (added)
+++ cxf/sandbox/benson/cxf1670/META-INF/cxf/org.apache.cxf.Logger Fri Jul 10 20:17:28 2009
@@ -0,0 +1 @@
+org.apache.cxf.common.logging.Log4jLogger
\ No newline at end of file

Added: cxf/sandbox/benson/cxf1670/build.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/build.xml?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/build.xml (added)
+++ cxf/sandbox/benson/cxf1670/build.xml Fri Jul 10 20:17:28 2009
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project basedir="." default="all" name="CXF Example">
+    <property environment="env"/>
+    <property name="jdk.home"		value = "${env.JAVA_HOME}"/>
+	<property name="tomcat.home" 	value = "${env.TOMCAT_HOME}"/>
+	<property name="basename" 		value = "peopleSvc"/>
+	<property name="distribution"	value = "${basedir}/dist" />
+	<property name="war_components" value = "${basedir}/web" />
+	<property name="lib.dir" 		value = "${basedir}/lib" />
+	<property name="config.dir"		value = "${basedir}/config" />
+	<property name="war_file"	 	value = "${distribution}/${basename}.war" />
+	<property name="interface_dist"	value = "${basedir}/interface/dist"/>
+	<property name="interface_jar"	value = "${interface_dist}/${basename}.jar" />
+	<property name="build.dir" 		value = "${basedir}/build" />
+	<property name="class.dir" 		value = "${build.dir}/classes" />
+	<property name="junit.dir" 		value = "${basedir}/junit" />
+
+    <!-- Compiler options -->
+	<property name	= "target" 			value = "1.6" />
+	<property name	= "source" 			value = "1.6" />
+    <property name 	= "debuglevel" 		value = "lines,vars,source"/>
+	
+    <!-- Classpath declaration -->
+    <path id="classpath">
+        <fileset dir="${lib.dir}">
+            <include name="**/*.jar"/>
+        </fileset>
+    </path>
+	
+	<!-- ############### Targets ############### -->
+	<target 
+		name 		= "init" 
+		description = "Some initialization acts which should run at the begining"
+	>
+		<mkdir dir = "${war_components}/WEB-INF/lib" />
+		<mkdir dir = "${distribution}" />  
+		<mkdir dir = "${interface_dist}" />  
+		<mkdir dir = "${class.dir}" />
+	</target>
+
+	<target name = "clean" description = "cleanup all of the temporary files and directories">
+		<delete dir 	= "${war_components}/WEB-INF/lib" />
+		<delete dir 	= "${war_components}/WEB-INF/classes/com" />
+		<delete file 	= "${interface_jar}" />
+		<delete file 	= "${war_file}" />
+		<delete dir 	= "${build.dir}" />
+		<subant failonerror="false">
+		    <fileset dir="." includes="**/build.xml" excludes="build.xml"/>
+			<property name="lib.dir" value="${lib.dir}"/>
+			<property name="interface_dist" value="${interface_dist}"/>
+			<target name="clean"/>
+		</subant>
+	</target>
+
+	<target name="subprojects" description="compile" depends="init">
+		<subant failonerror="false">
+		    <fileset dir="." includes="interface/build.xml"/>
+			<property name="class.dir" value="${class.dir}"/>
+			<property name="lib.dir" value="${lib.dir}"/>
+			<target name="compile"/>
+		</subant>
+	</target>
+
+	<target 
+		name 		= "compile" 
+		description = "Compiles the source java files" 
+		depends 	= "init, subprojects"
+	>
+        <javac
+        		debug		= "true" 
+        	   	debuglevel	= "${debuglevel}" 
+        	   	destdir		= "${class.dir}"
+        	   	source		= "${source}" 
+        	   	target		= "${target}"
+        >
+            <src path			= "src"/>
+            <src path			= "test"/>
+            <classpath refid 	= "classpath"/>
+        </javac>
+	</target>
+
+	<target name="jars">
+		<subant failonerror="false">
+		    <fileset dir="." includes="interface/build.xml"/>
+			<property name="lib.dir" value="${lib.dir}"/>
+			<target name="jar"/>
+		</subant>
+	</target>
+	<!-- 
+	Deletes the webapp directory and copies the war to the Tomcat webapps directory
+	so that updated war will be used 
+	-->
+	<target
+		name 		= "deploy"
+		description = "Copies ${basename}.war file to the Tomcat webapps directory">
+		
+		<!-- 
+		This can only work if the environment TOMCAT_HOME is set 
+		-->
+		<fail 
+			message = "environment property TOMCAT_HOME is not set" 
+			unless		= "tomcat.home"
+		/>
+		
+    	<delete 
+    		dir					= "${tomcat.home}/webapps/${basename}" 
+    		includeemptydirs	= "true" 
+    		quiet				= "true"
+    	/>
+		<copy 
+			file 		= "${war_file}" 
+			todir 		= "${tomcat.home}/webapps"
+			failonerror = "false"
+		/>
+  	</target>
+
+	<target name="war" depends="clean, compile">
+		<delete dir="${build.dir}/lib"/>
+		<copy todir="${build.dir}/lib" flatten="true" overwrite="true" includeemptydirs="false">
+			<fileset dir="${lib.dir}" includes="**/*.jar">
+				<exclude name="**/*mysql*"/>
+				<exclude name="**/servlet-api.jar"/>
+				<exclude name="**/log4j*.jar"/>
+				<exclude name="**/javaee*.jar"/>
+				<exclude name="**/naming*.jar"/>
+				<exclude name="**/junit*.jar"/>
+			</fileset>
+		</copy>
+		<war destfile="${war_file}" webxml="${war_components}/WEB-INF/web.xml" duplicate="preserve">
+			<manifest>
+				<attribute name="Manifest-Version" value="1.0"/>
+				<attribute name="Implementation-Version" value="${release_tag}" />
+			</manifest>
+			<webinf dir="${war_components}/WEB-INF"/>
+			<metainf dir="${war_components}/META-INF"/>
+			<lib dir="${build.dir}/lib"/>
+			<classes dir="${class.dir}" excludes="**/PersonTest*"/>
+		</war>
+	</target>
+
+	<target	name="test"
+			depends="compile"
+			description="Run JUnit tests">
+		<mkdir	dir="${junit.dir}"/>
+		<junit	fork="yes"
+				includeantruntime="true"
+				printsummary="withOutAndErr"
+				dir=".">
+			<classpath>
+				<pathelement	location="${config.dir}"/>
+				<path			refid="classpath"/>
+				<pathelement	location="${class.dir}"/>
+			</classpath>
+			<formatter	type="xml"/>
+			<test		name="com.xconnect.cxfTest.PersonTest"
+						todir="${junit.dir}"
+			/>
+		</junit>
+	</target>
+
+	<target	name="test-report"
+			depends="test"
+			description="Generate JUnit tests report">
+		<junitreport	todir="${junit.dir}">
+			<fileset	dir="${junit.dir}">
+				<include	name="TEST-*.xml"/>
+			</fileset>
+			<report	format="frames"
+					todir="${junit.dir}"/>
+		</junitreport>
+	</target>
+
+  <target 
+  	name		= "all" 
+  	depends		= "war, jars" 
+  	description	= "Creates the ${basename} war and interface jar file"
+  />
+	
+    <path id="toolslib">
+	    <fileset dir="${lib.dir}" includes="**/*.jar"/>
+    </path>
+
+    <target name="schemaexport">
+        <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask">
+            <classpath refid="toolslib"/>
+        </taskdef>
+       <hibernatetool destdir="${basedir}">
+	    	<annotationconfiguration configurationfile="${config.dir}/hibernate.cfg.xml"/>
+           <classpath>
+                <path location="${class.dir}"/>
+                <path refid="toolslib"/>
+           	    <path location="${config.dir}"/>
+            </classpath>
+            <hbm2ddl export="false" drop="false" outputfilename="People.sql" format="true"/>
+        </hibernatetool>
+    </target>
+	
+</project>

Propchange: cxf/sandbox/benson/cxf1670/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/benson/cxf1670/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/benson/cxf1670/config/log4j.properties
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/config/log4j.properties?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/config/log4j.properties (added)
+++ cxf/sandbox/benson/cxf1670/config/log4j.properties Fri Jul 10 20:17:28 2009
@@ -0,0 +1,16 @@
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %t %5p %c{1}:%L - %m%n
+
+log4j.appender.File=org.apache.log4j.RollingFileAppender
+log4j.appender.File.MaxFileSize=30000KB
+log4j.appender.File.MaxBackupIndex=20
+log4j.appender.File.layout=org.apache.log4j.PatternLayout
+log4j.appender.File.File=person.log
+log4j.appender.File.layout.ConversionPattern=%d{dd-MMM-yyyy HH:mm:ss} %-5p %c{3} - %m%n
+
+log4j.rootLogger=info, stdout, File
+
+log4j.logger.com.xconnect.cxfTest=debug
\ No newline at end of file

Propchange: cxf/sandbox/benson/cxf1670/config/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/benson/cxf1670/config/log4j.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cxf/sandbox/benson/cxf1670/dist/peopleSvc.war
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/dist/peopleSvc.war?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/dist/peopleSvc.war
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/interface/build.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/interface/build.xml?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/interface/build.xml (added)
+++ cxf/sandbox/benson/cxf1670/interface/build.xml Fri Jul 10 20:17:28 2009
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project name="CXF Example Interface" default="all">
+
+	<!-- ############### Properties ############### -->
+	<!-- Any environment variable can be referenced using the "env." prefix -->
+	<property environment="env"/>
+	<property name="jdk.home"		value="${env.JAVA_HOME}"/>
+	<property name="tomcat.home"	value="${env.TOMCAT_HOME}"/>
+	<property name="distribution"	value="${basedir}/dist"/>
+	<property name="lib.dir"		value="${basedir}/../lib"/>
+	<property name="build.dir"		value="${basedir}/../build"/>
+	<property name="class.dir" 		value = "${build.dir}/classes" />
+	<property name="interface_jar"	value = "${distribution}/PeopleSvc.jar" />
+
+	<!-- Compiler options -->
+	<property name="target" value="1.6"/>
+	<property name="source" value="1.6"/>
+	<property name="debuglevel" value="lines,vars,source"/>
+
+	<!-- ############### Targets ############### -->
+	<target
+			name="init"
+			description="Some initialization acts which should run at the begining"
+			>
+		<mkdir dir="${class.dir}"/>
+	</target>
+
+	<target name="clean" description="cleanup all of the temporary files and directories">
+		<delete dir="${build.dir}"/>
+	</target>
+
+	<target
+			name="compile"
+			description="Compiles the source java files"
+			depends="init"
+			>
+		<echo message="${ant.project.name}: ${ant.file}, build.dir=${build.dir}"/>
+		<javac
+				debug="true"
+				debuglevel="${debuglevel}"
+				destdir="${class.dir}"
+				source="${source}"
+				target="${target}"
+				>
+			<src path="src"/>
+			<classpath>
+				<fileset dir="${lib.dir}" includes="**/*.jar"/>
+			</classpath>
+		</javac>
+	</target>
+
+	<target name="jar" depends="compile">
+	      <jar destfile="${interface_jar}"
+	      		basedir="${class.dir}"
+	      		excludes="**/*Test.*"/>
+	</target>
+
+	<target
+			name="all"
+			depends="clean, jar"
+			/>
+</project>

Propchange: cxf/sandbox/benson/cxf1670/interface/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/benson/cxf1670/interface/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/benson/cxf1670/interface/dist/PeopleSvc.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/interface/dist/PeopleSvc.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/interface/dist/PeopleSvc.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Address.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Address.java?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Address.java (added)
+++ cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Address.java Fri Jul 10 20:17:28 2009
@@ -0,0 +1,69 @@
+package com.xconnect.cxfTest;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class Address
+{
+	private String streetName;
+	private Set<Person> persons = new HashSet<Person> ();
+
+	public Address()
+	{
+	}
+	
+	public Address(String streetName)
+	{
+		this.streetName = streetName;
+	}
+
+  public String getStreetName()
+  {
+    return streetName;
+  }
+
+  public void setStreetName(String streetName)
+  {
+    this.streetName = streetName;
+  }
+	
+  public Set<Person> getPersons()
+  {
+      return persons;
+  }
+
+  public void setPersons(Set<Person> persons)
+  {
+      this.persons = persons;
+  }
+  
+	@Override
+	public String toString()
+	{
+		return "Address: " + streetName;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#hashCode()
+	 */
+	@Override
+	public int hashCode()
+	{
+		return (streetName != null ? streetName.hashCode() : 0);
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object obj)
+	{
+		if (this == obj)
+			return true;
+		if (!(obj instanceof Address))
+			return false;
+		Address other = (Address) obj;
+
+		return (streetName == null ? other.streetName == null : streetName.equals(other.streetName));
+	}
+}

Propchange: cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Address.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Person.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Person.java?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Person.java (added)
+++ cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Person.java Fri Jul 10 20:17:28 2009
@@ -0,0 +1,107 @@
+package com.xconnect.cxfTest;
+
+import org.apache.cxf.aegis.type.java5.IgnoreProperty;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.text.MessageFormat;
+
+public class Person
+{
+  private String name;
+  private Person parent;
+  private Set<Person> children = new HashSet<Person>();
+  private Address address;
+  
+  public Person()
+  {
+  }
+  
+  public Person(String name)
+  {
+  	this.name = name;
+  }
+  
+  public Person(String name, Person parent)
+  {
+  	this.name = name;
+  	this.parent = parent;
+  }
+
+  public String getName()
+  {
+    return name;
+  }
+
+  public void setName(String name)
+  {
+    this.name = name;
+  }
+
+  public Person getParent()
+	{
+		return parent;
+	}
+
+	public void setParent(Person parent)
+	{
+		this.parent = parent;
+	}
+
+  public Set<Person> getChildren()
+  {
+      return children;
+  }
+
+  public void setChildren(Set<Person> children)
+  {
+      this.children = children;
+  }
+
+  @IgnoreProperty
+  public boolean isParent()
+  {
+  	return (children != null && children.size() != 0);
+  }
+  
+  public Address getAddress()
+	{
+		return address;
+	}
+
+	public void setAddress(Address address)
+	{
+		this.address = address;
+	}
+
+	@Override
+	public String toString() {
+		return MessageFormat.format("Person: {0} lives at {1}, isParent={2}{3}",
+		                            name, address, isParent(),
+		                            parent == null ? "" : ", parent = " + parent.name);
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#hashCode()
+	 */
+	@Override
+	public int hashCode()
+	{
+		return (name != null ? name.hashCode() : 0);
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object obj)
+	{
+		if (this == obj)
+			return true;
+		if (!(obj instanceof Person))
+			return false;
+		Person other = (Person) obj;
+
+		return (name == null ? other.name == null : name.equals(other.name));
+	}
+}

Propchange: cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/Person.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/PersonServices.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/PersonServices.java?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/PersonServices.java (added)
+++ cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/PersonServices.java Fri Jul 10 20:17:28 2009
@@ -0,0 +1,14 @@
+package com.xconnect.cxfTest;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+public interface PersonServices
+{
+	@WebMethod
+	public List<String> findChildrenLivingAtHome(Collection<Person> people, String name);
+}

Propchange: cxf/sandbox/benson/cxf1670/interface/src/com/xconnect/cxfTest/PersonServices.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cxf/sandbox/benson/cxf1670/lib/FastInfoset-1.2.2.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/FastInfoset-1.2.2.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/FastInfoset-1.2.2.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/XmlSchema-1.4.3.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/XmlSchema-1.4.3.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/XmlSchema-1.4.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/commons-logging-1.1.1.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/commons-logging-1.1.1.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/commons-logging-1.1.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/cxf-2.1.4.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/cxf-2.1.4.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/cxf-2.1.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/jaxb-impl-2.1.9.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/jaxb-impl-2.1.9.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/jaxb-impl-2.1.9.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/jaxen-1.1.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/jaxen-1.1.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/jaxen-1.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/jdom-1.0.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/jdom-1.0.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/jdom-1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/junit-4.5.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/junit-4.5.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/junit-4.5.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/log4j-1.2.15.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/log4j-1.2.15.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/log4j-1.2.15.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/neethi-2.0.4.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/neethi-2.0.4.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/neethi-2.0.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/serializer.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/serializer.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/serializer.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/spring-beans-2.0.8.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/spring-beans-2.0.8.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/spring-beans-2.0.8.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/spring-context-2.0.8.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/spring-context-2.0.8.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/spring-context-2.0.8.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/spring-core-2.0.8.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/spring-core-2.0.8.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/spring-core-2.0.8.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/spring-web-2.0.8.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/spring-web-2.0.8.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/spring-web-2.0.8.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/wsdl4j-1.6.2.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/wsdl4j-1.6.2.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/wsdl4j-1.6.2.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/wss4j-1.5.5.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/wss4j-1.5.5.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/wss4j-1.5.5.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/wstx-asl-3.2.6.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/wstx-asl-3.2.6.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/wstx-asl-3.2.6.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/xalan-2.7.1.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/xalan-2.7.1.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/xalan-2.7.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/lib/xml-resolver-1.2.jar
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/lib/xml-resolver-1.2.jar?rev=793097&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cxf/sandbox/benson/cxf1670/lib/xml-resolver-1.2.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cxf/sandbox/benson/cxf1670/src/com/kayote/Utils/KayoteUtil.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/src/com/kayote/Utils/KayoteUtil.java?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/src/com/kayote/Utils/KayoteUtil.java (added)
+++ cxf/sandbox/benson/cxf1670/src/com/kayote/Utils/KayoteUtil.java Fri Jul 10 20:17:28 2009
@@ -0,0 +1,340 @@
+package com.kayote.Utils;
+
+import org.apache.log4j.Logger;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingEnumeration;
+
+import java.io.FileInputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.InetAddress;
+import java.util.*;
+
+/**
+ * A Bunch of Utils for the use of Kayote developers.
+ */
+public final class KayoteUtil
+{
+	private static final Set<String>			ms_setstrPkgs	=
+			Collections.synchronizedSet (new HashSet<String>());
+
+	private static final Map<String, Integer>	stacks			=
+			Collections.synchronizedSortedMap (new TreeMap<String,
+														   Integer>());
+
+    static
+    {
+        KayoteUtil.on_load (KayoteUtil.class, "$Revision: 16661 $");
+    }
+
+	/**
+	 * Logs a class name and its revision number when the class is loaded.
+	 * If the class is the first one in its package to be loaded,
+	 * then also logs the package name and its release tag.
+	 *
+	 * @param	clsxClass	the class that has been loaded
+	 * @param	strRevision	string containing the class revision keyword
+	 * 						and value
+	 * @return				true if the class revision string has a legal
+	 * 						format; otherwise false
+	 */
+	public static boolean	on_load
+	(
+		Class<?>		clsxClass,
+		String			strRevision
+	)
+	{
+		final String	c_strRevPfx		= "$" + "Revision: ";
+		final String	c_strRevSfx		= " " + "$";
+		final String	c_strRelTag		= "${release_tag}";
+		final String	c_strUnknown	= "Unknown";
+		Logger			lgrLogger		= null;
+		Package			pkgPkg			= null;
+		String			strPkg			= null;
+		String			strCls			= null;
+		String			strPkgVer		= null;
+		String			strClsVer		= null;
+		String			strMsg			= null;
+		boolean			bLoaded			= false;
+		boolean			bValid			= false;
+		int				nBegin			= 0;
+		int				nEnd			= 0;
+
+		if (clsxClass == null)
+			throw (new NullPointerException
+					("Class type is null"));
+
+		if ((strRevision == null) ||
+			 strRevision.isEmpty())
+			throw (new IllegalArgumentException
+					("Class revision string is empty"));
+
+		strCls		= clsxClass.getName();
+		lgrLogger	= Logger.getLogger (strCls);
+
+		pkgPkg		= clsxClass.getPackage();
+		strPkg		= pkgPkg.getName();
+		bLoaded		= ms_setstrPkgs.contains (strPkg);
+		if (!bLoaded)
+		{
+			ms_setstrPkgs.add (strPkg);
+			strPkgVer = pkgPkg.getImplementationVersion();
+			if ((strPkgVer == null)	 ||
+				 strPkgVer.isEmpty() ||
+				 strPkgVer.equals (c_strRelTag))
+			{
+				 strPkgVer = c_strUnknown;
+			}
+
+			strMsg	= String.format ("Loaded package %s (release %s)",
+									 strPkg, strPkgVer);
+			lgrLogger.info (strMsg);
+		}
+
+		bValid	= (strRevision.startsWith (c_strRevPfx) &&
+				   strRevision.endsWith (c_strRevSfx));
+		if (bValid)
+		{
+			nBegin		= c_strRevPfx.length();
+			nEnd		= strRevision.length() - c_strRevSfx.length();
+			strClsVer	= strRevision.substring (nBegin, nEnd);
+		}
+		else
+		{
+			strClsVer	= c_strUnknown;
+		}
+
+		strMsg	= String.format ("Loaded class %s (revision %s)",
+								 strCls, strClsVer);
+		lgrLogger.info (strMsg);
+
+		return (bValid);
+	}
+
+    /**
+     * Retrieves values from the Environment (Pre loaded XML files) <br/>
+     * These Variables reside in: <br/>
+     * %tomcat%/conf/server.xml <br/>
+     * %tomcat%/conf/catalina/(local)host/*.xml<br/><br/>
+     * If the requested environment variable doesn't exist - it returns <b>null</b>.
+     */
+    static public Object get_from_env(String param) {
+        try {
+            Context initCtx = new InitialContext();
+            Context envCtx = (Context) initCtx.lookup("java:comp/env");
+
+            return envCtx.lookup(param);
+        } catch (Exception e) {
+            log_stack_warn(Logger.getLogger(KayoteUtil.class), e);
+        }
+        return null;
+    }
+
+    /**
+     * Returns the Context's Environment variables as a Map (Eg: Tomcat's Context etc). <br/>
+     *
+     * @return context_map - A Map containing all of the Context variables.
+     */
+    static public Map<String, Object> get_env() {
+        TreeMap<String, Object> context_map = new TreeMap<String, Object>();
+        try {
+            /* The following lines get Tomcat's Context and put it into a hashtable. */
+            Context initCtx = new InitialContext();
+            Context envCtx = (Context) initCtx.lookup("java:comp/env");
+            NamingEnumeration<Binding> bindings = envCtx.listBindings("");
+            while (bindings.hasMore()) {
+                Binding binding = bindings.nextElement();
+                if (binding.getName() == null || binding.getObject() == null)
+                    continue;
+                context_map.put(binding.getName(), binding.getObject());
+            }
+        } catch (Throwable th) {
+            log_stack_error(Logger.getLogger(KayoteUtil.class), th);
+        }
+        return context_map;
+    }
+
+    /**
+     * @return String itsps_directory - taken from the environment variable "itsps_directory" or defaulted to "./" if no env variable is found.
+     */
+    static public String get_itsps_directory() {
+        String itsps_directory = (String) get_from_env("itsps_directory");
+        if (itsps_directory == null) {
+            Logger.getLogger(KayoteUtil.class).error("Couldn't get ITSPs directory connection from environment.");
+            itsps_directory = "./";
+        } else {
+            if (!itsps_directory.endsWith("/"))
+                itsps_directory += "/";
+        }
+        return itsps_directory;
+    }
+
+    /**
+     * Generates a random number between low and high (Can generate a 20 Digits number).
+     */
+    public static long randomNumber(int low, int high) {
+        high = high + 1; // So low and high will participate in results
+        int range = high - low;
+        return (long) ((Math.random() * range) + low);
+    }
+
+    public static void print(String msg, PrintWriter out) {
+        Logger logger = Logger.getRootLogger();
+        if (out != null) {
+            out.println(msg + " <br>");
+        }
+        logger.fatal(msg);
+    }
+
+    /**
+     * Receives an IP as a String and returns it as an InetAddress.
+     *
+     * @param str String IP to be converted.
+     * @return InetAddress The actual address Styled as InetAddress.
+     * @throws Exception
+     */
+    public static InetAddress string2InetAddress(String str) throws Exception {
+        String[] bytes = str.split("\\.");
+        byte[] addr_bytes = {Integer.valueOf(bytes[0]).byteValue(), Integer.valueOf(bytes[1]).byteValue(),
+                Integer.valueOf(bytes[2]).byteValue(), Integer.valueOf(bytes[3]).byteValue()};
+        return InetAddress.getByAddress(addr_bytes);
+    }
+
+    /**
+     * returns a specific property from a property file. <br/>
+     *
+     * @param propertyFileName - The property file's name from which to take the specific property.
+     * @param property         - The requested property returned as an Object.
+     * @return - The property as an Object.
+     */
+    public static Object getPropertyFromFile(String propertyFileName, String property) {
+        Logger logger = Logger.getLogger(KayoteUtil.class);
+        Properties properties = new Properties();
+        try {
+            FileInputStream in = new FileInputStream(propertyFileName);
+            properties.load(in);
+        } catch (Throwable th) {
+            logger.error("Can't load the Properties file: " + propertyFileName);
+            log_stack_error(logger, th);
+        }
+        return properties.getProperty(property);
+    }
+
+    /**
+     * Logs the current warning log request. <br/>
+     * If this warning log has already been logged, it will find it's serial logID and log only the logID, saving a lot of disk space and unneeded lines in the log file.
+     *
+     * @param logger - The current logger.
+     * @param e      - The current warning log.
+     */
+    public static void log_stack_warn(Logger logger, Throwable e) {
+        logger.warn(stack_log(e));
+    }
+
+    /**
+     * Logs the current Error log request. <br/>
+     * If this Error log has already been logged, it will find it's serial logID and log only the logID, saving a lot of disk space and unneeded lines in the log file.
+     *
+     * @param logger - The current logger.
+     * @param e      - The current error log.
+     */
+    public static void log_stack_error(Logger logger, Throwable e) {
+        logger.error(stack_log(e));
+    }
+
+    /**
+     * Logs the current Fatal log request. <br/>
+     * If this Fatal log has already been logged, it will find it's serial logID and log only the logID, saving a lot of disk space and unneeded lines in the log file.
+     *
+     * @param logger - The current logger.
+     * @param e      - The current fatal log.
+     */
+    public static void log_stack_fatal(Logger logger, Throwable e) {
+        logger.fatal(stack_log(e));
+    }
+
+    /**
+     * Returns the required log. <br/>
+     * Where 'Required Log' will be the full StackTrace in the case of a new Error. <br/>
+     * Or if the error was already logged it will return the Errors Index number and main cause.
+     */
+    private static String stack_log(Throwable t) {
+        boolean old;
+        String stackString = ThrToString(t);
+
+        Integer id = stacks.get(stackString);
+        if (id == null) {
+            id = (int) (Math.random() * 100000);
+            stacks.put(stackString, id);
+            old = false;
+        } else old = true;
+
+        StringBuffer stack = new StringBuffer();
+        if (old){
+            stackString = stackString.substring(0, stackString.indexOf('\n'));
+            stack.append(id).append(": ").append(stackString);
+        }
+        else {
+            stack.append("NEW ");   // used to find the first occurrence of a given exception
+            stack.append(id).append(": ").append(stackString);
+        }
+
+        return stack.toString();
+    }
+
+    public static int getThId(Throwable t) {
+        Integer I = stacks.get(ThrToString(t));
+        if (I == null) return -1;
+        return I;
+    }
+
+    public static String ThrToString(Throwable t){
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        pw.println(t.getMessage());
+        t.printStackTrace(pw);
+
+        return sw.toString();
+    }
+
+    /**
+     * Resets the stackTrace tracing manually without restarting the session. <br/>
+     * So now all of the errors are unknown and will be fully printed out.
+     */
+    public static void clear_error_stack() {
+        stacks.clear();
+    }
+
+    public static Set<String> getStacks(){
+        return stacks.keySet();
+    }
+
+    public static Integer getStackId(String stack){
+        Integer I = stacks.get(stack);
+        if (I == null) return -1;
+        return I;
+    }
+
+    /**
+     * @param number - The number we want to process.
+     * @return int[] number - The number as an array of int. <br/>
+     *         <b>Please Note</b> - If any non digit character exists only the first digits till the letter will be returned.
+     */
+    public static int[] getPrefixedDigits(String number) {
+        int[] lNumber = new int[number.length()];
+        int tmp;
+        for (int i = 0; i < lNumber.length; i++) {
+            tmp = Character.digit(number.charAt(i), 10);
+            if (tmp == -1) {// If a non digit exists.
+                int[] lNumber2 = new int[i];
+                System.arraycopy(lNumber, 0, lNumber2, 0, i); // Fastest array copy.
+                break;
+            }
+            lNumber[i] = tmp;
+        }
+        return lNumber;
+    }
+}

Propchange: cxf/sandbox/benson/cxf1670/src/com/kayote/Utils/KayoteUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/LoggingHandler.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/LoggingHandler.java?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/LoggingHandler.java (added)
+++ cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/LoggingHandler.java Fri Jul 10 20:17:28 2009
@@ -0,0 +1,86 @@
+package com.kayote.cxf;
+
+import com.kayote.Utils.KayoteUtil;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: michaelb
+ * Date: Mar 9, 2008
+ * Time: 10:47:51 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public class LoggingHandler implements SOAPHandler<SOAPMessageContext> {
+	private static final Logger inLogger = Logger.getLogger("com.xconnect.cxf.logging.in");
+	private static final Logger outLogger = Logger.getLogger("com.xconnect.cxf.logging.out");
+
+    public Set<QName> getHeaders() {
+        return null;
+    }
+
+    public boolean handleMessage(SOAPMessageContext smc) {
+	    Logger logger = Logger.getLogger("com.xconnect.cxf");
+        try {
+            if (isInbound(smc))
+	            logger = inLogger;
+            else
+                logger = outLogger;
+	        if (logger.getEffectiveLevel() == Level.DEBUG) logger.debug(getSOAP(smc));
+        } catch (Exception e) {
+            KayoteUtil.log_stack_warn(logger, e);
+            return false;
+        }
+        return true;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+	private String getSOAP(SOAPMessageContext smc) throws IOException, SOAPException {
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		SOAPMessage msg = smc.getMessage();
+		msg.writeTo(baos);
+		return baos.toString(getMessageEncoding(msg));
+	}
+
+    public boolean handleFault(SOAPMessageContext smc) {
+	    Logger logger = Logger.getLogger("com.xconnect.cxf");
+        try {
+            if (isInbound(smc))
+	            logger = inLogger;
+            else
+                logger = outLogger;
+	        if (logger.getEffectiveLevel() == Level.DEBUG) logger.debug("handleFault:  " + getSOAP(smc));
+        } catch (Exception e) {
+            KayoteUtil.log_stack_warn(logger, e);
+            return false;
+        }
+        return true;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void close(MessageContext messageContext) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    private boolean isInbound(SOAPMessageContext mc) {
+        return !(Boolean) mc.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY);
+    }
+
+    private String getMessageEncoding(SOAPMessage msg) throws SOAPException {
+        String encoding = "utf-8";
+        if (msg.getProperty(SOAPMessage.CHARACTER_SET_ENCODING) != null) {
+            encoding = msg.getProperty(SOAPMessage.CHARACTER_SET_ENCODING).toString();
+        }
+        return encoding;
+    }
+}

Propchange: cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/LoggingHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/SOAPFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/SOAPFaultOutInterceptor.java?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/SOAPFaultOutInterceptor.java (added)
+++ cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/SOAPFaultOutInterceptor.java Fri Jul 10 20:17:28 2009
@@ -0,0 +1,100 @@
+package com.kayote.cxf;
+
+import com.kayote.Utils.KayoteUtil;
+import static com.kayote.Utils.KayoteUtil.on_load;
+import static com.kayote.Utils.KayoteUtil.getThId;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.OperationInfo;
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Michaelb
+ * Date: Mar 2, 2009
+ * Time: 10:56:40 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public class SOAPFaultOutInterceptor extends AbstractSoapInterceptor {
+	static private final Logger logger = Logger.getLogger(SOAPFaultOutInterceptor.class);
+	static {on_load(SOAPFaultOutInterceptor.class, "$Revision: 16462 $");}
+
+	public SOAPFaultOutInterceptor() {
+		super(Phase.MARSHAL);
+	}
+
+	public void handleMessage(SoapMessage message) throws Fault {
+		Exchange exchange = message.getExchange();
+		if (exchange == null) {
+			// do nothing
+		} else {
+			Map<String, String> map = new HashMap<String, String>();
+			QName service = (QName)exchange.get(Message.WSDL_INTERFACE);
+			if (service != null) map.put("service", service.getLocalPart());
+			OperationInfo op = exchange.get(OperationInfo.class);
+			if (op != null) map.put("operation", op.getInputName());
+			String endpoint = (String) exchange.get(Message.ENDPOINT_ADDRESS);
+			if (endpoint != null) map.put("url", endpoint);
+
+			Fault fault = (Fault) message.getContent(Exception.class);
+			Throwable cause = fault.getCause();
+
+			Fault enhancedFault;
+			if (cause != null) {
+				KayoteUtil.log_stack_warn(logger, cause);
+				map.put("cause", cause.getClass().getSimpleName());
+				map.put("id", Integer.toString(getThId(cause)));
+				enhancedFault = new Fault(new RuntimeException(cause.getMessage(), cause));
+			} else {
+				enhancedFault = fault;
+				KayoteUtil.log_stack_warn(logger, fault);
+				map.put("id", Integer.toString(getThId(fault)));
+			}
+
+			Element e = enhancedFault.getOrCreateDetail();
+			StringBuffer sb = new StringBuffer();
+			for (String name: map.keySet()){
+				String value = map.get(name);
+				if (value == null) continue;
+				sb.append(name).append(":").append(value).append(";");
+			}
+			e.setTextContent(sb.toString());
+			message.setContent(Exception.class, enhancedFault);
+			if (exchange.get(Exception.class) != null) {
+				exchange.put(Exception.class, enhancedFault);
+			}
+		}
+	}
+
+	@Override
+	public void handleFault(SoapMessage message) throws Fault {
+	}
+
+	static public Map<String, String> getDetail(SOAPFaultException sfe){
+		if (sfe == null) return null;
+		SOAPFault fault = sfe.getFault();
+		if (fault == null) return null;
+		Detail detail = fault.getDetail();
+		if (detail == null) return null;
+		String ds = detail.getTextContent();
+		if (ds == null) return null;
+		Map<String, String> map = new HashMap<String, String>();
+		for (String pair: ds.split(";")){
+			String[] array = pair.split(":");
+			if (array.length > 1 && array[1] != null) map.put(array[0], array[1]);
+		}
+		return map;
+	}
+}

Propchange: cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/SOAPFaultOutInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/WsClient.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/WsClient.java?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/WsClient.java (added)
+++ cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/WsClient.java Fri Jul 10 20:17:28 2009
@@ -0,0 +1,116 @@
+package com.kayote.cxf;
+
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.apache.log4j.Logger;
+
+import javax.xml.ws.BindingProvider;
+
+/***
+ * This is a convenience class for CXF clients.  Typically, a client of a web service with an interface named
+ * WSI need only write
+ * <div font style="courier"><pre>
+ *      WSI wsi = (WSI) new WsClient("endpoint-address-of-WS").connect(WSI.class);
+ * </pre></div>
+ * to start calling web-service methods.
+ */
+public class WsClient {
+    /***
+     * normally you wouldn't touch this, but if you're going to be creating client-after-client and you want
+     * to change the default value (30)...
+     */
+    static public final int connectionTimeoutInSeconds = 30;
+    /***
+     * normally you wouldn't touch this, but if you're going to be creating client-after-client and you want
+     * to change the default value (300)...
+     */
+    static public final int receiveTimeoutInSeconds = 300;
+    static {
+        Logger.getLogger(WsClient.class).info("Loaded WsClient $Revision: 16462 $");
+    }
+    private final JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
+    private final HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
+    private Object client;
+
+    /***
+     *
+     * @param endpoint the URL of the web service WITHOUT the ?wsdl at the end
+     */
+    public WsClient(String endpoint){
+	    this(endpoint, receiveTimeoutInSeconds);
+    }
+
+	public WsClient(String endpoint, int recieveTimeout){
+		this(endpoint, recieveTimeout, false, false);
+	}
+
+	public WsClient(String endpoint, int recieveTimeout, boolean logSOAPIn, boolean logSOAPOut){
+		factory.setAddress(endpoint);
+		factory.getServiceFactory().setDataBinding(new AegisDatabinding());
+		httpClientPolicy.setConnectionTimeout(connectionTimeoutInSeconds * 1000);
+		httpClientPolicy.setAllowChunking(false);
+		httpClientPolicy.setReceiveTimeout(recieveTimeout * 1000);
+		if (logSOAPIn) factory.getInInterceptors().add(new LoggingInInterceptor());
+		if (logSOAPOut) factory.getOutInterceptors().add(new LoggingOutInterceptor());
+	}
+
+	public void setIncomingLogging(){
+		factory.getInInterceptors().add(new LoggingInInterceptor());
+	}
+
+	public void setOutgoingLogging(){
+		factory.getOutInterceptors().add(new LoggingOutInterceptor());
+	}
+
+    /***
+     * Connect to the web service endpoint
+     * @param _class the class of the interface that the web service implements
+     * @return an object that, when cast to the interface type, can be used to invoke it's methods remotely
+     * via the web service
+     */
+    public Object connect(Class _class){
+        init(_class);
+        return client;
+    }
+
+    /***
+     * Same as connect(), except this adds a header that tells the web-service container to maintain
+     * a session.
+     * @param _class
+     * @return
+     */
+    public Object connectWithSession(Class _class){
+        init(_class);
+        ((BindingProvider) client).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
+        return client;
+    }
+
+    /***
+     * The name pretty-much says it, but be sure to run this before calling connect().
+     * @param seconds
+     */
+    public void setReceiveTimeout(int seconds){
+        httpClientPolicy.setReceiveTimeout(seconds * 1000);
+    }
+
+    /***
+     * There are settings for the HTTPConduit other than the timeouts that you might want to fiddle with, so
+     * here you can get the conduit for that purpose.  Make any changes before calling connect().
+     * @return
+     */
+    public HTTPConduit getHTTPConduit(){
+        return (HTTPConduit) factory.getClientFactoryBean().getClient().getConduit();
+    }
+
+    private void init(Class _class){
+        factory.setServiceClass(_class);
+        client = factory.create();
+
+        HTTPConduit http = (HTTPConduit) factory.getClientFactoryBean().getClient().getConduit();
+        http.setClient(httpClientPolicy);
+    }
+}

Propchange: cxf/sandbox/benson/cxf1670/src/com/kayote/cxf/WsClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cxf/sandbox/benson/cxf1670/src/com/xconnect/cxfTest/PersonServicesImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/src/com/xconnect/cxfTest/PersonServicesImpl.java?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/src/com/xconnect/cxfTest/PersonServicesImpl.java (added)
+++ cxf/sandbox/benson/cxf1670/src/com/xconnect/cxfTest/PersonServicesImpl.java Fri Jul 10 20:17:28 2009
@@ -0,0 +1,30 @@
+package com.xconnect.cxfTest;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService(endpointInterface = "com.xconnect.cxfTest.PersonServices")
+public class PersonServicesImpl implements PersonServices
+{
+	@WebMethod
+	public List<String> findChildrenLivingAtHome(Collection<Person> people, String name)
+	{
+		List<String> childrenNames = new ArrayList<String> ();
+		
+		for (Person parent : people)
+		{
+			if (parent.getName().equalsIgnoreCase(name))
+			{
+				// Found the parent. Make a list of its children.
+				for (Person child : parent.getChildren())
+					childrenNames.add(child.getName());
+			}
+		}
+		
+		return childrenNames;
+	}
+}

Propchange: cxf/sandbox/benson/cxf1670/src/com/xconnect/cxfTest/PersonServicesImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cxf/sandbox/benson/cxf1670/test/src/com/xconnect/cxfTest/PersonTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/test/src/com/xconnect/cxfTest/PersonTest.java?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/test/src/com/xconnect/cxfTest/PersonTest.java (added)
+++ cxf/sandbox/benson/cxf1670/test/src/com/xconnect/cxfTest/PersonTest.java Fri Jul 10 20:17:28 2009
@@ -0,0 +1,57 @@
+package com.xconnect.cxfTest;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.TimeZone;
+
+import javax.xml.ws.BindingProvider;
+
+import org.apache.log4j.Logger;
+import org.junit.Test;
+
+import com.kayote.cxf.WsClient;
+import com.xconnect.cxfTest.Person;
+
+public class PersonTest
+{
+	private static final Logger logger = Logger.getLogger(PersonTest.class);
+	private static PersonServices ps;
+
+	static {
+		TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+		String servlet = "http://localhost:8080/peopleSvc";
+		WsClient client = new WsClient(servlet + "/People");
+		// Enable SOAP logging by uncommenting this line:
+		client.setIncomingLogging();
+		ps = (PersonServices) client.connectWithSession(PersonServices.class);
+		((BindingProvider) ps).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
+	}
+	
+	@Test
+	public void testRecursion()
+	{
+		// Create the home address.
+		Address home = new Address("home");
+		
+		// Create a father.
+		Person parent = new Person("Dad");
+		parent.setAddress(home);
+		
+		// Create a son, living at same address as the parent.
+		Person child = new Person("Son1", parent);
+		child.setAddress(home);
+		logger.info("Created " + child);
+
+		Set<Person> children = new HashSet<Person>();
+		children.add(child);
+		parent.setChildren(children);
+
+		Set<Person> people = new HashSet<Person>();
+		people.add(parent);
+		people.add(child);
+		home.setPersons(people);
+		
+		logger.info("Created " + parent);
+		
+		ps.findChildrenLivingAtHome(people, "Dad");
+	}
+}

Propchange: cxf/sandbox/benson/cxf1670/test/src/com/xconnect/cxfTest/PersonTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cxf/sandbox/benson/cxf1670/web/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/web/META-INF/MANIFEST.MF?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/web/META-INF/MANIFEST.MF (added)
+++ cxf/sandbox/benson/cxf1670/web/META-INF/MANIFEST.MF Fri Jul 10 20:17:28 2009
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Ant-Version: Apache Ant 1.7.0
+Created-By: 10.0-b23 (Sun Microsystems Inc.)
+

Added: cxf/sandbox/benson/cxf1670/web/META-INF/context.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/web/META-INF/context.xml?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/web/META-INF/context.xml (added)
+++ cxf/sandbox/benson/cxf1670/web/META-INF/context.xml Fri Jul 10 20:17:28 2009
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context path="/">
+	<WatchedResource>WEB-INF/web.xml</WatchedResource>
+</Context>

Propchange: cxf/sandbox/benson/cxf1670/web/META-INF/context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/benson/cxf1670/web/META-INF/context.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/benson/cxf1670/web/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/web/WEB-INF/beans.xml?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/web/WEB-INF/beans.xml (added)
+++ cxf/sandbox/benson/cxf1670/web/WEB-INF/beans.xml Fri Jul 10 20:17:28 2009
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- START SNIPPET: beans -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:jaxws="http://cxf.apache.org/jaxws"
+       xsi:schemaLocation="
+	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+	http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+
+    <import resource="classpath:META-INF/cxf/cxf.xml"/>
+    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
+    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
+
+    <bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding" scope="prototype"/>
+
+    <bean id="jaxws-and-aegis-service-factory"
+          class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
+          scope="prototype">
+        <property name="dataBinding" ref="aegisBean"/>
+    </bean>
+
+    <jaxws:endpoint id="PersonServices" implementor="com.xconnect.cxfTest.PersonServicesImpl"
+                    address="/People">
+        <jaxws:serviceFactory>
+            <ref bean='jaxws-and-aegis-service-factory'/>
+        </jaxws:serviceFactory>
+        <jaxws:outFaultInterceptors>
+            <bean class="com.kayote.cxf.SOAPFaultOutInterceptor"/>
+        </jaxws:outFaultInterceptors>
+    </jaxws:endpoint>
+
+</beans>
+        <!-- END SNIPPET: beans -->

Propchange: cxf/sandbox/benson/cxf1670/web/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/benson/cxf1670/web/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/benson/cxf1670/web/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/cxf1670/web/WEB-INF/web.xml?rev=793097&view=auto
==============================================================================
--- cxf/sandbox/benson/cxf1670/web/WEB-INF/web.xml (added)
+++ cxf/sandbox/benson/cxf1670/web/WEB-INF/web.xml Fri Jul 10 20:17:28 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app
+		PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+		"http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<!-- START SNIPPET: webxml -->
+<web-app>
+	<display-name>CXF recursion exception example</display-name>
+	<context-param>
+		<param-name>contextConfigLocation</param-name>
+		<param-value>WEB-INF/beans.xml</param-value>
+	</context-param>
+
+	<listener>
+		<listener-class>
+			org.springframework.web.context.ContextLoaderListener
+		</listener-class>
+	</listener>
+
+	<servlet>
+		<servlet-name>CXFServlet</servlet-name>
+		<display-name>CXF Servlet</display-name>
+		<servlet-class>
+			org.apache.cxf.transport.servlet.CXFServlet
+		</servlet-class>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>CXFServlet</servlet-name>
+		<url-pattern>/*</url-pattern>
+	</servlet-mapping>
+
+	<session-config>
+		<session-timeout>60</session-timeout>
+	</session-config>
+	
+	<env-entry>
+		<env-entry-name>handlerResource</env-entry-name>
+		<env-entry-value>injectedValue</env-entry-value>
+		<env-entry-type>java.lang.String</env-entry-type>
+	</env-entry>
+</web-app>
+		<!-- END SNIPPET: webxml -->
\ No newline at end of file

Propchange: cxf/sandbox/benson/cxf1670/web/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/benson/cxf1670/web/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message