Author: muthulee
Date: Tue Jul 10 19:33:25 2007
New Revision: 555143

URL: http://svn.apache.org/viewvc?view=rev&rev=555143
Log:
Adding a sample for Username token over HTTPS.
This sample uses tomcat.


Added:
    webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/README
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/build.xml
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/policy.xml
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/services.xml
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/Client.java
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/PWCBHandler.java
    
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/SimpleService.java

Added: 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/README
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/README?view=auto&rev=555143
==============================================================================
--- 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/README
 (added)
+++ 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/README
 Tue Jul 10 19:33:25 2007
@@ -0,0 +1,37 @@
+********************************************************************************
+**************************** Apache Rampart Tomcat Samples 
*********************
+********************************************************************************
+
+UsernameToken Authentication over HTTPS.
+
+Step1: Install Axis2 in Tomcat by reading the Axis2 installation guide 
available in http://ws.apache.org/axis2/. Then test axis2 in Tomcat.
+
+Step2: Copy Rampart jars and mars by executing the ../../build.xml file.
+
+Step3: Copy keystores into Tomcat by giving the following command in this 
directory.
+$ant copy.keys
+
+Step4: Copy rampart jars and mars into Tomcat by giving the following command 
in this directory.
+$ant copy.rampart.to.tomcat
+       
+Step5: Enable HTTPS on Tomcat. For Tomcat5 uncomment the "SSL HTTP/1.1 
Connector". The default HTTPS port for Tomcat is 8443. For more information 
"http://tomcat.apache.org/tomcat-5.0-doc/ssl-howto.html";
+
+Step6: Add the key store information by adding the following into the 
Connector element in server.xml.
+
+truststoreFile="rampart-sample-keys.jks"
+truststorePass="apache"
+truststoreType="JKS"
+keystoreFile="rampart-sample-keys.jks"
+keystorePass="apache"
+
+Start tomcat and check the service by typing 
"https://127.0.0.1:8443/axis2/services/listServices"; in the browser. If you 
have changed the SSL port then type the correct port number and please change 
the build.xml's ssl.port accordingly.
+
+Step7: The following command will copy the ut-over-https.aar into the 
${CATALINA_HOME}/webapps/axis2/WEB-INF/services/ut-over-https.aar
+$ant create.and.copy.service
+
+Step8: Start tomcat. View https://127.0.0.1:8443/axis2/services/listServices 
to see wether the service is available.
+
+Step9: The following command will create and run the client.
+$ant create.and.run.client
+
+

Added: 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/build.xml
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/build.xml?view=auto&rev=555143
==============================================================================
--- 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/build.xml
 (added)
+++ 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/build.xml
 Tue Jul 10 19:33:25 2007
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ !
+ ! Copyright 2006 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.
+ !-->
+
+<project basedir="." default="clean">
+
+       <property name="client.repos.dir" value="build/client_repository"/>
+       <property name="service.dir" value="build/ut-over-https"/>
+       <property name="temp.dir" value="build"/>
+       <property name="keys.dir" value="../../keys"/>
+       <property name="temp.client.dir" value="build/temp_client"/>
+
+       <property name="addressing.mar" value="addressing-1.2.mar"/>
+       <property name="rampart.mar" value="rampart-SNAPSHOT.mar"/>
+       
+       <property name="ssl.port" value="8443"/>
+       <!--can be removed-->
+       <property name="sample.services.url" 
value="https://localhost:${ssl.port}/axis2/services"/>
+       
+       <property environment="env"/>
+       
+       <target name="check.tomcat" unless="env.CATALINA_HOME">
+               <echo message="CATALINA_HOME must be set"/>
+       </target>
+
+       <target name="check.axis2" unless="env.AXIS2_HOME">
+               <echo message="AXIS2_HOME must be set"/>
+       </target>
+       
+       <target name="copy.keys" depends="check.tomcat">
+               <copy file="${keys.dir}/service.jks" 
tofile="${env.CATALINA_HOME}/rampart-sample-keys.jks" overwrite="true"/>
+       </target>
+
+       <target name="copy.rampart.to.tomcat" 
depends="check.tomcat,check.axis2">
+               <property name="to.modules.dir" 
value="${env.CATALINA_HOME}/webapps/axis2/WEB-INF/modules"/>
+               <property name="to.lib.dir" 
value="${env.CATALINA_HOME}/webapps/axis2/WEB-INF/lib"/>
+
+               <property name="from.modules.dir" 
value="${env.AXIS2_HOME}/repository/modules/"/>
+               <property name="from.lib.dir" value="${env.AXIS2_HOME}/lib"/>
+               
+               
+               <copy todir="${to.lib.dir}">
+               <fileset dir="${from.lib.dir}">
+                       <include name="**/*.jar"/>
+               </fileset>
+               </copy>
+               
+               <copy todir="${to.modules.dir}">
+               <fileset dir="${from.modules.dir}">
+                       <include name="**/*.mar"/>
+               </fileset>
+               </copy>
+                       
+               <!-- copy modules rampart mar and libs xx-->
+        </target>
+
+       <target name="clean">
+               <delete dir="build" />
+       </target>
+       
+       <!-- Macro to create a service repo for a given sample -->
+       <target name="create.and.copy.service" depends="check.tomcat,clean">
+               
+               <property name="lib.dir" value="${env.AXIS2_HOME}/lib"/>
+               <mkdir dir="${temp.dir}"/>
+
+               <!-- create service -->
+               <mkdir dir="${service.dir}"/>
+               <mkdir dir="${service.dir}/META-INF"/>
+               
+               <!-- Compile service -->
+               <javac srcdir="src" destdir="${service.dir}">
+                    <classpath>
+                            <fileset dir="${lib.dir}">
+                                    <include name="**/*.jar"/>
+                            </fileset>
+                    </classpath>
+                    <exclude name="**/Client.java"/>
+               </javac>
+                       
+               <copy file="services.xml" 
tofile="${service.dir}/META-INF/services.xml" overwrite="true"/>
+               <jar destfile="${temp.dir}/ut-over-https.aar">
+                       <fileset dir="${service.dir}"></fileset>
+               </jar>
+
+               <copy file="${temp.dir}/ut-over-https.aar" 
tofile="${env.CATALINA_HOME}/webapps/axis2/WEB-INF/services/ut-over-https.aar" 
overwrite="true"/>
+                       
+       </target>
+
+       <target name="create.and.run.client" 
depends="check.tomcat,check.axis2,clean">
+       
+               <property name="from.modules" 
value="${env.AXIS2_HOME}/repository/modules/"/>
+               <property name="lib.dir" value="${env.AXIS2_HOME}/lib"/>
+               
+               <mkdir dir="${temp.dir}"/>  
+               <mkdir dir="${temp.client.dir}"/>               
+
+               <!-- Create the client repo -->
+               <mkdir dir="${client.repos.dir}"/>
+               <mkdir dir="${client.repos.dir}/conf"/>
+               <mkdir dir="${client.repos.dir}/modules"/>
+                       
+               <!-- copy modules -->
+               <copy file="${from.modules}/${addressing.mar}" 
tofile="${client.repos.dir}/modules/${addressing.mar}" overwrite="true"/>
+               <copy file="${from.modules}/${rampart.mar}" 
tofile="${client.repos.dir}/modules/${rampart.mar}" overwrite="true"/>
+                       
+               <!-- Compile client -->
+               <javac srcdir="src" destdir="${temp.client.dir}">
+                    <classpath>
+                           <fileset dir="${lib.dir}">
+                            <include name="**/*.jar"/>
+                           </fileset>
+                    </classpath>
+                    <exclude name="**/SimpleService.java"/>
+               </javac>
+
+               <copy file="${keys.dir}/client.jks" 
tofile="${temp.client.dir}/client.jks" overwrite="true"/>
+               <copy file="policy.xml" tofile="${temp.client.dir}/policy.xml" 
overwrite="true"/>
+
+               <!-- Run client -->
+               <java classname="org.apache.rampart.tomcat.sample.Client" 
fork="true">
+                    <arg value="${sample.services.url}"/>
+                    <arg value="${client.repos.dir}"/>
+                    <arg value="policy.xml"/>
+                    <classpath>
+                        <fileset dir="${lib.dir}">
+                               <include name="**/*.jar"/>
+                        </fileset>
+                               <dirset dir="${temp.client.dir}" />
+                    </classpath>
+               </java>
+       </target>
+
+</project>

Added: 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/policy.xml
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/policy.xml?view=auto&rev=555143
==============================================================================
--- 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/policy.xml
 (added)
+++ 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/policy.xml
 Tue Jul 10 19:33:25 2007
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy wsu:Id="UTOverTransport" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
 xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";>
+       <wsp:ExactlyOne>
+         <wsp:All>
+               <sp:TransportBinding 
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
+                 <wsp:Policy>
+                       <sp:TransportToken>
+                         <wsp:Policy>
+                               <sp:HttpsToken 
RequireClientCertificate="false"/>
+                         </wsp:Policy>
+                       </sp:TransportToken>
+                       <sp:AlgorithmSuite>
+                         <wsp:Policy>
+                               <sp:Basic256/>
+                         </wsp:Policy>
+                       </sp:AlgorithmSuite>
+                       <sp:Layout>
+                         <wsp:Policy>
+                               <sp:Lax/>
+                         </wsp:Policy>
+                       </sp:Layout>
+                       <sp:IncludeTimestamp/>
+                 </wsp:Policy>
+               </sp:TransportBinding>
+               <sp:SignedSupportingTokens 
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
+                       <wsp:Policy>
+                               <sp:UsernameToken 
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient";
 />
+                 </wsp:Policy>
+               </sp:SignedSupportingTokens>
+               
+               <ramp:RampartConfig 
xmlns:ramp="http://ws.apache.org/rampart/policy";> 
+                       <ramp:user>alice</ramp:user>
+                       
<ramp:passwordCallbackClass>org.apache.rampart.tomcat.sample.PWCBHandler</ramp:passwordCallbackClass>
+                       <ramp:sslConfig> 
+                               <ramp:property 
name="javax.net.ssl.trustStore">client.jks</ramp:property>
+                               <ramp:property 
name="javax.net.ssl.trustStorePassword">apache</ramp:property> 
+                       </ramp:sslConfig>
+               </ramp:RampartConfig>
+               
+         </wsp:All>
+       </wsp:ExactlyOne>
+</wsp:Policy>

Added: 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/services.xml
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/services.xml?view=auto&rev=555143
==============================================================================
--- 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/services.xml
 (added)
+++ 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/services.xml
 Tue Jul 10 19:33:25 2007
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ !
+ ! Copyright 2006 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.
+ !-->
+<!-- services.xml of sample-1 : UsernameToken-->
+<service>
+       <operation name="echo">
+               <messageReceiver 
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+       </operation>    
+       <parameter name="ServiceClass" 
locked="false">org.apache.rampart.tomcat.sample.SimpleService</parameter>
+       
+       <module ref="rampart" />
+       <module ref="addressing" />
+
+       <wsp:Policy wsu:Id="UTOverTransport" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
 xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";>
+               <wsp:ExactlyOne>
+                 <wsp:All>
+                       <sp:TransportBinding 
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
+                         <wsp:Policy>
+                               <sp:TransportToken>
+                                 <wsp:Policy>
+                                       <sp:HttpsToken 
RequireClientCertificate="false"/>
+                                 </wsp:Policy>
+                               </sp:TransportToken>
+                               <sp:AlgorithmSuite>
+                                 <wsp:Policy>
+                                       <sp:Basic256/>
+                                 </wsp:Policy>
+                               </sp:AlgorithmSuite>
+                               <sp:Layout>
+                                 <wsp:Policy>
+                                       <sp:Lax/>
+                                 </wsp:Policy>
+                               </sp:Layout>
+                               <sp:IncludeTimestamp/>
+                         </wsp:Policy>
+                       </sp:TransportBinding>
+                       <sp:SignedSupportingTokens 
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
+                               <wsp:Policy>
+                                       <sp:UsernameToken 
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient";
 />
+                         </wsp:Policy>
+                       </sp:SignedSupportingTokens>
+                       
+                       <ramp:RampartConfig 
xmlns:ramp="http://ws.apache.org/rampart/policy";> 
+                               
<ramp:passwordCallbackClass>org.apache.rampart.tomcat.sample.PWCBHandler</ramp:passwordCallbackClass>
+                       </ramp:RampartConfig>
+                       
+                 </wsp:All>
+               </wsp:ExactlyOne>
+       </wsp:Policy>
+
+</service>

Added: 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/Client.java
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/Client.java?view=auto&rev=555143
==============================================================================
--- 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/Client.java
 (added)
+++ 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/Client.java
 Tue Jul 10 19:33:25 2007
@@ -0,0 +1,80 @@
+/*
+ * 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.tomcat.sample;
+
+import java.util.Iterator;
+import java.util.List;
+
+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.axiom.om.impl.builder.StAXOMBuilder;
+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;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyEngine;
+import org.apache.rampart.RampartMessageData;
+
+import javax.xml.namespace.QName;
+
+public class Client {
+
+    public static void main(String[] args) throws Exception {
+        
+        if(args.length != 3) {
+            System.out.println("Usage: $java Client endpoint_address 
client_repo_path policy_xml_path");
+        }
+        
+       ConfigurationContext ctx = 
ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], 
null);
+        
+        ServiceClient client = new ServiceClient(ctx, null);
+        Options options = new Options();
+        options.setAction("urn:echo");
+        options.setTo(new EndpointReference(args[0]));
+        options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, 
loadPolicy(args[2]));
+        client.setOptions(options);
+        
+        client.engageModule("addressing");
+        client.engageModule("rampart");        
+        OMElement response = client.sendReceive(getPayload("Hello world"));
+        
+        System.out.println(response);
+        
+    }
+    
+    private static Policy loadPolicy(String xmlPath) throws Exception {
+        StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
+        OMElement elem = builder.getDocumentElement();
+        return PolicyEngine.getPolicy(builder.getDocumentElement());
+    }
+    
+    private static OMElement getPayload(String value) {
+        OMFactory factory = OMAbstractFactory.getOMFactory();
+        OMNamespace ns = 
factory.createOMNamespace("http://sample.tomcat.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/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/PWCBHandler.java
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/PWCBHandler.java?view=auto&rev=555143
==============================================================================
--- 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/PWCBHandler.java
 (added)
+++ 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/PWCBHandler.java
 Tue Jul 10 19:33:25 2007
@@ -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.tomcat.sample;
+
+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: 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/SimpleService.java
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/SimpleService.java?view=auto&rev=555143
==============================================================================
--- 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/SimpleService.java
 (added)
+++ 
webservices/rampart/trunk/java/modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/SimpleService.java
 Tue Jul 10 19:33:25 2007
@@ -0,0 +1,28 @@
+/*
+ * 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.tomcat.sample;
+
+import java.io.File;
+import java.io.FileOutputStream;
+
+public class SimpleService {
+    
+    public String echo(String arg) throws Exception {
+               System.out.println("Tomcat service accessed successfully.. :)");
+        return arg;
+    }
+}


Reply via email to