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:53:01 UTC
svn commit: r483044 - in
/incubator/tuscany/java/samples/sca/loanappconversationWSClient: ./ src/
src/main/ src/main/java/ src/main/java/loanappconversation/
src/main/resources/ src/main/resources/META-INF/
src/main/resources/META-INF/sca/ src/main/res...
Author: rineholt
Date: Wed Dec 6 03:52:59 2006
New Revision: 483044
URL: http://svn.apache.org/viewvc?view=rev&rev=483044
Log:
sample for loan conversation via web services
Added:
incubator/tuscany/java/samples/sca/loanappconversationWSClient/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/pom.xml
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanAppConversationClient.java
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanApplication.java
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClient.java
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClientImpl.java
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanService.java
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/META-INF/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/META-INF/sca/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/META-INF/sca/default.scdl
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/wsdl/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/wsdl/loanappconversation.wsdl
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/test/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/test/java/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/test/java/loanappconversation/
incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/test/java/loanappconversation/LoanAppConversationTestCase.java
Added: incubator/tuscany/java/samples/sca/loanappconversationWSClient/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWSClient/pom.xml?view=auto&rev=483044
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWSClient/pom.xml (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWSClient/pom.xml Wed Dec 6 03:52:59 2006
@@ -0,0 +1,67 @@
+<?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>
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>sample-loanappconversationWSClient</artifactId>
+ <packaging>jar</packaging>
+ <name>Tuscany Loan App Conversation WS Client</name>
+ <description>A sample implementation conversation WS client.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api-r0.95</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>test</artifactId>
+ <version>${tuscanyVersion}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>loanappconversation.LoanAppConversationClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanAppConversationClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanAppConversationClient.java?view=auto&rev=483044
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanAppConversationClient.java (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanAppConversationClient.java Wed Dec 6 03:52:59 2006
@@ -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 loanappconversation;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+public class LoanAppConversationClient {
+
+ public static void main(String[] args) throws Exception {
+ // Locate the MyClient component and invoke it
+ CompositeContext context = CurrentCompositeContext.getContext();
+
+ LoanClient loanClient = context.locateService(LoanClient.class, "LoanClientComponent");
+ loanClient.applyForLoan("John Doe", 1000.0f);
+ System.out.println(loanClient.displayLoan());
+ System.out.println("Loan approved: " + loanClient.isApproved());
+ }
+}
Added: incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanApplication.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanApplication.java?view=auto&rev=483044
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanApplication.java (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanApplication.java Wed Dec 6 03:52:59 2006
@@ -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 loanappconversation;
+
+public class LoanApplication {
+
+ private String customerName;
+ private float loanAmount;
+
+ public LoanApplication(String customerName, float loanAmount) {
+ this.customerName = customerName;
+ this.loanAmount = loanAmount;
+ }
+
+ public String toString() {
+ return "[Customer: " + customerName + ", loan amount: "
+ + loanAmount + "]";
+ }
+}
Added: incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClient.java?view=auto&rev=483044
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClient.java (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClient.java Wed Dec 6 03:52:59 2006
@@ -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 loanappconversation;
+
+public interface LoanClient {
+
+ void applyForLoan(String customerName, float amount);
+ boolean isApproved();
+ String displayLoan();
+ void cancelLoan();
+ void closeLoan();
+}
Added: incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClientImpl.java?view=auto&rev=483044
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClientImpl.java (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanClientImpl.java Wed Dec 6 03:52:59 2006
@@ -0,0 +1,52 @@
+/*
+ * 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 loanappconversation;
+
+import org.osoa.sca.annotations.Reference;
+
+public class LoanClientImpl implements LoanClient {
+
+ private LoanService loanService;
+
+ @Reference
+ public void setLoanService(LoanService loanService) {
+ this.loanService = loanService;
+ }
+
+ public void applyForLoan(String customerName, float amount) {
+ //prim loanService.apply(new LoanApplication(customerName, amount));
+ loanService.apply(customerName, amount);
+ }
+
+ public boolean isApproved() {
+ return loanService.getLoanStatus().equals("approved");
+ }
+
+ public String displayLoan() {
+ return loanService.display();
+ }
+
+ public void cancelLoan() {
+ loanService.cancelApplication();
+ }
+
+ public void closeLoan() {
+ loanService.close();
+ }
+}
Added: incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanService.java?view=auto&rev=483044
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanService.java (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/java/loanappconversation/LoanService.java Wed Dec 6 03:52:59 2006
@@ -0,0 +1,38 @@
+/*
+ * 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 loanappconversation;
+
+import org.osoa.sca.annotations.EndConversation;
+import org.osoa.sca.annotations.OneWay;
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+
+@Scope("CONVERSATION")
+@Remotable
+public interface LoanService {
+ //prim void apply(LoanApplication application);
+ void apply(String customerName, float loanAmount);
+ void lockCurrentRate(int termInYears);
+ @OneWay
+ void cancelApplication();
+ String getLoanStatus();
+ String display();
+ @EndConversation
+ void close();
+}
Added: incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=483044
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/META-INF/sca/default.scdl Wed Dec 6 03:52:59 2006
@@ -0,0 +1,40 @@
+<?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">
+
+ <component name="LoanClientComponent">
+ <implementation.java class="loanappconversation.LoanClientImpl"/>
+ <reference name="loanService">LoanService</reference>
+ </component>
+
+
+ <reference name="LoanService">
+ <interface.java interface="loanappconversation.LoanService" scope="conversational" />
+<!--
+ <interface.wsdl xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ 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)"
+ location="wsdl/loanappconversation.wsdl" />
+ </reference>
+
+</composite>
Added: incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/wsdl/loanappconversation.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/wsdl/loanappconversation.wsdl?view=auto&rev=483044
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/wsdl/loanappconversation.wsdl (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/main/resources/wsdl/loanappconversation.wsdl Wed Dec 6 03:52:59 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/loanappconversationWSClient/src/test/java/loanappconversation/LoanAppConversationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/test/java/loanappconversation/LoanAppConversationTestCase.java?view=auto&rev=483044
==============================================================================
--- incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/test/java/loanappconversation/LoanAppConversationTestCase.java (added)
+++ incubator/tuscany/java/samples/sca/loanappconversationWSClient/src/test/java/loanappconversation/LoanAppConversationTestCase.java Wed Dec 6 03:52:59 2006
@@ -0,0 +1,63 @@
+/*
+ * 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 loanappconversation;
+
+import org.apache.tuscany.spi.component.TargetNotFoundException;
+import org.apache.tuscany.test.SCATestCase;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+public class LoanAppConversationTestCase extends SCATestCase {
+
+ private LoanClient loanClient;
+
+ protected void setUp() throws Exception {
+ try {
+ setApplicationSCDL(LoanClient.class, "META-INF/sca/default.scdl");
+ super.setUp();
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+ loanClient = context.locateService(LoanClient.class, "LoanClientComponent");
+ } catch(Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void test() throws Exception {
+ try {
+ loanClient.applyForLoan("John Doe", 1000.0f);
+ System.out.println("Applied: " + loanClient.displayLoan());
+ System.out.println("Loan approved: " + loanClient.isApproved());
+ loanClient.cancelLoan();
+ System.out.println("Sleeping to let cancel complete ...");
+ Thread.sleep(500);
+ System.out.println("Cancelled: " + loanClient.displayLoan());
+ loanClient.closeLoan();
+ try {
+ System.out.println("Trying to use the closed loan in the ended conversation ...");
+ System.out.println("Closed: " + loanClient.displayLoan());
+ fail("Target should not be found");
+ } catch(TargetNotFoundException e) {
+ System.out.println("Target not found as expected");
+ }
+ } catch(Throwable e) {
+ e.printStackTrace();
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org