On Mon, Aug 10, 2009 at 9:02 AM, Scott Kurz<[email protected]> wrote:
> Do we really even want the path from the service-side binding.atom to
> the service impl to include the DataTransformationInterceptor, given
> that the binding makes its own invocation of the mediator?
>
> What about using the usual trick of returning the componentType
> interface in getBindingInterfaceContrace() via:
> service.getService().getInterfaceContract()
> to disable the DTI?
>
> Is that all we really need to do here (and the analogous bit on the
> reference side)?
>
> Scott
>
Just want make sure we are on the same page here. Are you suggesting
that we check if we have a WSDL Contract, and in this case find the
correspondent Java Interface contract and use it ? I gave this a quick
try (see patch below) and it seems to work fine.... and the test cases
are now passing even with the interface.wsdl
diff --git
a/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java
b/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java
index 0a5a902..d794dd4 100644
---
a/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java
+++
b/modules/binding-atom-abdera/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java
@@ -19,10 +19,12 @@
package org.apache.tuscany.sca.binding.atom.provider;
+import org.apache.tuscany.sca.assembly.Service;
import org.apache.tuscany.sca.binding.atom.AtomBinding;
import org.apache.tuscany.sca.databinding.Mediator;
import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
import org.apache.tuscany.sca.invocation.MessageFactory;
import org.apache.tuscany.sca.provider.ServiceBindingProvider;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
@@ -37,6 +39,7 @@ import org.apache.tuscany.sca.runtime.RuntimeWire;
class AtomServiceBindingProvider implements ServiceBindingProvider {
private RuntimeComponentService service;
+ private InterfaceContract serviceContract;
private AtomBinding binding;
private ServletHost servletHost;
private MessageFactory messageFactory;
@@ -56,10 +59,22 @@ class AtomServiceBindingProvider implements
ServiceBindingProvider {
this.servletHost = servletHost;
this.messageFactory = messageFactory;
this.mediator = mediator;
+
+ // TUSCANY-3166
+ this.serviceContract = service.getInterfaceContract();
+ if (this.serviceContract instanceof WSDLInterfaceContract) {
+ for (Service componentService :
component.getImplementation().getServices()) {
+ if
(componentService.getName().equals(service.getName())) {
+ this.serviceContract = (InterfaceContract)
componentService.getInterfaceContract();
+ break;
+ }
+ }
+
+ }
}
public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
+ return serviceContract;
}
public boolean supportsOneWayInvocation() {
--
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/