diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-10 21:50:34 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-10 21:50:34 +0000 |
commit | 5ae609d772940b13f95cd06a989551d1ba13ef38 (patch) | |
tree | 6b129111850db46476378534893098a4f83a0367 /sandbox/sebastien/java/wrapped/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java | |
parent | 669ca7bbf2a00bec21ffc3cd60f01ee8fa1a88be (diff) |
Add support for both RPC and Doc-wrapped modes to the component implementation example. Test an RPC reference configured with a Doc-Wrapped binding contract.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1057387 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/sebastien/java/wrapped/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java')
-rw-r--r-- | sandbox/sebastien/java/wrapped/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/sandbox/sebastien/java/wrapped/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java b/sandbox/sebastien/java/wrapped/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java index 5b42bce28f..707e71c187 100644 --- a/sandbox/sebastien/java/wrapped/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java +++ b/sandbox/sebastien/java/wrapped/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java @@ -58,7 +58,7 @@ class SampleWSDLProxy implements WSDLReference { } @Override - public Element call(String op, Element e) { + public Element doccall(String op, Element e) { try { // Invoke the named operation on the endpoint reference return (Element)repr.invoke(ops.get(op), new Object[] {e}); @@ -68,37 +68,13 @@ class SampleWSDLProxy implements WSDLReference { } @Override - public Element callBare(String op, Element... e) { + public Object rpccall(String op, Object... args) { try { // Invoke the named operation on the endpoint reference - return (Element)repr.invoke(ops.get(op), e); + return repr.invoke(ops.get(op), args); } catch(InvocationTargetException ex) { throw new RuntimeException(ex); } } - @Override - public void callAsync(String op, Element e) { - // Asynchronously invoke the named operation on the endpoint reference - Message message = mf.createMessage(); - message.setBody(new Object[]{e}); - - // Generate MESSAGE_ID here. - // String messageID = "myuniqueid"; - String messageID = UUID.randomUUID().toString(); - message.getHeaders().put(Constants.MESSAGE_ID, messageID); - - // save the message id ready for when we process the response - asyncMessageMap.put(messageID, op); - - // We could add implementation specific headers here if required - //message.getHeaders().put(Constants.???, ???); - - try { - repr.invokeAsync(ops.get(op), message); - } catch (Throwable ex) { - ex.printStackTrace(); - } - - } } |