From 55efe51ad85a25f50e45a3f80fc89076910b8ad4 Mon Sep 17 00:00:00 2001 From: bdaniel Date: Fri, 26 Jun 2009 20:06:13 +0000 Subject: TUSCANY-3121 binding.atom should leverage introspection when setting up call to mediator git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@788848 13f79535-47bb-0310-9956-ffa450edef68 --- .../binding/atom/provider/AtomBindingListenerServlet.java | 7 +++---- .../atom/provider/AtomReferenceBindingProvider.java | 14 ++++++-------- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'branches') diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingListenerServlet.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingListenerServlet.java index 5eebc6dff7..d7cbf83374 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingListenerServlet.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomBindingListenerServlet.java @@ -150,10 +150,9 @@ class AtomBindingListenerServlet extends HttpServlet { if (itemClass == org.apache.abdera.model.Entry.class) { supportsFeedEntries = true; } - DataType outputType = getOperation.getOutputType(); - QName qname = outputType.getLogical().getElementName(); - qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName()); - itemClassType = new DataTypeImpl("java:complexType", itemClass, new XMLType(qname, null)); + //We assume that the item type is the same for both input and + //ouput for all operations on the interface + itemClassType = getOperation.getOutputType(); } } diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java index f2b1d1f72b..2c6c952dcb 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java @@ -86,22 +86,20 @@ class AtomReferenceBindingProvider implements ReferenceBindingProvider { public Invoker createInvoker(Operation operation) { - String operationName = operation.getName(); - if (operationName.equals("get")) { - + String operationName = operation.getName(); + if (operationName.equals("get")) { + // Determine the collection item type itemXMLType = new DataTypeImpl>(String.class.getName(), String.class, String.class); Class itemClass = operation.getOutputType().getPhysical(); DataType outputType = operation.getOutputType(); - QName qname = outputType.getLogical().getElementName(); - qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName()); - itemClassType = new DataTypeImpl("java:complexType", itemClass, new XMLType(qname, null)); + itemClassType = outputType; if (itemClassType.getPhysical() == org.apache.abdera.model.Entry.class) { supportsFeedEntries = true; } - + return new AtomBindingInvoker.GetInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this); - + } else if (operationName.equals("post")) { return new AtomBindingInvoker.PostInvoker(operation, binding.getURI(), httpClient, authorizationHeader, this); } else if (operationName.equals("put")) { -- cgit v1.2.3