You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ri...@apache.org on 2006/12/06 12:31:57 UTC

svn commit: r483038 - in /incubator/tuscany/java/samples/sca/loanappconversationWS: ./ src/ src/main/java/loanappconversation/ src/main/resources/META-INF/sca/ src/main/resources/wsdl/ src/main/webapp/ src/main/webapp/WEB-INF/ src/test/java/

Author: rineholt
Date: Wed Dec  6 03:31:50 2006
New Revision: 483038

URL: http://svn.apache.org/viewvc?view=rev&rev=483038
Log:
sample for loan conversation via web services

Added:
    incubator/tuscany/java/samples/sca/loanappconversationWS/
      - copied from r480926, incubator/tuscany/java/samples/sca/loanappconversation/
    incubator/tuscany/java/samples/sca/loanappconversationWS/pom.xml
      - copied, changed from r482678, incubator/tuscany/java/samples/sca/loanappconversation/pom.xml
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/
      - copied from r482678, incubator/tuscany/java/samples/sca/loanappconversation/src/
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/resources/wsdl/
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/resources/wsdl/loanappconversation.wsdl
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/default.scdl
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/web.xml
Removed:
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanAppConversationClient.java
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanClient.java
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanClientImpl.java
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/resources/META-INF/sca/
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/test/java/
Modified:
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanService.java
    incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanServiceImpl.java

Copied: incubator/tuscany/java/samples/sca/loanappconversationWS/pom.xml (from r482678, incubator/tuscany/java/samples/sca/loanappconversation/pom.xml)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWS/pom.xml?view=diff&rev=483038&p1=incubator/tuscany/java/samples/sca/loanappconversation/pom.xml&r1=482678&p2=incubator/tuscany/java/samples/sca/loanappconversationWS/pom.xml&r2=483038
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversation/pom.xml (original)
+++ incubator/tuscany/java/samples/sca/loanappconversationWS/pom.xml Wed Dec  6 03:31:50 2006
@@ -24,10 +24,10 @@
         <version>1.0-incubator-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>sample-loanappconversation</artifactId>
-    <packaging>jar</packaging>
-    <name>Tuscany Loan App Conversation Sample</name>
-    <description>A sample implementation of a loan application conversation.</description>
+    <artifactId>sample-loanappconversationWS</artifactId>
+    <packaging>war</packaging>
+    <name>Tuscany Loan App Conversation Web Service Sample</name>
+    <description>A sample implementation of a loan application conversation web service.</description>
 
     <dependencies>
         <dependency>
@@ -35,26 +35,51 @@
             <artifactId>sca-api-r0.95</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>test</artifactId>
-            <version>${tuscanyVersion}</version>
-            <scope>test</scope>
+            <groupId>org.apache.tuscany.sca.runtime</groupId>
+            <artifactId>webapp</artifactId>
+            <version>${scaImplVersion}</version>
+            <scope>runtime</scope>
         </dependency>
     </dependencies>
 
     <build>
+        <finalName>${artifactId}</finalName>
         <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
+               <plugin>
+                <groupId>org.apache.tuscany.sca.plugins</groupId>
+                <artifactId>tuscany-war-plugin</artifactId>
+                   <version>${scaImplVersion}</version>
+                <executions>
+                    <execution>
+                        <id>tuscany-war</id>
+                        <goals>
+                            <goal>tuscany-war</goal>
+                        </goals>
+                    </execution>
+                </executions>
                 <configuration>
-                    <archive>
-                        <manifest>
-                            <mainClass>loanappconversation.LoanAppConversationClient</mainClass>
-                        </manifest>
-                    </archive>
+                    <!-- Set to true to embed external jars for extensions in the WAR -->
+                    <!-- Set to false to leave external jars for extensions to be resolved from maven repository -->
+                    <loadExtensionDependencies>false</loadExtensionDependencies>
+
+                    <extensions>
+                    <!--
+                        <dependency>
+                            <groupId>org.apache.tuscany.sca.services.databinding</groupId>
+                            <artifactId>databinding-sdo</artifactId>
+                            <version>${scaImplVersion}</version>
+                        </dependency>
+                        -->
+                        <dependency>
+                            <groupId>org.apache.tuscany.sca.services.bindings</groupId>
+                            <artifactId>axis2</artifactId>
+                            <version>${scaImplVersion}</version>
+                        </dependency>
+                    </extensions>
+
                 </configuration>
             </plugin>
+        
         </plugins>
     </build>
 </project>

Modified: incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanService.java?view=diff&rev=483038&r1=482678&r2=483038
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanService.java (original)
+++ incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanService.java Wed Dec  6 03:31:50 2006
@@ -26,9 +26,10 @@
 @Scope("CONVERSATION")
 @Remotable
 public interface LoanService {
-    void apply(LoanApplication application);
+    //prim void apply(LoanApplication application);
+    void apply(String customerName,  float loanAmount);
     void lockCurrentRate(int termInYears);
-    @OneWay
+   @OneWay
     void cancelApplication();
     String getLoanStatus();
     String display();

Modified: incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanServiceImpl.java?view=diff&rev=483038&r1=482678&r2=483038
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanServiceImpl.java (original)
+++ incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/java/loanappconversation/LoanServiceImpl.java Wed Dec  6 03:31:50 2006
@@ -18,19 +18,28 @@
  */
 package loanappconversation;
 
+import org.osoa.sca.annotations.Remotable;
 import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
 
 @Scope("CONVERSATION")
+@Remotable
+@Service(LoanService.class)
 public class LoanServiceImpl implements LoanService {
     
     private LoanApplication application;
     private String status;
     private int termLocked = 0;
 
-    public void apply(LoanApplication application) {
+    private void apply(LoanApplication application) {
         this.application = application;
         status = "open";
     }
+    //prim
+    public void apply(String customerName, float loanAmount) {
+        apply(new LoanApplication(customerName, loanAmount));
+        
+    }
     
     public void lockCurrentRate(int termInYears) {
         termLocked = termInYears;
@@ -54,4 +63,5 @@
         this.application = null;
         this.status = "closed";
     }
+
 }

Added: incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/resources/wsdl/loanappconversation.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/resources/wsdl/loanappconversation.wsdl?view=auto&rev=483038
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/resources/wsdl/loanappconversation.wsdl (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/resources/wsdl/loanappconversation.wsdl Wed Dec  6 03:31:50 2006
@@ -0,0 +1,274 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:loanservice="http://www.loanappconversation.com/loanservice"
+	targetNamespace="http://www.loanappconversation.com/loanservice"
+	name="LoanService">
+
+	<wsdl:types>
+		<xsd:schema targetNamespace="http://www.loanappconversation.com/loanservice"
+			xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+			xmlns:loanservice="http://www.loanappconversation.com/loanservice"
+			>
+			
+
+			<xsd:element name="apply">
+				<xsd:complexType>
+					<xsd:sequence>
+					<xsd:element name="customerName"
+						type="xsd:string" />
+					<xsd:element name="loanAmount"
+						type="xsd:float"  />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+			<xsd:element name="applyResponse">
+			  <xsd:complexType/>
+            </xsd:element>
+<!--
+			<xsd:complexType name="LoanApplication">
+				<xsd:sequence>
+					<xsd:element name="customerName"
+						type="xsd:string"  />
+					<xsd:element name="loanAmount"
+						type="xsd:float" />
+				</xsd:sequence>
+			</xsd:complexType>
+-->
+			
+			<xsd:element name="lockCurrentRate">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="termInYears" type="xsd:int" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+
+			<xsd:element name="lockCurrentRateResponse">
+			  <xsd:complexType/>
+            </xsd:element>
+
+			<xsd:element name="cancelApplication">
+			  <xsd:complexType/>
+            </xsd:element>
+			<xsd:element name="cancelApplicationResponse">
+			  <xsd:complexType/>
+            </xsd:element>
+
+			<xsd:element name="getLoanStatus">
+			  <xsd:complexType/>
+            </xsd:element>
+			<xsd:element name="getLoanStatusResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="getLoanStatusReturn" type="xsd:string" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:element name="display">
+			  <xsd:complexType/>
+            </xsd:element>
+			
+
+			<xsd:element name="displayResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="displayReturn"
+							type="xsd:string" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+
+			<xsd:element name="close">
+			  <xsd:complexType/>
+            </xsd:element>
+
+		</xsd:schema>
+	</wsdl:types>
+	
+	
+	<wsdl:message name="applyRequest">
+		<wsdl:part element="loanservice:apply"
+			name="applyRequest" />
+	</wsdl:message>
+	<wsdl:message name="applyResponse">
+		<wsdl:part element="loanservice:applyResponse"
+			name="applyResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="lockCurrentRateRequest">
+		<wsdl:part element="loanservice:lockCurrentRate"
+			name="lockCurrentRate" />
+	</wsdl:message>
+	<wsdl:message name="lockCurrentRateResponse">
+		<wsdl:part element="loanservice:lockCurrentRateResponse"
+			name="lockCurrentRateResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="cancelApplicationRequest">
+		<wsdl:part element="loanservice:cancelApplication" name="cancelApplicationRequest" />
+	</wsdl:message>
+
+	<wsdl:message name="cancelApplicationResponse">
+		<wsdl:part element="loanservice:cancelApplicationResponse"
+			name="cancelApplicationResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="getLoanStatusRequest">
+		<wsdl:part element="loanservice:getLoanStatus" name="getLoanStatusRequest" />
+	</wsdl:message>
+
+	<wsdl:message name="getLoanStatusResponse">
+		<wsdl:part element="loanservice:getLoanStatusResponse"
+			name="getLoanStatusResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="displayRequest">
+		<wsdl:part element="loanservice:display"
+			name="displayRequest" />
+	</wsdl:message>
+
+	<wsdl:message name="displayResponse">
+		<wsdl:part element="loanservice:displayResponse"
+			name="displayResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="closeRequest">
+		<wsdl:part element="loanservice:close" name="closeRequest" />
+	</wsdl:message>
+	
+
+	<wsdl:portType name="LoanService">
+		<wsdl:operation name="apply">
+			<wsdl:input message="loanservice:applyRequest" />
+			<wsdl:output message="loanservice:applyResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="lockCurrentRate">
+			<wsdl:input message="loanservice:lockCurrentRateRequest" />
+			<wsdl:output message="loanservice:lockCurrentRateResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="cancelApplication">
+			<wsdl:input message="loanservice:cancelApplicationRequest" />
+			<wsdl:output message="loanservice:cancelApplicationResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="getLoanStatus">
+			<wsdl:input message="loanservice:getLoanStatusRequest" />
+			<wsdl:output message="loanservice:getLoanStatusResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="display">
+			<wsdl:input message="loanservice:displayRequest" />
+			<wsdl:output message="loanservice:displayResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="close">
+			<wsdl:input message="loanservice:closeRequest" />
+			<wsdl:output message="loanservice:displayResponse" />
+		</wsdl:operation>
+
+	</wsdl:portType>
+
+
+	<wsdl:binding name="LoanServiceSOAP" type="loanservice:LoanService">
+		<soap:binding style="document"
+			transport="http://schemas.xmlsoap.org/soap/http" />
+		<wsdl:operation name="apply">
+			<soap:operation
+				soapAction="http://www.loanappconversation.com/loanservice/apply" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+		<wsdl:operation name="lockCurrentRate">
+			<soap:operation
+				soapAction="http://www.loanappconversation.com/loanservice/lockCurrentRate" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="cancelApplication">
+			<soap:operation
+				soapAction="http://www.loanappconversation.com/loanservice/cancelApplication" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="getLoanStatus">
+			<soap:operation
+				soapAction="http://www.loanappconversation.com/loanservice/getLoanStatus" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="display">
+			<soap:operation
+				soapAction="http://www.loanappconversation.com/loanservice/display" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="close">
+			<soap:operation
+				soapAction="http://www.loanappconversation.com/loanservice/close" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+
+	</wsdl:binding>
+	<wsdl:service name="LoanService">
+		<wsdl:port binding="loanservice:LoanServiceSOAP"
+			name="LoanServiceSOAP">
+			<soap:address
+				location="http://localhost:8080/sample-loanappconversationWS/services/LoanService" />
+		</wsdl:port>
+	</wsdl:service>
+</wsdl:definitions>

Added: incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/default.scdl?view=auto&rev=483038
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/default.scdl (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/default.scdl Wed Dec  6 03:31:50 2006
@@ -0,0 +1,41 @@
+<?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" name="simplecallback">
+
+
+    <service name="LoanService"   > 
+        <interface.java interface="loanappconversation.LoanService" scope="conversational" />
+        <!--
+        <interface.wsdl interface="http://www.loanappconversation.com/loanservice#wsdl.interface(LoanService)"
+            wsdli:wsdlLocation="http://www.loanappconversation.com/loanservice wsdl/loanappconversation.wsdl" />
+
+-->
+
+        <binding.ws endpoint="http://www.loanappconversation.com/loanservice#wsdl.endpoint(LoanService/LoanServiceSOAP)"
+            conformanceURIs="http://ws-i.org/profiles/basic/1.1" location="wsdl/loanappconversation.wsdl" />
+
+        <reference>LoanServiceComponent</reference>
+    </service>
+    
+    <component name="LoanServiceComponent">
+        <implementation.java class="loanappconversation.LoanServiceImpl"/>
+    </component>
+    
+</composite>

Added: incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/web.xml?view=auto&rev=483038
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWS/src/main/webapp/WEB-INF/web.xml Wed Dec  6 03:31:50 2006
@@ -0,0 +1,51 @@
+<?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.    
+-->
+
+<!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 id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+  <display-name>A sample implementation of a loan application conversation web service.</display-name>
+
+
+  <context-param>
+	     <param-name>tuscany.online</param-name>
+	     <param-value>true</param-value>
+  </context-param>
+
+
+  <listener>
+     <listener-class>org.apache.tuscany.runtime.webapp.TuscanyContextListener</listener-class>
+  </listener>
+   
+  <servlet>
+     <servlet-name>TuscanyServlet</servlet-name>
+     <display-name>Tuscany Servlet</display-name>
+     <servlet-class>org.apache.tuscany.runtime.webapp.TuscanyServlet</servlet-class>
+  </servlet>
+  
+  <servlet-mapping>
+     <servlet-name>TuscanyServlet</servlet-name>
+     <url-pattern>/services/*</url-pattern>
+
+  </servlet-mapping>  
+ 
+
+</web-app>



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