You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ru...@apache.org on 2006/10/24 07:58:14 UTC
svn commit: r467253 [1/2] - in
/webservices/axis2/branches/java/1_1/modules/samples/security: ./ basic/
basic/keys/ basic/sample01/ basic/sample01/src/ basic/sample01/src/org/
basic/sample01/src/org/apache/ basic/sample01/src/org/apache/rampart/
basic/...
Author: ruchithf
Date: Mon Oct 23 22:58:10 2006
New Revision: 467253
URL: http://svn.apache.org/viewvc?view=rev&rev=467253
Log:
adding a set of samples to show the rampart configurations with parameters
Added:
webservices/axis2/branches/java/1_1/modules/samples/security/README.txt
webservices/axis2/branches/java/1_1/modules/samples/security/basic/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/build.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/client.jks (with props)
webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/client.properties
webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/service.jks (with props)
webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/service.properties
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/samples/sample05/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/samples/sample05/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/samples/sample05/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/samples/sample05/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/src/org/apache/rampart/samples/sample06/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/src/org/apache/rampart/samples/sample06/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/src/org/apache/rampart/samples/sample06/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample06/src/org/apache/rampart/samples/sample06/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/src/org/apache/rampart/samples/sample07/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/src/org/apache/rampart/samples/sample07/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/src/org/apache/rampart/samples/sample07/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample07/src/org/apache/rampart/samples/sample07/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/src/org/apache/rampart/samples/sample08/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/src/org/apache/rampart/samples/sample08/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/src/org/apache/rampart/samples/sample08/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample08/src/org/apache/rampart/samples/sample08/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/src/org/apache/rampart/samples/sample09/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/src/org/apache/rampart/samples/sample09/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/src/org/apache/rampart/samples/sample09/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample09/src/org/apache/rampart/samples/sample09/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/src/org/apache/rampart/samples/sample10/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/src/org/apache/rampart/samples/sample10/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/src/org/apache/rampart/samples/sample10/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample10/src/org/apache/rampart/samples/sample10/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/client.axis2.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/services.xml
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/src/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/src/org/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/src/org/apache/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/src/org/apache/rampart/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/src/org/apache/rampart/samples/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/src/org/apache/rampart/samples/sample11/
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/src/org/apache/rampart/samples/sample11/Client.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/src/org/apache/rampart/samples/sample11/PWCBHandler.java
webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample11/src/org/apache/rampart/samples/sample11/SimpleService.java
webservices/axis2/branches/java/1_1/modules/samples/security/policy/
webservices/axis2/branches/java/1_1/modules/samples/security/rahas/
Added: webservices/axis2/branches/java/1_1/modules/samples/security/README.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/README.txt?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/README.txt (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/README.txt Mon Oct 23 22:58:10 2006
@@ -0,0 +1,7 @@
+Rampart Samples
+
+This directory contains three sub directories:
+basic - A set of samples that uses basic rampart configuration using parameters
+policy - A set of samples that uses rampart with WS-SecurityPolicy
+rahas - A set of samples demonstrating WS-Trust features provided by Rahas
+
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/build.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/build.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/build.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,234 @@
+<project basedir="." default="clean">
+
+ <property name="service.repos.dir" value="build/service_repositories"/>
+ <property name="client.repos.dir" value="build/client_repositories"/>
+ <property name="temp.dir" value="build/temp"/>
+ <property name="temp.client.dir" value="build/temp_client"/>
+
+ <property name="modules.dir" value="modules"/>
+ <property name="lib.dir" value="lib"/>
+
+ <property name="addressing.mar" value="addressing-SNAPSHOT.mar"/>
+ <property name="rampart.mar" value="rampart-SNAPSHOT.mar"/>
+
+ <property name="client.port" value="9080"/>
+ <property name="server.port" value="8080"/>
+
+ <property name="sample.services.url" value="http://localhost:${client.port}/axis2/services"/>
+
+ <target name="check.dependency" unless="env.AXIS2_HOME">
+ <echo message="AXIS2_HOME must be set"/>
+ </target>
+
+ <!-- Sample Service 01 -->
+ <target name="service.01">
+ <create.service.repo sample.number="01"/>
+ </target>
+
+ <!-- Sample Client 01 -->
+ <target name="client.01">
+ <create.and.run.client sample.number="01"/>
+ </target>
+
+ <!-- Sample Service 02 -->
+ <target name="service.02">
+ <create.service.repo sample.number="02"/>
+ </target>
+
+ <!-- Sample Client 01 -->
+ <target name="client.02">
+ <create.and.run.client sample.number="02"/>
+ </target>
+
+ <!-- Sample Service 03 -->
+ <target name="service.03">
+ <create.service.repo sample.number="03"/>
+ </target>
+
+ <!-- Sample Client 01 -->
+ <target name="client.03">
+ <create.and.run.client sample.number="03"/>
+ </target>
+
+ <!-- Sample Service 04 -->
+ <target name="service.04">
+ <create.service.repo sample.number="04"/>
+ </target>
+
+ <!-- Sample Client 04 -->
+ <target name="client.04">
+ <create.and.run.client sample.number="04"/>
+ </target>
+
+ <!-- Sample Service 05 -->
+ <target name="service.05">
+ <create.service.repo sample.number="05"/>
+ </target>
+
+ <!-- Sample Client 05 -->
+ <target name="client.05">
+ <create.and.run.client sample.number="05"/>
+ </target>
+
+ <!-- Sample Service 06 -->
+ <target name="service.06">
+ <create.service.repo sample.number="06"/>
+ </target>
+
+ <!-- Sample Client 06 -->
+ <target name="client.06">
+ <create.and.run.client sample.number="06"/>
+ </target>
+
+ <!-- Sample Service 07 -->
+ <target name="service.07">
+ <create.service.repo sample.number="07"/>
+ </target>
+
+ <!-- Sample Client 07 -->
+ <target name="client.07">
+ <create.and.run.client sample.number="07"/>
+ </target>
+
+ <!-- Sample Service 08 -->
+ <target name="service.08">
+ <create.service.repo sample.number="08"/>
+ </target>
+
+ <!-- Sample Client 08 -->
+ <target name="client.08">
+ <create.and.run.client sample.number="08"/>
+ </target>
+
+ <!-- Sample Service 09 -->
+ <target name="service.09">
+ <create.service.repo sample.number="09"/>
+ </target>
+
+ <!-- Sample Client 09 -->
+ <target name="client.09">
+ <create.and.run.client sample.number="09"/>
+ </target>
+
+ <!-- Sample Service 10 -->
+ <target name="service.10">
+ <create.service.repo sample.number="10"/>
+ </target>
+
+ <!-- Sample Client 10 -->
+ <target name="client.10">
+ <create.and.run.client sample.number="10"/>
+ </target>
+
+ <!-- Sample Service 11 -->
+ <target name="service.11">
+ <create.service.repo sample.number="11"/>
+ </target>
+
+ <!-- Sample Client 11 -->
+ <target name="client.11">
+ <create.and.run.client sample.number="11"/>
+ </target>
+
+
+ <target name="clean">
+ <delete dir="build" />
+ </target>
+
+ <!-- Macro to create a service repo for a given sample -->
+ <macrodef name="create.service.repo">
+ <attribute name="sample.number" default="sample"/>
+ <sequential>
+ <mkdir dir="${service.repos.dir}/sample@{sample.number}"/>
+ <mkdir dir="${service.repos.dir}/sample@{sample.number}/services"/>
+ <mkdir dir="${service.repos.dir}/sample@{sample.number}/modules"/>
+
+ <!-- copy modules -->
+ <copy file="${modules.dir}/${addressing.mar}" tofile="${service.repos.dir}/sample@{sample.number}/modules/${addressing.mar}" overwrite="true"/>
+ <copy file="${modules.dir}/${rampart.mar}" tofile="${service.repos.dir}/sample@{sample.number}/modules/${rampart.mar}" overwrite="true"/>
+
+ <!-- create service -->
+ <mkdir dir="${temp.dir}"/>
+ <mkdir dir="${temp.dir}/META-INF"/>
+
+ <!-- Compile service -->
+ <javac srcdir="sample@{sample.number}/src" destdir="${temp.dir}">
+ <classpath>
+ <fileset dir="lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ </classpath>
+ <exclude name="**/Client.java"/>
+ </javac>
+
+ <copy file="sample@{sample.number}/services.xml" tofile="${temp.dir}/META-INF/services.xml" overwrite="true"/>
+ <copy file="keys/service.jks" tofile="${temp.dir}/service.jks" overwrite="true"/>
+ <copy file="keys/service.properties" tofile="${temp.dir}/service.properties" overwrite="true"/>
+
+ <jar destfile="${service.repos.dir}/sample@{sample.number}/services/sample@{sample.number}.aar">
+ <fileset dir="${temp.dir}"></fileset>
+ </jar>
+
+ <delete dir="${temp.dir}" />
+ <!-- start SimpleHTTPserver -->
+ <java classname="org.apache.axis2.transport.http.SimpleHTTPServer" fork="true">
+ <arg value="${service.repos.dir}/sample@{sample.number}"/>
+ <arg value="-p${server.port}"/>
+ <classpath>
+ <fileset dir="lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ </classpath>
+ </java>
+
+ </sequential>
+ </macrodef>
+
+ <macrodef name="create.and.run.client">
+ <attribute name="sample.number" default="sample"/>
+ <sequential>
+ <!-- Create the client repo -->
+ <mkdir dir="${client.repos.dir}/sample@{sample.number}"/>
+ <mkdir dir="${client.repos.dir}/sample@{sample.number}/conf"/>
+ <mkdir dir="${client.repos.dir}/sample@{sample.number}/modules"/>
+
+ <!-- Copy axis2.xml file -->
+ <copy file="sample@{sample.number}/client.axis2.xml" tofile="${client.repos.dir}/sample@{sample.number}/conf/axis2.xml" overwrite="true"/>
+
+ <!-- copy modules -->
+ <copy file="${modules.dir}/${addressing.mar}" tofile="${client.repos.dir}/sample@{sample.number}/modules/${addressing.mar}" overwrite="true"/>
+ <copy file="${modules.dir}/${rampart.mar}" tofile="${client.repos.dir}/sample@{sample.number}/modules/${rampart.mar}" overwrite="true"/>
+
+ <mkdir dir="${temp.client.dir}"/>
+
+ <!-- Compile client -->
+ <javac srcdir="sample@{sample.number}/src" destdir="${temp.client.dir}">
+ <classpath>
+ <fileset dir="lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ </classpath>
+ <exclude name="**/SimpleService.java"/>
+ </javac>
+
+ <copy file="keys/client.jks" tofile="${temp.client.dir}/client.jks" overwrite="true"/>
+ <copy file="keys/client.properties" tofile="${temp.client.dir}/client.properties" overwrite="true"/>
+
+
+ <!-- Run client -->
+ <java classname="org.apache.rampart.samples.sample@{sample.number}.Client" fork="true">
+ <arg value="${sample.services.url}/sample@{sample.number}"/>
+ <arg value="${client.repos.dir}/sample@{sample.number}"/>
+ <classpath>
+ <fileset dir="lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ <dirset dir="${temp.client.dir}" />
+ </classpath>
+ </java>
+
+<!-- <delete dir="${temp.client.dir}"/> -->
+ </sequential>
+ </macrodef>
+
+</project>
\ No newline at end of file
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/client.jks
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/client.jks?view=auto&rev=467253
==============================================================================
Binary file - no diff available.
Propchange: webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/client.jks
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/client.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/client.properties?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/client.properties (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/client.properties Mon Oct 23 22:58:10 2006
@@ -0,0 +1,4 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=apache
+org.apache.ws.security.crypto.merlin.file=client.jks
\ No newline at end of file
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/service.jks
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/service.jks?view=auto&rev=467253
==============================================================================
Binary file - no diff available.
Propchange: webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/service.jks
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/service.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/service.properties?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/service.properties (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/keys/service.properties Mon Oct 23 22:58:10 2006
@@ -0,0 +1,4 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=apache
+org.apache.ws.security.crypto.merlin.file=service.jks
\ No newline at end of file
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/client.axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/client.axis2.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/client.axis2.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/client.axis2.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,93 @@
+<axisconfig name="AxisJava2.0">
+
+ <module ref="rampart" />
+
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">true</parameter>
+
+ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+ <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
+ </transportSender>
+
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="Transport">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ </phase>
+ <phase name="Security"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="OperationInPhase"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutPhase"/>
+ <!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationInFaultPhase"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutFaultPhase"/>
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+
+</axisconfig>
+
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/services.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/services.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/services.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,10 @@
+<!-- services.xml of sample-1 : No Security-->
+<service>
+ <operation name="echo">
+ <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+ </operation>
+ <parameter name="ServiceClass" locked="false">org.apache.rampart.samples.sample01.SimpleService</parameter>
+
+ <module ref="rampart" />
+
+</service>
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/Client.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/Client.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/Client.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/Client.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.rampart.samples.sample01;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+
+public class Client {
+
+ public static void main(String[] args) throws Exception {
+
+ if(args.length != 2) {
+ System.out.println("Usage: $java Client endpoint_address client_repo_path");
+ }
+
+ ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], args[1] + "/conf/axis2.xml");
+
+ ServiceClient client = new ServiceClient(ctx, null);
+ Options options = new Options();
+ options.setAction("urn:echo");
+ options.setTo(new EndpointReference(args[0]));
+ client.setOptions(options);
+
+ OMElement response = client.sendReceive(getPayload("Hello world"));
+
+ System.out.println(response);
+
+ }
+
+ private static OMElement getPayload(String value) {
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMNamespace ns = factory.createOMNamespace("http://sample01.samples.rampart.apache.org/xsd","ns1");
+ OMElement elem = factory.createOMElement("echo", ns);
+ OMElement childElem = factory.createOMElement("param0", null);
+ childElem.setText(value);
+ elem.addChild(childElem);
+
+ return elem;
+ }
+
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/SimpleService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/SimpleService.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/SimpleService.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample01/src/org/apache/rampart/samples/sample01/SimpleService.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2003-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.rampart.samples.sample01;
+
+public class SimpleService {
+
+ public String echo(String arg) {
+ return arg;
+ }
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/client.axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/client.axis2.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/client.axis2.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/client.axis2.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,101 @@
+<axisconfig name="AxisJava2.0">
+
+ <module ref="rampart" />
+
+ <parameter name="OutflowSecurity">
+ <action>
+ <items>UsernameToken Timestamp</items>
+ <user>bob</user>
+ <passwordCallbackClass>org.apache.rampart.samples.sample02.PWCBHandler</passwordCallbackClass>
+ </action>
+ </parameter>
+
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">true</parameter>
+
+ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+ <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
+ </transportSender>
+
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="Transport">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ </phase>
+ <phase name="Security"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="OperationInPhase"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutPhase"/>
+ <!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationInFaultPhase"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutFaultPhase"/>
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+
+</axisconfig>
+
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/services.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/services.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/services.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,16 @@
+<!-- services.xml of sample-2 : Timestamp and UsernameToken-->
+<service>
+ <operation name="echo">
+ <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+ </operation>
+ <parameter name="ServiceClass" locked="false">org.apache.rampart.samples.sample02.SimpleService</parameter>
+
+ <module ref="rampart" />
+
+ <parameter name="InflowSecurity">
+ <action>
+ <items>UsernameToken Timestamp</items>
+ <passwordCallbackClass>org.apache.rampart.samples.sample02.PWCBHandler</passwordCallbackClass>
+ </action>
+ </parameter>
+</service>
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/Client.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/Client.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/Client.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/Client.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.rampart.samples.sample02;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+
+public class Client {
+
+ public static void main(String[] args) throws Exception {
+
+ if(args.length != 2) {
+ System.out.println("Usage: $java Client endpoint_address client_repo_path");
+ }
+
+ ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], args[1] + "/conf/axis2.xml");
+
+ ServiceClient client = new ServiceClient(ctx, null);
+ Options options = new Options();
+ options.setAction("urn:echo");
+ options.setTo(new EndpointReference(args[0]));
+ client.setOptions(options);
+
+ OMElement response = client.sendReceive(getPayload("Hello world"));
+
+ System.out.println(response);
+
+ }
+
+ private static OMElement getPayload(String value) {
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMNamespace ns = factory.createOMNamespace("http://sample02.samples.rampart.apache.org/xsd","ns1");
+ OMElement elem = factory.createOMElement("echo", ns);
+ OMElement childElem = factory.createOMElement("param0", null);
+ childElem.setText(value);
+ elem.addChild(childElem);
+
+ return elem;
+ }
+
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/PWCBHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/PWCBHandler.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/PWCBHandler.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/PWCBHandler.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.rampart.samples.sample02;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import java.io.IOException;
+
+public class PWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ String id = pwcb.getIdentifer();
+ if("bob".equals(id)) {
+ pwcb.setPassword("bobPW");
+ }
+ }
+ }
+
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/SimpleService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/SimpleService.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/SimpleService.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample02/src/org/apache/rampart/samples/sample02/SimpleService.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2003-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.rampart.samples.sample02;
+
+public class SimpleService {
+
+ public String echo(String arg) {
+ return arg;
+ }
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/client.axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/client.axis2.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/client.axis2.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/client.axis2.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,102 @@
+<axisconfig name="AxisJava2.0">
+
+ <module ref="rampart" />
+
+ <parameter name="OutflowSecurity">
+ <action>
+ <items>UsernameToken</items>
+ <user>bob</user>
+ <passwordCallbackClass>org.apache.rampart.samples.sample03.PWCBHandler</passwordCallbackClass>
+ <passwordType>PasswordText</passwordType>
+ </action>
+ </parameter>
+
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">true</parameter>
+
+ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+ <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
+ </transportSender>
+
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="Transport">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ </phase>
+ <phase name="Security"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="OperationInPhase"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutPhase"/>
+ <!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationInFaultPhase"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutFaultPhase"/>
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+
+</axisconfig>
+
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/services.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/services.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/services.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,16 @@
+<!-- services.xml of sample-3 : Timestamp and UsernameToken (with plaintext password)-->
+<service>
+ <operation name="echo">
+ <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+ </operation>
+ <parameter name="ServiceClass" locked="false">org.apache.rampart.samples.sample03.SimpleService</parameter>
+
+ <module ref="rampart" />
+
+ <parameter name="InflowSecurity">
+ <action>
+ <items>UsernameToken</items>
+ <passwordCallbackClass>org.apache.rampart.samples.sample03.PWCBHandler</passwordCallbackClass>
+ </action>
+ </parameter>
+</service>
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/Client.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/Client.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/Client.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/Client.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.rampart.samples.sample03;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+
+public class Client {
+
+ public static void main(String[] args) throws Exception {
+
+ if(args.length != 2) {
+ System.out.println("Usage: $java Client endpoint_address client_repo_path");
+ }
+
+ ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], args[1] + "/conf/axis2.xml");
+
+ ServiceClient client = new ServiceClient(ctx, null);
+ Options options = new Options();
+ options.setAction("urn:echo");
+ options.setTo(new EndpointReference(args[0]));
+ client.setOptions(options);
+
+ OMElement response = client.sendReceive(getPayload("Hello world"));
+
+ System.out.println(response);
+
+ }
+
+ private static OMElement getPayload(String value) {
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMNamespace ns = factory.createOMNamespace("http://sample03.samples.rampart.apache.org/xsd","ns1");
+ OMElement elem = factory.createOMElement("echo", ns);
+ OMElement childElem = factory.createOMElement("param0", null);
+ childElem.setText(value);
+ elem.addChild(childElem);
+
+ return elem;
+ }
+
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.rampart.samples.sample03;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import java.io.IOException;
+
+public class PWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+
+ //When the server side need to authenticate the user
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ if (pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) {
+ if(pwcb.getIdentifer().equals("bob") && pwcb.getPassword().equals("bobPW")) {
+ return;
+ } else {
+ throw new UnsupportedCallbackException(callbacks[i], "check failed");
+ }
+ }
+
+ //When the client requests for the password to be added in to the
+ //UT element
+ pwcb.setPassword("bobPW");
+ }
+ }
+
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2003-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.rampart.samples.sample03;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.ws.security.WSConstants;
+import org.apache.ws.security.WSSecurityEngineResult;
+import org.apache.ws.security.WSUsernameTokenPrincipal;
+import org.apache.ws.security.handler.WSHandlerConstants;
+import org.apache.ws.security.handler.WSHandlerResult;
+
+import java.util.Vector;
+
+public class SimpleService {
+
+ MessageContext msgCtx;
+
+ public void setOperationContext(OperationContext opContext) throws AxisFault {
+ this.msgCtx = opContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ }
+
+ public String echo(String arg) {
+ Vector results = null;
+ if ((results = (Vector) msgCtx
+ .getProperty(WSHandlerConstants.RECV_RESULTS)) == null) {
+ System.out.println("No security results!!");
+ throw new RuntimeException("No security results!!");
+ } else {
+ System.out.println("Number of results: " + results.size());
+ for (int i = 0; i < results.size(); i++) {
+ WSHandlerResult rResult = (WSHandlerResult) results.get(i);
+ Vector wsSecEngineResults = rResult.getResults();
+
+ for (int j = 0; j < wsSecEngineResults.size(); j++) {
+ WSSecurityEngineResult wser = (WSSecurityEngineResult) wsSecEngineResults.get(j);
+ if (wser.getAction() == WSConstants.UT
+ && wser.getPrincipal() != null) {
+
+ //Extract the principal
+ WSUsernameTokenPrincipal principal = (WSUsernameTokenPrincipal)wser.getPrincipal();
+
+ //Get user/pass
+ String user = principal.getName();
+ String passwd = principal.getPassword();
+
+ //Authenticate
+ if("bob".equals(user) && "bobPW".equals(passwd)) {
+ //Authentication suceessful
+ return arg;
+ } else {
+ throw new RuntimeException("Authentication Faliure!!");
+ }
+
+ }
+ }
+ }
+
+ return arg;
+ }
+
+ }
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/client.axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/client.axis2.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/client.axis2.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/client.axis2.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,112 @@
+<axisconfig name="AxisJava2.0">
+
+ <module ref="rampart" />
+
+ <module ref="rampart" />
+
+ <parameter name="OutflowSecurity">
+ <action>
+ <items>Timestamp Signature</items>
+ <user>client</user>
+ <signaturePropFile>client.properties</signaturePropFile>
+ <passwordCallbackClass>org.apache.rampart.samples.sample04.PWCBHandler</passwordCallbackClass>
+ <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
+ </action>
+ </parameter>
+
+ <parameter name="InflowSecurity">
+ <action>
+ <items>Timestamp Signature</items>
+ <signaturePropFile>client.properties</signaturePropFile>
+ </action>
+ </parameter>
+
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">true</parameter>
+
+ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+ <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
+ </transportSender>
+
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="Transport">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ </phase>
+ <phase name="Security"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="OperationInPhase"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutPhase"/>
+ <!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationInFaultPhase"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutFaultPhase"/>
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+
+</axisconfig>
+
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/services.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/services.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/services.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,27 @@
+<!-- services.xml of sample-4 : Signature only -->
+<service>
+ <operation name="echo">
+ <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+ </operation>
+ <parameter name="ServiceClass" locked="false">org.apache.rampart.samples.sample04.SimpleService</parameter>
+
+ <module ref="rampart" />
+
+ <parameter name="InflowSecurity">
+ <action>
+ <items>Timestamp Signature</items>
+ <signaturePropFile>service.properties</signaturePropFile>
+ </action>
+ </parameter>
+
+ <parameter name="OutflowSecurity">
+ <action>
+ <items>Timestamp Signature</items>
+ <user>service</user>
+ <passwordCallbackClass>org.apache.rampart.samples.sample04.PWCBHandler</passwordCallbackClass>
+ <signaturePropFile>service.properties</signaturePropFile>
+ <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
+ </action>
+ </parameter>
+
+</service>
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/Client.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/Client.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/Client.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/Client.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.rampart.samples.sample04;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+
+public class Client {
+
+ public static void main(String[] args) throws Exception {
+
+ if(args.length != 2) {
+ System.out.println("Usage: $java Client endpoint_address client_repo_path");
+ }
+
+ ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], args[1] + "/conf/axis2.xml");
+
+ ServiceClient client = new ServiceClient(ctx, null);
+ Options options = new Options();
+ options.setAction("urn:echo");
+ options.setTo(new EndpointReference(args[0]));
+ client.setOptions(options);
+
+ OMElement response = client.sendReceive(getPayload("Hello world"));
+
+ System.out.println(response);
+
+ }
+
+ private static OMElement getPayload(String value) {
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMNamespace ns = factory.createOMNamespace("http://sample04.samples.rampart.apache.org/xsd","ns1");
+ OMElement elem = factory.createOMElement("echo", ns);
+ OMElement childElem = factory.createOMElement("param0", null);
+ childElem.setText(value);
+ elem.addChild(childElem);
+
+ return elem;
+ }
+
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/PWCBHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/PWCBHandler.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/PWCBHandler.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/PWCBHandler.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.rampart.samples.sample04;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import java.io.IOException;
+
+public class PWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+
+ String id = pwcb.getIdentifer();
+ if("client".equals(id)) {
+ pwcb.setPassword("apache");
+ } else if("service".equals(id)) {
+ pwcb.setPassword("apache");
+ }
+ }
+ }
+
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/SimpleService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/SimpleService.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/SimpleService.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample04/src/org/apache/rampart/samples/sample04/SimpleService.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,25 @@
+package org.apache.rampart.samples.sample04;
+/*
+
+ * Copyright 2003-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+public class SimpleService {
+
+ public String echo(String arg) {
+ return arg;
+ }
+}
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/client.axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/client.axis2.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/client.axis2.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/client.axis2.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,110 @@
+<axisconfig name="AxisJava2.0">
+
+ <module ref="rampart" />
+
+ <parameter name="OutflowSecurity">
+ <action>
+ <items>Encrypt</items>
+ <encryptionUser>service</encryptionUser>
+ <encryptionPropFile>client.properties</encryptionPropFile>
+ </action>
+ </parameter>
+
+ <parameter name="InflowSecurity">
+ <action>
+ <items>Encrypt</items>
+ <passwordCallbackClass>org.apache.rampart.samples.sample05.PWCBHandler</passwordCallbackClass>
+ <decryptionPropFile>client.properties</decryptionPropFile>
+ </action>
+ </parameter>
+
+
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">true</parameter>
+
+ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+ <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
+ </transportSender>
+
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="Transport">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ </phase>
+ <phase name="Security"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="OperationInPhase"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutPhase"/>
+ <!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationInFaultPhase"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutFaultPhase"/>
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+
+</axisconfig>
+
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/services.xml?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/services.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/services.xml Mon Oct 23 22:58:10 2006
@@ -0,0 +1,28 @@
+<!-- services.xml of sample-5 : Encryption only -->
+<service>
+ <operation name="echo">
+ <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+ </operation>
+ <parameter name="ServiceClass" locked="false">org.apache.rampart.samples.sample05.SimpleService</parameter>
+
+ <module ref="rampart" />
+
+ <parameter name="InflowSecurity">
+ <action>
+ <items>Encrypt</items>
+ <passwordCallbackClass>org.apache.rampart.samples.sample05.PWCBHandler</passwordCallbackClass>
+ <decryptionPropFile>service.properties</decryptionPropFile>
+ </action>
+ </parameter>
+
+ <parameter name="OutflowSecurity">
+ <action>
+ <items>Encrypt</items>
+ <encryptionUser>client</encryptionUser>
+ <encryptionPropFile>service.properties</encryptionPropFile>
+ </action>
+ </parameter>
+
+
+
+</service>
Added: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/samples/sample05/Client.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/samples/sample05/Client.java?view=auto&rev=467253
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/samples/sample05/Client.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample05/src/org/apache/rampart/samples/sample05/Client.java Mon Oct 23 22:58:10 2006
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.rampart.samples.sample05;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+
+public class Client {
+
+ public static void main(String[] args) throws Exception {
+
+ if(args.length != 2) {
+ System.out.println("Usage: $java Client endpoint_address client_repo_path");
+ }
+
+ ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], args[1] + "/conf/axis2.xml");
+
+ ServiceClient client = new ServiceClient(ctx, null);
+ Options options = new Options();
+ options.setAction("urn:echo");
+ options.setTo(new EndpointReference(args[0]));
+ client.setOptions(options);
+
+ OMElement response = client.sendReceive(getPayload("Hello world"));
+
+ System.out.println(response);
+
+ }
+
+ private static OMElement getPayload(String value) {
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMNamespace ns = factory.createOMNamespace("http://sample05.samples.rampart.apache.org/xsd","ns1");
+ OMElement elem = factory.createOMElement("echo", ns);
+ OMElement childElem = factory.createOMElement("param0", null);
+ childElem.setText(value);
+ elem.addChild(childElem);
+
+ return elem;
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org