summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/java/calculator/AddServiceImpl.java1
-rw-r--r--sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/webapp/calculate.html14
2 files changed, 8 insertions, 7 deletions
diff --git a/sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/java/calculator/AddServiceImpl.java
index 8eabfa6773..e16b352021 100644
--- a/sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/java/calculator/AddServiceImpl.java
+++ b/sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/java/calculator/AddServiceImpl.java
@@ -37,6 +37,7 @@ public class AddServiceImpl implements AddService {
public AddBean addComplexParam(AddBean aBean) {
aBean.setN3(aBean.getN1() + aBean.getN2());
+ System.out.println("Adding " + aBean.getN1() + " to " + aBean.getN1() + " gives " + aBean.getN3());
return aBean;
}
diff --git a/sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/webapp/calculate.html b/sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/webapp/calculate.html
index 43d80ec70f..087cc42ddd 100644
--- a/sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/webapp/calculate.html
+++ b/sca-java-2.x/trunk/samples/binding-jsonrpc/contribution-calculator-webapp/src/main/webapp/calculate.html
@@ -21,10 +21,11 @@
<head>
<title>Apache Tuscany binding-jsonrpc Calculator WebApp with DOJO Sample</title>
- <script type="text/javascript" src="/dojo/dojo.js"></script>
+ <script type="text/javascript" src="dojo/dojo/dojo.js"></script>
<script type="text/javascript" src="org.oasisopen.sca.componentContext.js"></script>
<script language="JavaScript">
+ dojo.require("dojo.rpc.JsonService");
var addService = new dojo.rpc.JsonService("AddServiceComponent/AddService?smd");
@@ -38,11 +39,11 @@
addRequest.x = 2;
addRequest.y = 3;
- addService.add(addRequest, calculateResponse);
+ addService.addComplexParam(addRequest).addCallback(calculateResponse);
}
function calculateResponse(reply) {
- document.getElementById('result').innerHTML=reply;
+ document.getElementById('result').innerHTML=reply.n3;
}
</script>
@@ -53,11 +54,10 @@
<h2>Apache Tuscany binding-jsonrpc Calculator WebApp with DOJO Sample</h2>
- <input type="text" id="name" width="10">
-
+ 1 + 1 =
<button name="submit" onclick="calculate()">Calculate</button>
- <div id='result'></div>
+ <div id='result'/>
</body>
-</html> \ No newline at end of file
+</html>