tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r529057 - in /incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2: Axis2BindingBuilder.java Axis2ReferenceBinding.java Axis2WSReference.java
Date Sun, 15 Apr 2007 19:51:46 GMT
Author: antelder
Date: Sun Apr 15 12:51:45 2007
New Revision: 529057

URL: http://svn.apache.org/viewvc?view=rev&rev=529057
Log:
Merge Axis2 reference code back into old Axis2ReferenceBinding now that it works ok

Removed:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2WSReference.java
Modified:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceBinding.java

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java?view=diff&rev=529057&r1=529056&r2=529057
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
(original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
Sun Apr 15 12:51:45 2007
@@ -69,7 +69,7 @@
         compositeReference.getInterfaceContract().getInterface().setDefaultDataBinding(OMElement.class.getName());
         
         URI targetURI = wsBinding.getURI() != null ? URI.create(wsBinding.getURI()) : URI.create("foo");
-        return new Axis2WSReference(URI.create(context.getComponentId() + "#" + wsBinding.getName()),
targetURI, wsBinding);
+        return new Axis2ReferenceBinding(URI.create(context.getComponentId() + "#" + wsBinding.getName()),
targetURI, wsBinding);
     }
     
 //    @SuppressWarnings("unchecked")

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceBinding.java?view=diff&rev=529057&r1=529056&r2=529057
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceBinding.java
(original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceBinding.java
Sun Apr 15 12:51:45 2007
@@ -18,10 +18,7 @@
  */
 package org.apache.tuscany.binding.axis2;
 
-import static org.osoa.sca.Constants.SCA_NS;
-
 import java.net.URI;
-import java.util.Collection;
 
 import javax.wsdl.Definition;
 import javax.xml.namespace.QName;
@@ -39,7 +36,7 @@
 import org.apache.tuscany.binding.axis2.util.WebServiceOperationMetaData;
 import org.apache.tuscany.binding.axis2.util.WebServicePortMetaData;
 import org.apache.tuscany.binding.ws.WebServiceBinding;
-import org.apache.tuscany.interfacedef.InterfaceContract;
+import org.apache.tuscany.binding.ws.xml.WebServiceConstants;
 import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.spi.component.TargetInvokerCreationException;
 import org.apache.tuscany.spi.component.WorkContext;
@@ -50,76 +47,51 @@
  * Axis2Reference uses Axis2 to invoke a remote web service
  */
 public class Axis2ReferenceBinding extends ReferenceBindingExtension {
-    private static final QName BINDING_WS = new QName(SCA_NS, "binding.ws");
 
+    private WorkContext workContext;
     private WebServicePortMetaData wsPortMetaData;
     private ServiceClient serviceClient;
 
-    private WorkContext workContext;
-
-//    public Axis2ReferenceBinding(URI uri,
-//                                 WebServiceBinding wsBinding
-////                                 ServiceContract contract,
-////                                 ServiceContract<?> bindingServiceContract) {
-//        super(uri, uri); // TODO: what should these be
-//        try {
-//            Definition wsdlDefinition = wsBinding.getWSDLDefinition();
-//            wsPortMetaData =
-//                new WebServicePortMetaData(wsdlDefinition, wsBinding.getWSDLPort(), wsBinding.getURI(),
false);
-//            serviceClient = createServiceClient(wsdlDefinition, wsPortMetaData);
-//        } catch (AxisFault e) {
-//            throw new Axis2BindingRunTimeException(e);
-//        }
-//    }
     public Axis2ReferenceBinding(URI name, URI targetUri, WebServiceBinding wsBinding) {
-       super(name, targetUri);
-       this.wsPortMetaData = new WebServicePortMetaData(wsBinding.getWSDLDefinition().getDefinition(),
wsBinding.getPort(), wsBinding.getURI(), false);
-       this.serviceClient = createServiceClient(wsBinding.getWSDLDefinition().getDefinition(),
wsPortMetaData);
+        super(name, targetUri);
+        this.wsPortMetaData = new WebServicePortMetaData(wsBinding.getWSDLDefinition().getDefinition(),
wsBinding.getPort(), wsBinding.getURI(), false);
+        this.serviceClient = createServiceClient(wsBinding.getWSDLDefinition().getDefinition(),
wsPortMetaData);
     }
 
     public QName getBindingType() {
-        return BINDING_WS;
+        return WebServiceConstants.BINDING_WS_QNAME;
     }
 
     public TargetInvoker createTargetInvoker(String targetName, Operation operation, boolean
isCallback) throws TargetInvokerCreationException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public TargetInvoker createTargetInvoker(InterfaceContract contract, Operation operation,
boolean isCallback) {
         Axis2TargetInvoker invoker;
-        try {
-            boolean operationHasCallback = contract.getCallbackInterface() != null;
-            if (operationHasCallback) {
-                // FIXME: SDODataBinding needs to pass in TypeHelper and classLoader
-                // as parameters.
-                Axis2AsyncTargetInvoker asyncInvoker =
-                    (Axis2AsyncTargetInvoker) createOperationInvoker(serviceClient,
-                        operation,
-                        wsPortMetaData,
-                        true,
-                        false);
-                // FIXME: This makes the (BIG) assumption that there is only one
-                // callback method
-                // Relaxing this assumption, however, does not seem to be trivial,
-                // it may depend on knowledge
-                // of what actual callback method was invoked by the service at the
-                // other end
-//                Operation callbackOperation = findCallbackOperation();
-                Operation callbackOperation = null;
-                Axis2CallbackInvocationHandler invocationHandler =
-                    new Axis2CallbackInvocationHandler(wire);
-                Axis2ReferenceCallbackTargetInvoker callbackInvoker =
-                    new Axis2ReferenceCallbackTargetInvoker(callbackOperation, wire, invocationHandler);
-                asyncInvoker.setCallbackTargetInvoker(callbackInvoker);
-
-                invoker = asyncInvoker;
-            } else {
-                boolean isOneWay = operation.isNonBlocking();
-                invoker = createOperationInvoker(serviceClient, operation, wsPortMetaData,
false, isOneWay);
-            }
-        } catch (AxisFault e) {
-            throw new Axis2BindingRunTimeException(e);
+//        boolean operationHasCallback = operation.getInterface().contract.getCallbackInterface()
!= null;
+// TODO: this isn't right, need to get the InterfaceContract         
+        if (isCallback) {
+            // FIXME: SDODataBinding needs to pass in TypeHelper and classLoader
+            // as parameters.
+            Axis2AsyncTargetInvoker asyncInvoker =
+                (Axis2AsyncTargetInvoker) createOperationInvoker(serviceClient,
+                    operation,
+                    wsPortMetaData,
+                    true,
+                    false);
+            // FIXME: This makes the (BIG) assumption that there is only one
+            // callback method
+            // Relaxing this assumption, however, does not seem to be trivial,
+            // it may depend on knowledge
+            // of what actual callback method was invoked by the service at the
+            // other end
+//            Operation callbackOperation = findCallbackOperation();
+            Operation callbackOperation = null;
+            Axis2CallbackInvocationHandler invocationHandler =
+                new Axis2CallbackInvocationHandler(wire);
+            Axis2ReferenceCallbackTargetInvoker callbackInvoker =
+                new Axis2ReferenceCallbackTargetInvoker(callbackOperation, wire, invocationHandler);
+            asyncInvoker.setCallbackTargetInvoker(callbackInvoker);
+
+            invoker = asyncInvoker;
+        } else {
+            invoker = createOperationInvoker(serviceClient, operation, wsPortMetaData, false,
operation.isNonBlocking());
         }
         return invoker;
     }
@@ -162,7 +134,7 @@
                                                       Operation m,
                                                       WebServicePortMetaData wsPortMetaData,
                                                       boolean hasCallback,
-                                                      boolean isOneWay) throws AxisFault
{
+                                                      boolean isOneWay) {
         SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
         String portTypeNS = wsPortMetaData.getPortTypeName().getNamespaceURI();
 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message