You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sv...@apache.org on 2008/01/23 12:36:18 UTC

svn commit: r614501 - in /incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp: ./ src/ src/main/ src/main/java/ src/main/java/calculator/ src/main/java/calculator/security/ src/main/resources/ src/main/webapp/ src/main/webapp/META-INF/ src/m...

Author: svkrish
Date: Wed Jan 23 03:36:13 2008
New Revision: 614501

URL: http://svn.apache.org/viewvc?rev=614501&view=rev
Log:
adding ws secure webapp version

Added:
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/README
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/build.xml
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/calculator-web.png   (with props)
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/calculator-web.svg
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/pom.xml
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddService.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddServiceImpl.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorClient.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorService.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorServiceImpl.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideService.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideServiceImpl.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyService.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyServiceImpl.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractService.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractServiceImpl.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ClientPWCBHandler.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ServerPWCBHandler.java
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/Calculator.composite
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/definitions.xml
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/META-INF/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/web.xml
    incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/calc.jsp

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/README
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/README?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/README (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/README Wed Jan 23 03:36:13 2008
@@ -0,0 +1,108 @@
+Calculator Sample Exposing Web Services In A WebApp
+===================================================
+This sample uses the same code as the calculator sample, it deploys the
+sample wrapped in a web app and exposes the AddService as a web service. 
+
+The README in the samples directory (the directory above this) provides 
+general instructions about building and running samples. Take a look there 
+first. 
+
+As this sample provides a web app there is a manual step where the WAR file
+that contains the sample is copied to your web app container. If you just want 
+to give this sample a go deploy the WAR file (target/sample-calculator-ws-webapp.war)
+to you web application server. 
+  
+Once the web app is deployed use your browser to visit the following URL;
+
+http://localhost:8080/sample-calculator-ws-webapp
+
+The sample is configured to use a service on port 8080. If your servlet container
+is using a port other than 8080 then you will need to edit the Calculator.composite
+and change the uri attribute of the <binding.ws> used by the CalculatorServiceComponent
+to use the correct port.
+
+Sample Overview
+---------------
+The sample provides a single calculator service with a default SCA (java) 
+binding. The CalculatorClient exercises this interface by calling add, 
+subtract, multiply and divide operations. This results in messages passing to 
+the appropriate components in the composite.
+
+calculator-webapp/
+  src/
+    main/
+      java/
+        calculator/
+          AddService.java         - As calculator sample
+          AddServiceImpl.java
+          CalculatorClient.java   - As calculator sample
+          CalculatorService.java  - As calculator sample
+          CalculatorServiceImpl.java
+          DivideService.java      - As calculator sample
+          DivideServiceImpl.java
+          MultiplyService.java    - As calculator sample
+          MultiplyServiceImpl.java
+          SubtractService.java    - As calculator sample
+          SubtractServiceImpl.java
+      resources/
+        Calculator.composite      - As calculator sample except that the 
+                                    connection between the CalculatorService
+                                    and the AddService is web services
+      webapp
+        META-INF/
+          sca-contribution.xml    - specifies the composite to be deployed
+        WEB-INF/
+          web.xml                 - defines the listener that starts up the 
+                                    Tuscany SCA runtime and maps service
+                                    calls to the TuscanyServlet
+        calc.jsp                  - the web application that makes use of the
+                                    SCA application 
+           
+  calculator.png - a pictorial representation of the sample .composite file
+  build.xml      - the Ant build file
+  pom.xml        - the Maven build file
+  README         - this file  
+
+Building And Running The Sample Using Ant
+-----------------------------------------
+With the binary distribution the sample can be built using Ant as 
+follows
+
+cd calculator-ws-webapp
+ant package
+
+This should result in a war file (sample-calculator-ws-webapp.war) in the target 
+directory. Copy this war file to your web app deployment directory in you
+web app container. 
+
+The process for getting the web app running will depend on which web app container
+you are using. For example, if you are using Tomcat then it is simply a matter
+of copying the WAR file to the webapps directory. 
+
+Once the web app is deployed use your browser to visit the following URL;
+
+http://localhost:8080/sample-calculator-ws-webapp
+
+The port and hostname will of course vary depending on your local installation. 
+
+You should see the following output.
+
+Expression	Result
+2 + 3	5.0
+3 - 2	1.0
+3 * 2	6.0
+3 / 2	1.5
+
+Building And Running The Sample Using Maven 
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run 
+using Maven as follows. 
+
+cd calculator-ws-webapp 
+mvn
+
+Again this should result in a war file (sample-calculator-ws-webapp.war) in the target 
+directory. Follow the steps described in the previous section for running the web 
+app and for the expected results.
+
+

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/build.xml?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/build.xml (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/build.xml Wed Jan 23 03:36:13 2008
@@ -0,0 +1,156 @@
+<!--
+ * 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.
+-->
+
+<project name="sample-calculator-ws-secure-webapp" default="compile">
+
+    <target name="compile">
+        <mkdir dir="target/classes"/>
+        <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+            <src path="src\main\java"/>
+            <classpath>
+                <fileset refid="tuscany.jars"/>
+                <fileset refid="3rdparty.jars"/>
+            </classpath>
+        </javac>
+        <copy todir="target/classes">
+            <fileset dir="src\main\resources"/>
+            <fileset dir="." includes="*" excludes="src, target, pom.xml, build.xml"/>
+        </copy>
+        <war destfile="target/sample-calculator-ws-secure-webapp.war" webxml="src/main/webapp/WEB-INF/web.xml">
+            <fileset dir="src/main/webapp"/>
+            <lib refid="tuscany.jars"/>
+            <lib refid="3rdparty.jars"/>
+            <classes dir="target/classes"/>
+        </war>
+    </target>
+
+    <target name="package" depends="compile"/>
+
+    <target name="clean">
+        <delete includeemptydirs="true">
+            <fileset dir="target"/>
+        </delete>
+    </target>
+
+    <fileset id="tuscany.jars" dir="../../modules">
+        <include name="tuscany-assembly-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-assembly-xml-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-assembly-xsd-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-binding-sca-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-binding-sca-xml-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-binding-ws-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-binding-ws-axis2-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-binding-ws-xml-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-impl-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-java-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-namespace-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-core-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-core-databinding-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-core-spi-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-databinding-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-databinding-axiom-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-databinding-jaxb-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-definitions-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-definitions-xml-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-domain-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-domain-api-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-host-embedded-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-host-http-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-host-webapp-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-implementation-java-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-implementation-java-runtime-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-implementation-java-xml-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-java-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-java-xml-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-wsdl-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-wsdl-java2wsdl-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-wsdl-xml-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-node-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-node-api-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-policy-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-policy-logging-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-policy-security-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-policy-xml-1.2-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-sca-api-1.2-incubating-SNAPSHOT.jar"/>
+    </fileset>
+    <fileset id="3rdparty.jars" dir="../../lib">
+        <include name="XmlSchema-1.3.2.jar"/>
+        <include name="activation-1.1.jar"/>
+        <include name="annogen-0.1.0.jar"/>
+        <include name="avalon-framework-4.1.3.jar"/>
+        <include name="axiom-api-1.2.5.jar"/>
+        <include name="axiom-dom-1.2.5.jar"/>
+        <include name="axiom-impl-1.2.5.jar"/>
+        <include name="axis2-adb-1.3.jar"/>
+        <include name="axis2-adb-codegen-1.3.jar"/>
+        <include name="axis2-codegen-1.3.jar"/>
+        <include name="axis2-java2wsdl-1.3.jar"/>
+        <include name="axis2-kernel-1.3.jar"/>
+        <include name="axis2-mtompolicy-1.3.jar"/>
+        <include name="backport-util-concurrent-2.2.jar"/>
+        <include name="bcprov-jdk15-132.jar"/>
+        <include name="cglib-nodep-2.1_3.jar"/>
+        <include name="commons-codec-1.3.jar"/>
+        <include name="commons-collections-3.1.jar"/>
+        <include name="commons-discovery-0.2.jar"/>
+        <include name="commons-fileupload-1.1.1.jar"/>
+        <include name="commons-httpclient-3.0.1.jar"/>
+        <include name="commons-io-1.2.jar"/>
+        <include name="commons-logging-1.1.jar"/>
+        <include name="dom4j-1.6.1.jar"/>
+        <include name="geronimo-activation_1.1_spec-1.0-M1.jar"/>
+        <include name="geronimo-commonj_1.1_spec-1.0.jar"/>
+        <include name="geronimo-javamail_1.4_spec-1.0-M1.jar"/>
+        <include name="geronimo-jms_1.1_spec-1.1.jar"/>
+        <include name="httpcore-4.0-alpha5.jar"/>
+        <include name="httpcore-nio-4.0-alpha5.jar"/>
+        <include name="httpcore-niossl-4.0-alpha5.jar"/>
+        <include name="jaxb-api-2.1.jar"/>
+        <include name="jaxb-impl-2.1.6.jar"/>
+        <include name="jaxb2-reflection-2.1.4.jar"/>
+        <include name="jaxen-1.1.1.jar"/>
+        <include name="jaxws-api-2.1.jar"/>
+        <include name="jdom-1.0.jar"/>
+        <include name="jsr173_api-1.0.jar"/>
+        <include name="jsr181-api-1.0-MR1.jar"/>
+        <include name="jsr250-api-1.0.jar"/>
+        <include name="log4j-1.2.12.jar"/>
+        <include name="logkit-1.0.1.jar"/>
+        <include name="mail-1.4.jar"/>
+        <include name="neethi-2.0.2.jar"/>
+        <include name="opensaml-1.1.jar"/>
+        <include name="rampart-core-1.3.jar"/>
+        <include name="rampart-policy-1.3.jar"/>
+        <include name="rampart-trust-1.3.jar"/>
+        <include name="saaj-api-1.3.jar"/>
+        <include name="stax-api-1.0.1.jar"/>
+        <include name="woden-1.0-incubating-M7b.jar"/>
+        <include name="wsdl4j-1.6.2.jar"/>
+        <include name="wss4j-1.5.3.jar"/>
+        <include name="wstx-asl-3.2.1.jar"/>
+        <include name="xalan-2.7.0.jar"/>
+        <include name="xbean-2.1.0.jar"/>
+        <include name="xercesImpl-2.8.1.jar"/>
+        <include name="xml-apis-1.3.03.jar"/>
+        <include name="xmlsec-1.4.0.jar"/>
+    </fileset>
+
+</project>

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/calculator-web.png
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/calculator-web.png?rev=614501&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/calculator-web.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/calculator-web.svg
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/calculator-web.svg?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/calculator-web.svg (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/calculator-web.svg Wed Jan 23 03:36:13 2008
@@ -0,0 +1,455 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ * 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.
+-->
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1052.3622"
+   height="744.09448"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   sodipodi:docbase="C:\simon\tuscany\java-head\sca\samples\calculator-ws-webapp"
+   sodipodi:docname="calculator-web.svg"
+   version="1.0"
+   inkscape:export-filename="C:\simon\Tuscany\java-head\sca\samples\calculator-ws-webapp\calculator-web.png"
+   inkscape:export-xdpi="52.84"
+   inkscape:export-ydpi="52.84"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Lend"
+       style="overflow:visible;">
+      <path
+         id="path4252"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+         transform="scale(0.8) rotate(180) translate(12.5,0)" />
+    </marker>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4"
+     inkscape:cx="330.5192"
+     inkscape:cy="378.84265"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     inkscape:window-width="1054"
+     inkscape:window-height="721"
+     inkscape:window-x="59"
+     inkscape:window-y="79" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <g
+       id="g2997"
+       transform="matrix(1,0,0,1.144214,0,-27.53557)">
+      <rect
+         rx="15.307091"
+         ry="12.692303"
+         y="192.00233"
+         x="258.31146"
+         height="299.99988"
+         width="495.71429"
+         id="rect2067"
+         style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <flowRoot
+         id="flowRoot2954"
+         xml:space="preserve"><flowRegion
+           id="flowRegion2956"><rect
+             y="212.66591"
+             x="281.42856"
+             height="61.42857"
+             width="170"
+             id="rect2958" /></flowRegion><flowPara
+           id="flowPara2960">Calculator</flowPara></flowRoot>    </g>
+    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2988"
+       width="115.66247"
+       height="191.57716"
+       x="339.91632"
+       y="262.1673"
+       rx="6.9961648"
+       ry="15.892869" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot2966"
+       transform="translate(79.61125,62.65764)"><flowRegion
+         id="flowRegion2968"><rect
+           id="rect2970"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara2972">Calculator</flowPara><flowPara
+         id="flowPara1895">Service</flowPara><flowPara
+         id="flowPara1897">Component</flowPara></flowRoot>    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
+       id="path3017" />
+    <path
+       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
+       id="path3019" />
+    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
+       id="path1883" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1885"
+       transform="translate(-46.16225,128.7269)"
+       style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
+         id="flowRegion1887"><rect
+           id="rect1889"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
+         id="flowPara1891">Calculator</flowPara><flowPara
+         id="flowPara1893">Service</flowPara></flowRoot>    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect1899"
+       width="115.66247"
+       height="70.148659"
+       x="594.75488"
+       y="209.73451"
+       rx="6.9961648"
+       ry="5.8193965" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1901"
+       transform="translate(334.4498,10.22481)"><flowRegion
+         id="flowRegion1903"><rect
+           id="rect1905"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara1907">Add</flowPara><flowPara
+         id="flowPara1909">Service</flowPara><flowPara
+         id="flowPara1911">Component</flowPara></flowRoot>    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
+       id="path1913" />
+    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect1917"
+       width="115.66247"
+       height="70.148659"
+       x="594.06543"
+       y="292.59158"
+       rx="6.9961648"
+       ry="5.8193965" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1919"
+       transform="translate(333.7604,93.08188)"><flowRegion
+         id="flowRegion1921"><rect
+           id="rect1923"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara1925">Subtract</flowPara><flowPara
+         id="flowPara1927">Service</flowPara><flowPara
+         id="flowPara1929">Component</flowPara></flowRoot>    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
+       id="path1931" />
+    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect1933"
+       width="115.66247"
+       height="70.148659"
+       x="594.77979"
+       y="371.87729"
+       rx="6.9961648"
+       ry="5.8193965" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1935"
+       transform="translate(334.4747,172.3676)"><flowRegion
+         id="flowRegion1937"><rect
+           id="rect1939"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara1941">Multiply</flowPara><flowPara
+         id="flowPara1943">Service</flowPara><flowPara
+         id="flowPara1945">Component</flowPara></flowRoot>    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
+       id="path1947" />
+    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect1949"
+       width="115.66247"
+       height="70.148659"
+       x="596.20831"
+       y="452.59158"
+       rx="6.9961648"
+       ry="5.8193965" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1951"
+       transform="translate(335.9032,253.0819)"><flowRegion
+         id="flowRegion1953"><rect
+           id="rect1955"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara1957">Divide</flowPara><flowPara
+         id="flowPara1959">Service</flowPara><flowPara
+         id="flowPara1961">Component</flowPara></flowRoot>    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
+       id="path1963" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1965"
+       transform="translate(161.0221,114.967)"
+       style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion1967"><rect
+           id="rect1969"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara1973">add</flowPara><flowPara
+         id="flowPara1977">Service</flowPara></flowRoot>    <path
+       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
+       id="path1979" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1981"
+       transform="translate(160.6632,150.6868)"
+       style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion1983"><rect
+           id="rect1985"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara1987">subtract</flowPara><flowPara
+         id="flowPara1989">Service</flowPara></flowRoot>    <path
+       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
+       id="path1991" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1993"
+       transform="translate(161.3775,184.2583)"
+       style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion1995"><rect
+           id="rect1997"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara1999">multiply</flowPara><flowPara
+         id="flowPara2001">Service</flowPara></flowRoot>    <path
+       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
+       id="path2003" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot2005"
+       transform="translate(159.9489,215.6868)"
+       style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion2007"><rect
+           id="rect2009"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara2011">divide</flowPara><flowPara
+         id="flowPara2013">Service</flowPara></flowRoot>    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:4,1;stroke-dashoffset:0"
+       d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
+       id="path2015" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
+       id="path2017" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
+       id="path2019" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
+       id="path2021" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 292.85714,355.52305 L 330,354.80877"
+       id="path2023" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:#f19a9a;fill-opacity:1;stroke:#2e2424;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:3, 1;stroke-dashoffset:0;stroke-opacity:1"
+       id="path1950"
+       sodipodi:cx="179.28572"
+       sodipodi:cy="352.66592"
+       sodipodi:rx="32.857143"
+       sodipodi:ry="35"
+       d="M 197.59435,323.60313 A 32.857143,35 0 1 1 196.81963,323.06603"
+       sodipodi:start="5.3034219"
+       sodipodi:end="11.558474"
+       sodipodi:open="true"
+       transform="translate(-11.428568,5.714286)" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1952"
+       transform="translate(-134.69216,137.10973)"
+       style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion1954"><rect
+           id="rect1956"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara1960">calc.jsp</flowPara></flowRoot>    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 235,356.23734 C 200.71429,356.23734 200.71429,356.23734 200.71429,356.23734"
+       id="path1972" />
+    <rect
+       style="opacity:0.21666667;fill:#3d2020;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:4, 1;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2246"
+       width="56.428566"
+       height="317.85715"
+       x="57.14286"
+       y="206.95161"
+       rx="4.7646294"
+       ry="7.7766709" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3221"
+       transform="translate(-214.7771,5.7407504)"
+       style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion3223"><rect
+           id="rect3225"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara3227">App</flowPara><flowPara
+         id="flowPara3229">Server</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3231"
+       transform="translate(232.36576,64.312179)"
+       style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion3233"><rect
+           id="rect3235"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara3237">SOAP</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3239"
+       transform="translate(249.50862,136.45504)"
+       style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion3241"><rect
+           id="rect3243"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara3245">local</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3247"
+       transform="translate(247.27783,197.54805)"
+       style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion3249"><rect
+           id="rect3251"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara3253">local</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3255"
+       transform="translate(235.13497,276.11948)"
+       style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion3257"><rect
+           id="rect3259"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara3261">local</flowPara></flowRoot>    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
+       d="M 113.57143,238.80877 L 575.71429,238.80877"
+       id="path3263" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 112.85714,359.09448 C 135.71429,359.09448 135.71429,359.09448 135.71429,359.09448"
+       id="path3265" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
+       d="M 478.57143,334.09448 C 499.28571,291.95163 505.71429,287.66591 498.57143,273.3802 C 491.42857,259.09448 477.85714,254.09448 470.71429,253.3802 C 463.57143,252.66591 14.285714,252.66591 14.285714,252.66591 L 13.571429,234.09448 L 57.857143,234.80877"
+       id="path4244" />
+  </g>
+</svg>

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/pom.xml?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/pom.xml (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/pom.xml Wed Jan 23 03:36:13 2008
@@ -0,0 +1,95 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.2-incubating-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+    <artifactId>sample-calculator-ws-secure-webapp</artifactId>
+    <packaging>war</packaging>
+    <name>Apache Tuscany SCA Calculator Sample Web Service enabled for 
+WS Security and in a WebApp</name>
+
+    <repositories>
+       <repository>
+          <id>apache.incubator</id>
+          <url>http://people.apache.org/repo/m2-incubating-repository</url>
+       </repository>
+    </repositories>
+
+    <dependencies>
+    
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-webapp</artifactId>
+            <version>1.2-incubating-SNAPSHOT</version>
+        </dependency>
+    
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-ws-axis2</artifactId>
+            <version>1.2-incubating-SNAPSHOT</version>
+        </dependency>   
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.2-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <!-- marking dependency as provided to exclude from war file -->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.3</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.2</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+       <plugins>
+            <plugin>
+                <groupId>org.apache.tuscany.sca</groupId>
+                <artifactId>tuscany-maven-ant-generator</artifactId>
+                <version>1.2-incubating-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+       </plugins>       
+    </build>
+</project>

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddService.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddService.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddService.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,31 @@
+/*
+ * 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 calculator;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for the add service
+ */
+@Remotable
+public interface AddService {
+
+    double add(double n1, double n2);
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddServiceImpl.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddServiceImpl.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/AddServiceImpl.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * An implementation of the Add service
+ */
+@Service(AddService.class)
+public class AddServiceImpl implements AddService {
+
+    public double add(double n1, double n2) {
+        System.err.println("********* Adding ***** " + n1 + " to " + n2);
+        System.err.println("Adding " + n1 + " to " + n2);
+        return n1 + n2;
+    }
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorClient.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorClient.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorClient.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,47 @@
+/*
+ * 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 calculator;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ * 
+ * (not really necessary as this sample runs in a webapp)
+ */
+public class CalculatorClient {
+    public static void main(String[] args) throws Exception {
+
+        SCADomain scaDomain = SCADomain.newInstance("Calculator.composite");
+        CalculatorService calculatorService = 
+            scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+        // Calculate
+        System.out.println("3 + 2=" + calculatorService.add(3, 2));
+        System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+        System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+        System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+        
+        scaDomain.close();
+
+    }
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorService.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorService.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorService.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+
+/**
+ * The Calculator service interface.
+ */
+public interface CalculatorService {
+
+    double add(double n1, double n2);
+
+    double subtract(double n1, double n2);
+
+    double multiply(double n1, double n2);
+
+    double divide(double n1, double n2);
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorServiceImpl.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorServiceImpl.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/CalculatorServiceImpl.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,69 @@
+/*
+ * 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 calculator;
+
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+
+    private AddService addService;
+    private SubtractService subtractService;
+    private MultiplyService multiplyService;
+    private DivideService divideService;
+
+    @Reference
+    public void setAddService(AddService addService) {
+        this.addService = addService;
+    }
+
+    @Reference
+    public void setSubtractService(SubtractService subtractService) {
+        this.subtractService = subtractService;
+    }
+
+    @Reference
+    public void setDivideService(DivideService divideService) {
+        this.divideService = divideService;
+    }
+
+    @Reference
+    public void setMultiplyService(MultiplyService multiplyService) {
+        this.multiplyService = multiplyService;
+    }
+
+    public double add(double n1, double n2) {
+        return addService.add(n1, n2);
+    }
+
+    public double subtract(double n1, double n2) {
+        return subtractService.subtract(n1, n2);
+    }
+
+    public double multiply(double n1, double n2) {
+        return multiplyService.multiply(n1, n2);
+    }
+
+    public double divide(double n1, double n2) {
+        return divideService.divide(n1, n2);
+    }
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideService.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideService.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideService.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,28 @@
+/*
+ * 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 calculator;
+
+/**
+ * The interface for the divide service
+ */
+public interface DivideService {
+
+    double divide(double n1, double n2);
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideServiceImpl.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideServiceImpl.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/DivideServiceImpl.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,30 @@
+/*
+ * 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 calculator;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+    public double divide(double n1, double n2) {
+        return n1 / n2;
+    }
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyService.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyService.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyService.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,28 @@
+/*
+ * 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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+    double multiply(double n1, double n2);
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyServiceImpl.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyServiceImpl.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/MultiplyServiceImpl.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,30 @@
+/*
+ * 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 calculator;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+    public double multiply(double n1, double n2) {
+        return n1 * n2;
+    }
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractService.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractService.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractService.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,28 @@
+/*
+ * 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 calculator;
+
+/**
+ * The interface for the subtract service
+ */
+public interface SubtractService {
+
+    double subtract(double n1, double n2);
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractServiceImpl.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractServiceImpl.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/SubtractServiceImpl.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,30 @@
+/*
+ * 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 calculator;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+    public double subtract(double n1, double n2) {
+        return n1 - n2;
+    }
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ClientPWCBHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ClientPWCBHandler.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ClientPWCBHandler.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ClientPWCBHandler.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,45 @@
+/*
+ * 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 calculator.security;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class ClientPWCBHandler implements CallbackHandler {
+
+    public void handle(Callback[] callbacks) throws IOException,
+            UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+        	System.out.println("*** Calling Client UserId/Password Handler .... ");
+            WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+            System.out.println("User Id = " + pwcb.getIdentifer());
+            pwcb.setPassword("CalculatorUserPasswd");
+            System.out.println("Set Password = " + pwcb.getPassword());
+        }
+    }
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ServerPWCBHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ServerPWCBHandler.java?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ServerPWCBHandler.java (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/java/calculator/security/ServerPWCBHandler.java Wed Jan 23 03:36:13 2008
@@ -0,0 +1,55 @@
+/*
+ * 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 calculator.security;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class 
+ */
+public class ServerPWCBHandler implements CallbackHandler {
+
+    public void handle(Callback[] callbacks) throws IOException,
+            UnsupportedCallbackException {
+    	for (int i = 0; i < callbacks.length; i++) {
+            System.out.println("*** Calling Server User/Passwd Handler....");
+            WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+            System.out.println("User Id = " + pwcb.getIdentifer());
+            System.out.println("Password = " + pwcb.getPassword());
+            
+            if ( pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN ) {
+                if ( pwcb.getIdentifer().equals("CalculatorUser") &&
+                        pwcb.getPassword().equals("CalculatorUserPasswd") ){
+                            return;
+                } else {
+                    throw new UnsupportedCallbackException(pwcb, "Authentication Failed : UserId - Password mismatch");
+                }
+            } else if ( pwcb.getUsage() == WSPasswordCallback.SIGNATURE ) {
+                pwcb.setPassword("CalculatorUserPasswd");
+            }
+        }
+    }
+
+}

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/Calculator.composite?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/Calculator.composite (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/Calculator.composite Wed Jan 23 03:36:13 2008
@@ -0,0 +1,58 @@
+<?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.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+           targetNamespace="http://sample"
+           xmlns:sample="http://sample"
+           xmlns:calc="http://calculator"
+           name="Calculator">
+
+    <component name="CalculatorServiceComponent">
+		<implementation.java class="calculator.CalculatorServiceImpl"/>
+        <reference name="addService" >
+           <interface.java interface="calculator.AddService" />        
+            <binding.ws uri="http://localhost:8080/sample-calculator-ws-secure-webapp/AddServiceComponent"
+            			requires="calc:wsAuthentication" />        
+        </reference>   
+        <reference name="subtractService" target="SubtractServiceComponent"></reference>
+        <reference name="multiplyService" target="MultiplyServiceComponent"></reference>
+        <reference name="divideService" target="DivideServiceComponent"></reference>
+    </component>
+
+    <component name="AddServiceComponent">
+        <implementation.java class="calculator.AddServiceImpl"/>
+        <service name="AddService">
+             <interface.java interface="calculator.AddService" />  
+             <binding.ws requires="authentication"/>
+        </service>
+    </component>
+
+    <component name="SubtractServiceComponent">
+        <implementation.java class="calculator.SubtractServiceImpl"/>
+    </component>
+
+    <component name="MultiplyServiceComponent">
+        <implementation.java class="calculator.MultiplyServiceImpl"/>
+    </component>
+
+    <component name="DivideServiceComponent">
+        <implementation.java class="calculator.DivideServiceImpl"/>
+    </component>
+    
+</composite>

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/definitions.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/definitions.xml?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/definitions.xml (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/resources/definitions.xml Wed Jan 23 03:36:13 2008
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.    
+-->
+<sca:definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ 			targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
+ 			xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+ 			xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ 			xmlns:calc="http://calculator">
+
+ 
+ <sca:intent name="authentication" 
+ 			 constrains="sca:binding.ws">
+ 			 <description>
+ 			 Communitcation thro this binding required Authentication.
+ 			 </description>
+ </sca:intent>
+ 
+ <sca:intent name="integrity" 
+ 			 constrains="sca:binding.ws">
+ 			 <description>
+ 			 	Protect messages from unauthorized reading or modification
+ 			 </description>
+ </sca:intent>
+ 
+ <sca:intent name="confidentiality" 
+ 			 constrains="sca:binding.ws">
+ 			 <description>
+ 			 	Communitcation thro this binding must prevent
+	 			 unauthorized users from reading the messages.
+ 			 </description>
+ </sca:intent>
+ 
+ <sca:intent name="calc:wsAuthentication" 
+ 			 constrains="sca:binding.ws">
+ 			 <description>
+ 			 Communitcation thro this binding required Authentication.
+ 			 </description>
+ </sca:intent>
+ 
+ <!-- WS Security POLICY SETS -->
+  <sca:policySet name="calc:wsAuthenticationPolicy"
+ 	provides="authentication"
+ 	appliesTo="sca:binding.ws"
+ 	>
+ 	<tuscany:wsConfigParam>
+ 		<parameter name="InflowSecurity">
+ 			<action>
+ 				<items>UsernameToken</items>
+ 				<passwordCallbackClass>calculator.security.ServerPWCBHandler</passwordCallbackClass>
+       		</action>
+      	</parameter>
+ 	</tuscany:wsConfigParam>
+ </sca:policySet>
+ 
+ <sca:policySet name="calc:wsClientAuthenticationPolicy"
+ 	provides="calc:wsAuthentication"
+ 	appliesTo="sca:binding.ws">
+ 	<tuscany:wsConfigParam>
+ 		<parameter name="OutflowSecurity">
+ 			<action>
+ 				<items>UsernameToken</items>
+ 				<user>CalculatorUser</user>
+				<passwordCallbackClass>calculator.security.ClientPWCBHandler</passwordCallbackClass>" +
+                <passwordType>PasswordText</passwordType>
+               </action>
+    	</parameter>
+ 	</tuscany:wsConfigParam>
+ </sca:policySet>
+ 
+ </sca:definitions>
\ No newline at end of file

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml Wed Jan 23 03:36:13 2008
@@ -0,0 +1,24 @@
+<?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.    
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+              targetNamespace="http://sample"
+              xmlns:sample="http://sample">
+   <deployable composite="sample:Calculator"/>
+</contribution>
\ No newline at end of file

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml Wed Jan 23 03:36:13 2008
@@ -0,0 +1,33 @@
+<?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.    
+-->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"
+    xmlns:d="http://geronimo.apache.org/xml/ns/deployment-1.1">
+
+    <d:environment>
+        <d:moduleId>
+            <d:groupId>org.apache.tuscany.sca</d:groupId>
+            <d:artifactId>sample-calculator-ws-webapp</d:artifactId>
+            <d:version>1.2-incubating-SNAPSHOT</d:version>
+            <d:type>war</d:type>
+        </d:moduleId>
+        <!-- TUSCANY-1986 -->
+        <inverse-classloading />
+    </d:environment>
+</web-app>

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/web.xml?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/WEB-INF/web.xml Wed Jan 23 03:36:13 2008
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  * 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.    
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+  <display-name>Apache Tuscany Calculator Web Service Sample</display-name>
+
+  <filter>
+    <filter-name>tuscany</filter-name> 
+    <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class> 
+  </filter>
+
+  <filter-mapping>
+    <filter-name>tuscany</filter-name> 
+    <url-pattern>/*</url-pattern> 
+  </filter-mapping>
+
+  <welcome-file-list id="WelcomeFileList">
+    <welcome-file>calc.jsp</welcome-file>
+  </welcome-file-list>
+
+</web-app>

Added: incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/calc.jsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/calc.jsp?rev=614501&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/calc.jsp (added)
+++ incubator/tuscany/java/sca/samples/calculator-ws-secure-webapp/src/main/webapp/calc.jsp Wed Jan 23 03:36:13 2008
@@ -0,0 +1,50 @@
+<%--
+ * 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.
+--%>
+
+<%@ page import="org.apache.tuscany.sca.host.embedded.SCADomain"%>
+<%@ page import="calculator.CalculatorService" %>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+   SCADomain scaDomain = (SCADomain) application.getAttribute("org.apache.tuscany.sca.SCADomain");
+   CalculatorService calculatorService = (CalculatorService)scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");
+%>
+<html>
+<head><title>Calculator sample</title></head>
+
+<body>
+<table>
+    <tr>
+        <th>Expression</th><th>Result</th>
+    </tr>
+    <tr>
+        <td>2 + 3</td><td><%= calculatorService.add(2, 3) %></td>
+    </tr>
+    <tr>
+        <td>3 - 2</td><td><%= calculatorService.subtract(3, 2) %></td>
+    </tr>
+    <tr>
+        <td>3 * 2</td><td><%= calculatorService.multiply(3, 2) %></td>
+    </tr>
+    <tr>
+        <td>3 / 2</td><td><%= calculatorService.divide(3, 2) %></td>
+    </tr>    
+</table>
+</body>
+</html>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org