You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2008/10/25 19:38:24 UTC
svn commit: r707868 [1/2] - in /ode/trunk: ./
axis2-war/src/main/webapp/WEB-INF/conf/
axis2-war/src/test/java/org/apache/ode/axis2/
axis2-war/src/test/java/org/apache/rampart/
axis2-war/src/test/java/org/apache/rampart/samples/
axis2-war/src/test/java/...
Author: midon
Date: Sat Oct 25 10:38:22 2008
New Revision: 707868
URL: http://svn.apache.org/viewvc?rev=707868&view=rev
Log:
ODE-388: merge of WS-Security support - Tests broken, some debugging in sight :(
don't forget the binary files
add bouncycastle jar
Added:
ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartBasicTest.java
ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartPolicyTest.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample01/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample01/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample02/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample02/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample03/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample03/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample04/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample04/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample05/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample05/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample02/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample02/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample03/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample03/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample04/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample04/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample05/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample05/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample06/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample06/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample07/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample07/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample08/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample08/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample09/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample09/PWCBHandler.java
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample10/
ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample10/PWCBHandler.java
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample02.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample03.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample04.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample05.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample06.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample07.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample08.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample09.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample10.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.jks
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.properties
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.bpel
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.wsdl
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/deploy.xml
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/echo-service.wsdl
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/testRequest.soap
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/readme.txt
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/sample02.axis2
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/sample03.axis2
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/sample04.axis2
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/sample05.axis2
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/sample06.axis2
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/sample07.axis2
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/sample08.axis2
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/sample09.axis2
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/sample10.axis2
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/sample02.aar
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/sample03.aar
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/sample04.aar
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/sample05.aar
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/sample06.aar
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/sample07.aar
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/sample08.aar
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/sample09.aar
ode/trunk/axis2-war/src/test/resources/TestRampartBasic/services/sample10.aar
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/README-policy-sample01.txt
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/README-policy-sample02.txt
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/README-policy-sample03.txt
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/README-policy-sample04.txt
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/client.jks
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/policy-sample01.xml
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/policy-sample02.xml
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/policy-sample03.xml
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/policy-sample04.xml
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/process-template/
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/process-template/HelloWorld2.bpel
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/process-template/HelloWorld2.wsdl
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/process-template/config.endpoint
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/process-template/deploy.xml
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/process-template/echo-service.wsdl
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/process-template/testRequest.soap
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/readme.txt
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/services/
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/services/policy-sample01.aar
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/services/policy-sample02.aar
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/services/policy-sample03.aar
ode/trunk/axis2-war/src/test/resources/TestRampartPolicy/services/policy-sample04.aar
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/Properties.java.orig
- copied, changed from r707198, ode/trunk/axis2/src/main/java/org/apache/ode/axis2/Properties.java
Modified:
ode/trunk/Rakefile
ode/trunk/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml
ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/Properties.java
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java
ode/trunk/utils/src/main/java/org/apache/ode/utils/URITemplate.java
ode/trunk/utils/src/main/java/org/apache/ode/utils/fs/FileUtils.java
ode/trunk/utils/src/test/java/org/apache/ode/utils/fs/FileUtilsTest.java
Modified: ode/trunk/Rakefile
URL: http://svn.apache.org/viewvc/ode/trunk/Rakefile?rev=707868&r1=707867&r2=707868&view=diff
==============================================================================
--- ode/trunk/Rakefile (original)
+++ ode/trunk/Rakefile Sat Oct 25 10:38:22 2008
@@ -97,6 +97,18 @@
ANNONGEN = findArtifacts(AXIS2_DEPS, "annogen:annogen") #"annogen:annogen:jar:0.1.0"
ANT = "ant:ant:jar:1.6.5" # TODO: do we need ant? Currently referenced in JBI deployable
AXIOM = findArtifacts(AXIS2_DEPS, "org.apache.ws.commons.axiom") #[ group("axiom-api", "axiom-impl", "axiom-dom", :under=>"org.apache.ws.commons.axiom", :version=>"1.2.7") ]
+AXIS2_MODULES = struct(
+ :mods => ["org.apache.rampart:rampart:mar:1.4",
+ "org.apache.rampart:rahas:mar:1.4",
+ "org.apache.axis2:addressing:mar:1.4"],
+ :libs => [group("rampart-core", "rampart-policy", "rampart-trust",
+ :under=>"org.apache.rampart",
+ :version=>"1.4"),
+ "org.apache.ws.security:wss4j:jar:1.5.4",
+ "org.apache.santuario:xmlsec:jar:1.4.1",
+ "opensaml:opensaml:jar:1.1",
+ "bouncycastle:bcprov-jdk15:jar:132"]
+)
AXIS2_WAR = "org.apache.axis2:axis2-webapp:war:1.4.1"
AXIS2_ALL = AXIS2_DEPS #group("axis2-adb", "axis2-codegen", "axis2-kernel", "axis2-java2wsdl", "axis2-jibx", "axis2-saaj", "axis2-xmlbeans", :under=>"org.apache.axis2", :version=>"1.4.1")
HTTPCORE = findArtifacts(AXIS2_DEPS, "org.apache.httpcomponents") #group("httpcore", "httpcore-nio", :under=>"org.apache.httpcomponents", :version=>"4.0-beta1")
@@ -142,6 +154,7 @@
LOG4J = findArtifacts(AXIS2_DEPS, "log4j:log4j") #"log4j:log4j:jar:1.2.15"
OPENJPA = ["org.apache.openjpa:openjpa:jar:1.1.0",
"net.sourceforge.serp:serp:jar:1.13.1"]
+
SAXON = group("saxon", "saxon-xpath", "saxon-dom", :under=>"net.sf.saxon", :version=>"8.7")
SERVICEMIX = group("servicemix-core", "servicemix-shared", "servicemix-services",
:under=>"org.apache.servicemix", :version=>"3.1-incubating")
@@ -168,6 +181,7 @@
repositories.remote << "http://repo1.maven.org/maven2"
repositories.remote << "http://people.apache.org/repo/m2-snapshot-repository"
repositories.remote << "http://download.java.net/maven/2"
+repositories.remote << "http://ws.zones.apache.org/repository2"
repositories.release_to[:url] ||= "sftp://guest@localhost/home/guest"
# Changing releases tag names
@@ -198,7 +212,7 @@
"scheduler-simple", "bpel-schemas", "bpel-store", "utils"),
AXIOM, AXIS2_ALL, COMMONS.lang, COMMONS.logging, COMMONS.collections, COMMONS.httpclient, DERBY, GERONIMO.kernel, GERONIMO.transaction,
JAVAX.activation, JAVAX.servlet, JAVAX.stream, JAVAX.transaction, JENCKS, WSDL4J, WS_COMMONS.xml_schema,
- XMLBEANS
+ XMLBEANS, AXIS2_MODULES.libs
test.with project("tools"), AXIOM, JAVAX.javamail, COMMONS.codec, COMMONS.httpclient, XERCES, WOODSTOX
test.exclude '*'
@@ -217,7 +231,7 @@
COMMONS.lang, COMMONS.logging, COMMONS.pool, DERBY, DERBY_TOOLS, JAXEN, JAVAX.activation, JAVAX.ejb, JAVAX.javamail,
JAVAX.connector, JAVAX.jms, JAVAX.persistence, JAVAX.transaction, JAVAX.stream, JIBX,
GERONIMO.connector, GERONIMO.kernel, GERONIMO.transaction, LOG4J, OPENJPA, SAXON, TRANQL, WODEN,
- WOODSTOX, WSDL4J, WS_COMMONS.axiom, WS_COMMONS.neethi, WS_COMMONS.xml_schema, XALAN, XERCES, XMLBEANS
+ WOODSTOX, WSDL4J, WS_COMMONS.axiom, WS_COMMONS.neethi, WS_COMMONS.xml_schema, XALAN, XERCES, XMLBEANS, AXIS2_MODULES.libs
package(:war).with(:libs=>libs).path("WEB-INF").tap do |web_inf|
web_inf.merge project("dao-jpa-db").package(:zip)
@@ -225,6 +239,7 @@
web_inf.include project("axis2").path_to("src/main/wsdl/*")
web_inf.include project("bpel-schemas").path_to("src/main/xsd/pmapi.xsd")
end
+ package(:war).path("WEB-INF/modules").include(artifacts(AXIS2_MODULES.mods))
package(:war).tap do |root|
root.merge(artifact(AXIS2_WAR)).exclude("WEB-INF/**/*").exclude("META-INF/**/*")
end
@@ -251,11 +266,82 @@
cp project("bpel-schemas").path_to("src/main/xsd/pmapi.xsd"), _("target/test/webapp/WEB-INF")
mkdir_p _("target/test/webapp/WEB-INF/processes")
rm_rf Dir[_("target/test/webapp") + "/**/.svn"]
+ mkdir _("target/test/webapp/WEB-INF/processes") unless File.exist?(_("target/test/webapp/WEB-INF/processes"))
+ mkdir _("target/test/webapp/WEB-INF/modules") unless File.exist?(_("target/test/webapp/WEB-INF/modules"))
# move around some property files for test purpose
mv Dir[_("target/test-classes/TestEndpointProperties/*_global_conf*.endpoint")], _("target/test/webapp/WEB-INF/conf")
+ artifacts(AXIS2_MODULES.mods).map {|a| a.invoke }
+ cp AXIS2_MODULES.mods.map {|a| repositories.locate(a)} , _("target/test/webapp/WEB-INF/modules")
end
test.setup unzip(_("target/test/webapp/WEB-INF")=>project("dao-jpa-db").package(:zip))
test.exclude('*') unless Buildr.environment != 'test'
+
+ test.setup task(:prepare_rampart_policy_test) do |task|
+ # test_dir will be the Axis2 Repo dir
+ test_dir = _("target/test/resources/TestRampartPolicy")
+ # copy the required modules
+ mkdir "#{test_dir}/modules" unless File.directory? "#{test_dir}/modules"
+ artifacts(AXIS2_MODULES.mods).map {|a| a.invoke }
+ cp AXIS2_MODULES.mods.map {|a| repositories.locate(a)} , _("#{test_dir}/modules")
+ # generate one process per test
+ Dir.chdir(test_dir) do
+ Dir["policy-sample*.xml"].each do |policy_file|
+ sample_name = policy_file.gsub(".xml","")
+ # create process directory
+ proc_dir = "process-#{sample_name}"
+ mkdir proc_dir unless File.directory? proc_dir
+ # copy files
+ [policy_file, "README-#{sample_name}.txt"].each{|f| cp f, proc_dir }
+ # copy files from template and replace variable names
+ Dir["process-template/*"].each do |file|
+ lines = IO.readlines(file)
+ # copy file and replace template values
+ File.open("#{proc_dir}/#{File.basename(file)}", 'w') { |f|
+ lines.each { |l|
+ sample_id = sample_name[-2,2]
+ l.gsub!("{sample.namespace}", "http://sample#{sample_id}.policy.samples.rampart.apache.org")
+ l.gsub!("{sample.service.name}", sample_name)
+ f<<l
+ }
+ }
+ end
+ end
+ end
+ end
+
+ test.setup task(:prepare_rampart_basic_test) do |task|
+ # test_dir will be the Axis2 Repo dir
+ test_dir = _("target/test/resources/TestRampartBasic")
+ # copy the required modules
+ mkdir "#{test_dir}/modules" unless File.directory? "#{test_dir}/modules"
+ artifacts(AXIS2_MODULES.mods).map {|a| a.invoke }
+ cp AXIS2_MODULES.mods.map {|a| repositories.locate(a)} , _("#{test_dir}/modules")
+ # generate one process per test
+ Dir.chdir(test_dir) do
+ Dir["sample*.axis2"].each do |axis2_file|
+ sample_name = axis2_file.gsub(".axis2","")
+ # create process directory
+ proc_dir = "process-basic-#{sample_name}"
+ mkdir proc_dir unless File.directory? proc_dir
+ # copy files
+ [axis2_file, "README-#{sample_name}.txt"].each{|f| cp f, proc_dir }
+ # cp axis2_file, "#{proc_dir}/"
+ # copy files from template and replace variable names
+ Dir["process-template/*"].each do |file|
+ lines = IO.readlines(file)
+ # copy file and replace template values
+ File.open("#{proc_dir}/#{File.basename(file)}", 'w') { |f|
+ lines.each { |l|
+ sample_id = sample_name[-2,2]
+ l.gsub!("{sample.namespace}", "http://sample#{sample_id}.samples.rampart.apache.org")
+ l.gsub!("{sample.service.name}", sample_name)
+ f<<l
+ }
+ }
+ end
+ end
+ end
+ end
end
desc "ODE APIs"
Modified: ode/trunk/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml?rev=707868&r1=707867&r2=707868&view=diff
==============================================================================
--- ode/trunk/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml (original)
+++ ode/trunk/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml Sat Oct 25 10:38:22 2008
@@ -52,7 +52,6 @@
<!--<parameter name="ModulesDirectory" locked="false">modules</parameter>-->
-
<!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
<!--root which can configured using the following contextRoot parameter-->
<!--<parameter name="contextRoot" locked="false">axis2</parameter>-->
@@ -132,7 +131,7 @@
<!-- <parameter name="threadKeepAliveTime" locked="false">240000</parameter> -->
<!-- <parameter name="threadKeepAliveTimeUnit" locked="false">MILLISECONDS</parameter> -->
</transportReceiver>
-
+
<!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="myTopicConnectionFactory" locked="false">
@@ -163,13 +162,13 @@
<!--<parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>-->
<!--</transportReceiver>-->
- <!--Uncomment if you want to have TCP transport support-->
+ <!--Uncomment if you want to have TCP transport support-->
<!--transportReceiver name="tcp"
class="org.apache.axis2.transport.tcp.TCPServer">
<parameter name="port" locked="false">6060</parameter-->>
- <!--If you want to give your own host address for EPR generation-->
- <!--uncommet following paramter , and set as you required.-->
- <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
+ <!--If you want to give your own host address for EPR generation-->
+ <!--uncommet following paramter , and set as you required.-->
+ <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
<!-- /transportReceiver -->
<!-- ================================================= -->
@@ -229,6 +228,16 @@
class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
<order phase="Transport"/>
</handler>
+ <handler name="ODEAxisDispatcher"
+ class="org.apache.ode.axis2.hooks.ODEAxisDispatcher">
+ <order phase="Transport"/>
+ </handler>
+ </phase>
+ <phase name="Addressing">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+ <order phase="Addressing"/>
+ </handler>
</phase>
<phase name="Security"/>
<phase name="PreDispatch"/>
@@ -239,32 +248,27 @@
class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
<handler name="HTTPLocationBasedDispatcher"
class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
-
- <handler name="ODEAxisDispatcher"
- class="org.apache.ode.axis2.hooks.ODEAxisDispatcher">
- <order phase="Dispatch"/>
- </handler>
</phase>
<!-- System pre defined phases -->
<!-- After Postdispatch phase module author or or service author can add any phase he want -->
<phase name="ProcessHeader">
<handler name="SessionInHandler"
- class="org.apache.ode.axis2.hooks.SessionInHandler">
+ class="org.apache.ode.axis2.hooks.SessionInHandler">
<order phase="PostDispatch"/>
</handler>
</phase>
<phase name="OperationInPhase"/>
- <phase name="soapmonitorPhase"/>
+ <phase name="soapmonitorPhase"/>
</phaseOrder>
<phaseOrder type="OutFlow">
<!-- user can add his own phases to this area -->
- <phase name="ProcessHeader">
- <handler name="SessionOutHandler"
- class="org.apache.ode.axis2.hooks.SessionOutHandler">
- <order phase="PreDispatch"/>
- </handler>
- </phase>
- <phase name="soapmonitorPhase"/>
+ <phase name="ProcessHeader">
+ <handler name="SessionOutHandler"
+ class="org.apache.ode.axis2.hooks.SessionOutHandler">
+ <order phase="PreDispatch"/>
+ </handler>
+ </phase>
+ <phase name="soapmonitorPhase"/>
<phase name="OperationOutPhase"/>
<!--system predefined phase-->
<!--these phase will run irrespective of the service-->
@@ -273,6 +277,12 @@
<phase name="Security"/>
</phaseOrder>
<phaseOrder type="InFaultFlow">
+ <phase name="Addressing">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+ <order phase="Addressing"/>
+ </handler>
+ </phase>
<phase name="PreDispatch"/>
<phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
<handler name="RequestURIBasedDispatcher"
@@ -285,11 +295,6 @@
<order phase="Dispatch"/>
</handler>
- <handler name="AddressingBasedDispatcher"
- class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
- <order phase="Dispatch"/>
- </handler>
-
<handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher">
<order phase="Dispatch"/>
@@ -297,11 +302,11 @@
</phase>
<!-- user can add his own phases to this area -->
<phase name="OperationInFaultPhase"/>
- <phase name="soapmonitorPhase"/>
+ <phase name="soapmonitorPhase"/>
</phaseOrder>
<phaseOrder type="OutFaultFlow">
<!-- user can add his own phases to this area -->
- <phase name="soapmonitorPhase"/>
+ <phase name="soapmonitorPhase"/>
<phase name="OperationOutFaultPhase"/>
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
Modified: ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java?rev=707868&r1=707867&r2=707868&view=diff
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java (original)
+++ ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java Sat Oct 25 10:38:22 2008
@@ -8,6 +8,8 @@
import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
import org.apache.axis2.engine.AxisServer;
import org.apache.axis2.engine.MessageReceiver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.ode.axis2.hooks.ODEAxisService;
import org.apache.ode.axis2.util.Axis2UriResolver;
import org.apache.ode.axis2.util.Axis2WSDLLocator;
@@ -36,7 +38,8 @@
public abstract class Axis2TestBase {
private static final int DEFAULT_TEST_PORT = 8888;
-
+ private static final Log log = LogFactory.getLog(Axis2TestBase.class);
+
protected ODEAxis2Server server;
// Provide standard constructors to accommodate creation of test suites
@@ -46,13 +49,18 @@
public Axis2TestBase() {
this(null);
}
-
+
public void startServer() throws Exception {
- String webappPath = getClass().getClassLoader().getResource("webapp").getFile();
- server = new ODEAxis2Server(webappPath);
- server.start();
+ startServer("webapp/WEB-INF", "webapp/WEB-INF/conf/axis2.xml");
}
+ public void startServer(String axis2RepoDir, String axis2ConfLocation) throws Exception {
+ String odeRootAbsolutePath = getClass().getClassLoader().getResource("webapp/WEB-INF").getFile();
+ String axis2RepoAbsolutePath = getClass().getClassLoader().getResource(axis2RepoDir).getFile();
+ String axis2ConfAbsolutePath = axis2ConfLocation == null ? null : getClass().getClassLoader().getResource(axis2ConfLocation).getFile();
+ server = new ODEAxis2Server(odeRootAbsolutePath, axis2RepoAbsolutePath, axis2ConfAbsolutePath);
+ server.start();
+ }
public void stopServer() throws AxisFault {
server.stop();
}
@@ -68,16 +76,20 @@
}
protected class ODEAxis2Server extends AxisServer {
- ODEServer _ode = new ODEServer();
- String webappPath;
- protected ODEAxis2Server (String webappPath) throws Exception {
+ ODEServer _ode;
+ String odeRootDir;
+
+ protected ODEAxis2Server(String odeRootDir, String axis2RepoDir, String axis2ConfLocation) throws Exception {
super(false);
- this.webappPath = webappPath;
- String confLocation = webappPath + "/WEB-INF/conf/axis2.xml";
- String repoLocation = webappPath + "/WEB-INF";
- configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(repoLocation, confLocation);
+ this.odeRootDir = odeRootDir;
+ if (log.isInfoEnabled()) {
+ log.info("Ode Root Dir: " + odeRootDir);
+ log.info("Axis2 Conf file: " + axis2ConfLocation);
+ log.info("Axis2 Repo dir: " + axis2RepoDir);
+ }
+
+ configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(axis2RepoDir, axis2ConfLocation);
// do not use 8080 for tests
configContext.getAxisConfiguration().getTransportIn("http").addParameter(new Parameter("port", ""+DEFAULT_TEST_PORT));
}
@@ -86,7 +98,7 @@
super.start();
_ode = new ODEServer();
try {
- _ode.init(webappPath+"/WEB-INF", configContext.getAxisConfiguration());
+ _ode.init(odeRootDir, configContext.getAxisConfiguration());
} catch (ServletException e) {
e.printStackTrace();
}
@@ -101,9 +113,11 @@
public Collection<QName> deployProcess(String bundleName) {
return _ode.getProcessStore().deploy(new File(getBundleDir(bundleName)));
}
+
public void undeployProcess(String bundleName) {
_ode.getProcessStore().undeploy(new File(getBundleDir(bundleName)));
}
+
public boolean isDeployed(String bundleName) {
return _ode.getProcessStore().getPackages().contains(bundleName);
}
@@ -136,17 +150,18 @@
operation.setMessageReceiver(receiver);
}
}
- getConfigurationContext().getAxisConfiguration().addService(axisService);
+ getConfigurationContext().getAxisConfiguration().addService(axisService);
}
public String sendRequestFile(String endpoint, String bundleName, String filename) {
try {
return HttpSoapSender.doSend(new URL(endpoint),
- new FileInputStream(getBundleDir(bundleName)+"/" + filename), null, 0, null, null, null);
+ new FileInputStream(getBundleDir(bundleName) + "/" + filename), null, 0, null, null, null);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
+
protected String getBundleDir(String bundleName) {
return getClass().getClassLoader().getResource(bundleName).getFile();
}
@@ -155,6 +170,7 @@
* Convenient methods to generate a WSDL for an Axis2 service. Often nice, but also often
* generates crappy WSDL that aren't even valid (especially when faults are involved) so
* use with care.
+ *
* @param serviceName
* @param fileName
* @throws AxisFault
Added: ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartBasicTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartBasicTest.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartBasicTest.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartBasicTest.java Sat Oct 25 10:38:22 2008
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.ode.axis2;
+
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.AfterTest;
+import org.apache.axis2.transport.http.server.SimpleHttpServer;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+
+import java.io.File;
+import java.io.FileFilter;
+
+/**
+ *
+ *
+ */
+public class RampartBasicTest extends Axis2TestBase {
+
+ @DataProvider(name = "bundles")
+ public Object[][] testPolicySamples() throws Exception {
+ File[] policies = new File(getClass().getClassLoader().getResource("TestRampartBasic").getFile()).listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname.isDirectory() && pathname.getName().matches("process-basic-sample\\d*");
+ }
+ });
+ Object[][] bundles = new Object[policies.length][];
+ for (int i = 0; i < policies.length; i++) {
+ bundles[i] = new Object[]{"TestRampartBasic/" + policies[i].getName()};
+ }
+// bundles = new Object[][]{new Object[]{"TestRampartBasic/process-basic-sample02"}};
+ return bundles;
+ }
+
+
+ @BeforeClass
+ protected void setUp() throws Exception {
+ // mind the annotation above: start the server only once for all tests
+ startServer("TestRampartBasic", "webapp/WEB-INF/conf/axis2.xml");
+ }
+
+ @AfterClass
+ protected void tearDown() throws Exception {
+ // mind the annotation above: start the server only once for all tests
+ super.tearDown();
+ }
+
+ @Test(dataProvider = "bundles")
+ public void executeProcess(String bundleName) throws Exception {
+ if (server.isDeployed(new File(bundleName).getName())) {
+ server.undeployProcess(bundleName);
+ }
+ server.deployProcess(bundleName);
+ try {
+ String response = server.sendRequestFile("http://localhost:8888/processes/helloWorld",
+ bundleName, "testRequest.soap");
+ System.out.println(response);
+ assertTrue(response.contains("helloResponse") && response.contains("Hello World"));
+ } finally {
+ server.undeployProcess(bundleName);
+ }
+ }
+}
\ No newline at end of file
Added: ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartPolicyTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartPolicyTest.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartPolicyTest.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/RampartPolicyTest.java Sat Oct 25 10:38:22 2008
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.ode.axis2;
+
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.io.FileFilter;
+
+/**
+ *
+ *
+ */
+public class RampartPolicyTest extends Axis2TestBase {
+
+ @DataProvider(name = "bundles")
+ public Object[][] testPolicySamples() throws Exception {
+ File[] policies = new File(getClass().getClassLoader().getResource("TestRampartPolicy").getFile()).listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname.isDirectory() && pathname.getName().matches("process-policy-sample\\d*");
+ }
+ });
+ Object[][] bundles = new Object[policies.length][];
+ for (int i = 0; i < policies.length; i++) {
+ bundles[i] = new Object[]{"TestRampartPolicy/" + policies[i].getName()};
+ }
+ return bundles;
+ }
+
+
+ @BeforeClass
+ protected void setUp() throws Exception {
+ // mind the annotation above also
+ startServer("TestRampartPolicy", "webapp/WEB-INF/conf/axis2.xml");
+ }
+
+ @AfterClass
+ protected void tearDown() throws Exception {
+ // simply change the annotation, see above
+ super.tearDown();
+ }
+
+ @Test(dataProvider = "bundles")
+ public void executeProcess(String bundleName) throws Exception {
+ if (server.isDeployed(new File(bundleName).getName())) {
+ server.undeployProcess(bundleName);
+ }
+ server.deployProcess(bundleName);
+ try {
+ String response = server.sendRequestFile("http://localhost:8888/processes/helloWorld",
+ bundleName, "testRequest.soap");
+ System.out.println(response);
+ assertTrue(response.contains("helloResponse") && response.contains("Hello World"));
+ } finally {
+ server.undeployProcess(bundleName);
+ }
+ }
+}
Added: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample01/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample01/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample01/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample01/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -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.policy.sample01;
+
+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("alice") && 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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample02/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample02/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample02/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample02/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -0,0 +1,42 @@
+/*
+ * 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.policy.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("client".equals(id)) {
+ pwcb.setPassword("apache");
+ } else if("service".equals(id)) {
+ pwcb.setPassword("apache");
+ }
+ }
+ }
+
+}
Added: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample03/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample03/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample03/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample03/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -0,0 +1,42 @@
+/*
+ * 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.policy.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++) {
+ 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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample04/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample04/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample04/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample04/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -0,0 +1,42 @@
+/*
+ * 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.policy.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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample05/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample05/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample05/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/policy/sample05/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -0,0 +1,42 @@
+/*
+ * 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.policy.sample05;
+
+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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample02/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample02/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample02/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample02/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample03/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample03/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample03/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample03/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -0,0 +1,51 @@
+/*
+ * 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")) {
+ //If authentication successful, simply return
+ 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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample04/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample04/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample04/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample04/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample05/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample05/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample05/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample05/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -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.sample05;
+
+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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample06/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample06/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample06/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample06/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -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.sample06;
+
+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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample07/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample07/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample07/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample07/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -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.sample07;
+
+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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample08/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample08/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample08/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample08/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -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.sample08;
+
+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: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample09/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample09/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample09/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample09/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -0,0 +1,50 @@
+/*
+ * 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.sample09;
+
+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 {
+
+ private static final byte[] key = {
+
+ (byte) 0x31, (byte) 0xfd, (byte) 0xcb, (byte) 0xda, (byte) 0xfb,
+
+ (byte) 0xcd, (byte) 0x6b, (byte) 0xa8, (byte) 0xe6, (byte) 0x19,
+
+ (byte) 0xa7, (byte) 0xbf, (byte) 0x51, (byte) 0xf7, (byte) 0xc7,
+
+ (byte) 0x3e };
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pwcb = (WSPasswordCallback) callbacks[i];
+
+ if (pwcb.getUsage() == WSPasswordCallback.KEY_NAME) {
+ pwcb.setKey(key);
+ }
+ }
+ }
+
+}
Added: ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample10/PWCBHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample10/PWCBHandler.java?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample10/PWCBHandler.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/rampart/samples/sample10/PWCBHandler.java Sat Oct 25 10:38:22 2008
@@ -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.sample10;
+
+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: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample02.txt
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample02.txt?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample02.txt (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample02.txt Sat Oct 25 10:38:22 2008
@@ -0,0 +1,10 @@
+UsernameToken authentication
+
+The client is configured to add a UsernameToken to the outgoing message.
+ - See the "OutflowSecurity" parameter in the client.axis2.xml
+
+The service is configured to process it.
+ - See the "InflowSecurity" parameter in the services.xml
+
+Note how org.apache.rampart.samples.sample02.PWCBHandler supplies the password
+to wss4j to compute the digest for comparison.
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample03.txt
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample03.txt?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample03.txt (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample03.txt Sat Oct 25 10:38:22 2008
@@ -0,0 +1,12 @@
+UsernameToken authentication with a plain text password
+
+The client is configured to add a UsernameToken to the outgoing message.
+ - See the "OutflowSecurity" parameter in the client.axis2.xml
+ - Note the <passwordType>PasswordText</passwordType> element
+
+The service is configured to process it.
+ - See the "InflowSecurity" parameter in the services.xml
+
+Note how org.apache.rampart.samples.sample03.PWCBHandler authenticates the
+password
+
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample04.txt
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample04.txt?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample04.txt (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample04.txt Sat Oct 25 10:38:22 2008
@@ -0,0 +1,7 @@
+Message integrity and non-repudiation with signature
+
+Both client and servce are configured to sign the outgoing message and to verify
+the signature of the incoming message using their key pairs.
+ - See the "OutflowSecurity" and "InflowSecurity" parameters in the
+ client.axis2.xml and serivces.xml files
+
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample05.txt
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample05.txt?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample05.txt (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample05.txt Sat Oct 25 10:38:22 2008
@@ -0,0 +1,7 @@
+Encrypting messages
+
+Both client and servce are configured to encrypt the outgoing message and to
+decrypt incoming message using their key pairs.
+ - See the "OutflowSecurity" and "InflowSecurity" parameters in the
+ client.axis2.xml and serivces.xml files
+
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample06.txt
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample06.txt?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample06.txt (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample06.txt Sat Oct 25 10:38:22 2008
@@ -0,0 +1,8 @@
+Sign and encrypt messages
+
+Both client and servce are configured to first sign and then encrypt the
+outgoing message and to decrypt and verify the incoming message using their
+key pairs.
+ - See the "OutflowSecurity" and "InflowSecurity" parameters in the
+ client.axis2.xml and serivces.xml files
+
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample07.txt
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample07.txt?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample07.txt (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample07.txt Sat Oct 25 10:38:22 2008
@@ -0,0 +1,8 @@
+Encrypt and sign messages
+
+Both client and servce are configured to first encrypt and then sign the
+outgoing message and to verify and decrypt the incoming message using their
+key pairs.
+ - See the "OutflowSecurity" and "InflowSecurity" parameters in the
+ client.axis2.xml and serivces.xml files
+
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample08.txt
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample08.txt?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample08.txt (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample08.txt Sat Oct 25 10:38:22 2008
@@ -0,0 +1,10 @@
+Signing twice
+
+The client is configured to sign the outgoing message twice
+ - See the "OutflowSecurity" parameter in the client.axis2.xml
+ - Note the aditional <action> element that defines the second signature.
+
+The service is configured to process it.
+ - See the "InflowSecurity" parameter in the services.xml. Not that we
+ simply use "Signature Signature" as action items.
+
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample09.txt
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample09.txt?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample09.txt (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample09.txt Sat Oct 25 10:38:22 2008
@@ -0,0 +1,8 @@
+Encryption with a key known to both parties
+
+Both client and servce are configured to encrypt the outgoing message and to
+decrypt incoming message using a known named key
+ - See the "OutflowSecurity" and "InflowSecurity" parameters in the
+ client.axis2.xml and serivces.xml files
+ - Note the use of <EmbeddedKeyName>SessionKey</EmbeddedKeyName>
+ - Note that org.apache.rampart.samples.sample09.PWCBHandler sets the key
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample10.txt
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample10.txt?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample10.txt (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/README-sample10.txt Sat Oct 25 10:38:22 2008
@@ -0,0 +1,8 @@
+Sign and encrypt messages
+
+Both client and servce are configured to first sign and then encrypt the
+outgoing message and to decrypt and verify the incoming message using their
+key pairs.
+ - See the "OutflowSecurity" and "InflowSecurity" parameters in the
+ client.axis2.xml and serivces.xml files
+ - Note the use of <optimizeParts>[xpath expression]</optimizeParts>
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.jks
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.jks?rev=707868&view=auto
==============================================================================
Files ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.jks (added) and ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.jks Sat Oct 25 10:38:22 2008 differ
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.properties
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.properties?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.properties (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/client.properties Sat Oct 25 10:38:22 2008
@@ -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=TestRampartBasic/client.jks
\ No newline at end of file
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.bpel
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.bpel?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.bpel (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.bpel Sat Oct 25 10:38:22 2008
@@ -0,0 +1,73 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+<process name="HelloWorld2"
+ targetNamespace="http://ode/bpel/unit-test"
+ xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+ xmlns:tns="http://ode/bpel/unit-test"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:test="http://ode/bpel/unit-test.wsdl"
+ xmlns:dummy="{sample.namespace}"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="HelloWorld2.wsdl"
+ namespace="http://ode/bpel/unit-test.wsdl"
+ importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloPartnerLink"
+ partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
+ <partnerLink name="samplePartnerLink"
+ partnerLinkType="test:samplePartnerLinkType" partnerRole="you" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar" messageType="test:HelloMessage"/>
+ <variable name="req" messageType="dummy:echoRequest"/>
+ <variable name="resp" messageType="dummy:echoResponse"/>
+ </variables>
+
+ <sequence>
+ <receive name="start" partnerLink="helloPartnerLink" portType="test:HelloPortType"
+ operation="hello" variable="myVar" createInstance="yes"/>
+
+ <assign>
+ <copy>
+ <from><literal><dummy:echo><dummy:param0>foo</dummy:param0></dummy:echo></literal></from>
+ <to>$req.parameters</to>
+ </copy>
+ <copy>
+ <from>$myVar.TestPart</from>
+ <to>$req.parameters/dummy:param0</to>
+ </copy>
+ </assign>
+
+ <invoke partnerLink="samplePartnerLink" portType="dummy:{sample.service.name}PortType"
+ operation="echo" inputVariable="req" outputVariable="resp"/>
+
+ <assign>
+ <copy>
+ <from>$resp.parameters/dummy:return</from>
+ <to>$myVar.TestPart</to>
+ </copy>
+ </assign>
+ <reply name="end" partnerLink="helloPartnerLink" portType="test:HelloPortType"
+ operation="hello" variable="myVar"/>
+ </sequence>
+</process>
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.wsdl
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.wsdl?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.wsdl (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/HelloWorld2.wsdl Sat Oct 25 10:38:22 2008
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<wsdl:definitions
+ targetNamespace="http://ode/bpel/unit-test.wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://ode/bpel/unit-test.wsdl"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:dummy="{sample.namespace}"
+ xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:import namespace="{sample.namespace}" location="echo-service.wsdl"/>
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part name="TestPart" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage" name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+ namespace="http://ode/bpel/unit-test.wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+ namespace="http://ode/bpel/unit-test.wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+ <soap:address location="http://localhost:8080/ode/processes/helloWorld"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
+ <plnk:partnerLinkType name="samplePartnerLinkType">
+ <plnk:role name="you" portType="dummy:{sample.service.name}PortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/deploy.xml
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/deploy.xml?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/deploy.xml (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/deploy.xml Sat Oct 25 10:38:22 2008
@@ -0,0 +1,34 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+ xmlns:pns="http://ode/bpel/unit-test"
+ xmlns:wns="http://ode/bpel/unit-test.wsdl"
+ xmlns:dns="{sample.namespace}">
+
+
+ <process name="pns:HelloWorld2">
+ <active>true</active>
+ <provide partnerLink="helloPartnerLink">
+ <service name="wns:HelloService" port="HelloPort"/>
+ </provide>
+ <invoke partnerLink="samplePartnerLink">
+ <service name="dns:{sample.service.name}" port="{sample.service.name}SOAP11port_http"/>
+ </invoke>
+ </process>
+</deploy>
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/echo-service.wsdl
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/echo-service.wsdl?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/echo-service.wsdl (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/echo-service.wsdl Sat Oct 25 10:38:22 2008
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:ns0="{sample.namespace}"
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:ns1="http://org.apache.axis2/xsd"
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ targetNamespace="{sample.namespace}">
+ <wsdl:types>
+ <xs:schema xmlns:ns="{sample.namespace}"
+ attributeFormDefault="qualified"
+ elementFormDefault="qualified"
+ targetNamespace="{sample.namespace}">
+ <xs:element name="echo">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="param0" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="echoResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="echoRequest">
+ <wsdl:part name="parameters" element="ns0:echo"/>
+ </wsdl:message>
+ <wsdl:message name="echoResponse">
+ <wsdl:part name="parameters" element="ns0:echoResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="{sample.service.name}PortType">
+ <wsdl:operation name="echo">
+ <wsdl:input message="ns0:echoRequest" wsaw:Action="urn:echo"/>
+ <wsdl:output message="ns0:echoResponse" wsaw:Action="urn:echoResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="{sample.service.name}SOAP11Binding" type="ns0:{sample.service.name}PortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="echo">
+ <soap:operation soapAction="urn:echo" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="{sample.service.name}">
+ <wsdl:port name="{sample.service.name}SOAP11port_http" binding="ns0:{sample.service.name}SOAP11Binding">
+ <soap:address location="http://localhost:8888/axis2/processes/{sample.service.name}"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
Added: ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/testRequest.soap
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/testRequest.soap?rev=707868&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/testRequest.soap (added)
+++ ode/trunk/axis2-war/src/test/resources/TestRampartBasic/process-template/testRequest.soap Sat Oct 25 10:38:22 2008
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+ <!-- test soap message -->
+ <SOAP-ENV:Body>
+ <ns1:hello xmlns:ns1="http://ode/bpel/unit-test.wsdl">
+ <TestPart xmlns="">Hello World</TestPart>
+ </ns1:hello>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>