summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-11-30 16:02:31 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-11-30 16:02:31 +0000
commit93777d8895392ec7b484ae0426a8bdef1149b4d6 (patch)
tree5ebee0553a9492ef132b4598d187fdd8934e7e06 /sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java
parentff12f54997320a2ed2d0bfec82e970455093f33a (diff)
Add code to process the async response
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1040598 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java32
1 files changed, 28 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java b/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java
index 286e619326..d3e91c7f18 100644
--- a/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java
+++ b/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java
@@ -20,6 +20,12 @@
package sampleasync.impl;
import static java.lang.System.out;
+import static sample.Xutil.elem;
+import static sample.Xutil.text;
+import static sample.Xutil.xdom;
+
+import org.w3c.dom.Element;
+
import sample.api.Java;
import sample.api.WSDL;
import sample.api.WSDLReference;
@@ -35,11 +41,25 @@ public class UpperSampleAsyncReferenceImpl {
@WSDL("http://sample/upper#Upper")
WSDLReference upper;
+ String response;
public String upper(String s) {
out.println("UpperSampleAsyncReferenceImpl.upper(" + s + ")");
- upper.callAsync("upper", null);
- return null;
+
+ // TODO - I'm passing in the non-wrapped version of the parameter
+ // here which doesn't seem right. If I pass in the wrapped
+ // version then the databinding won't unwrap on the reference
+ // side as it thinks the target Java interface is bare?
+ final Element ureq = xdom("http://sample/upper", "s", text(s));
+ upper.callAsync("upper", ureq);
+
+ try {
+ Thread.sleep(500);
+ } catch (Exception ex) {
+ // do nothing
+ }
+
+ return response;
}
/**
@@ -47,7 +67,11 @@ public class UpperSampleAsyncReferenceImpl {
* async callback arrives at an operation named
* operationName + Callback
*/
- public void upperCallback(String s) {
- out.println("UpperSampleAsyncReferenceImpl.upperCallback(" + s + ")");
+ // TODO - I think this should take and Element parameter but the response
+ // handler interface is a Java interface at the moment and so no
+ // transformation takes place automatically.
+ public void upperCallback(String response) {
+ out.println("UpperSampleAsyncReferenceImpl.upperCallback(" + response + ")");
+ this.response = response;
}
}