You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2006/10/07 03:20:45 UTC

svn commit: r453828 - in /incubator/tuscany/java: samples/sca/helloworldws-async/ samples/sca/helloworldws-async/src/main/java/helloworld/ samples/sca/helloworldws-async/src/main/resources/wsdl/ samples/sca/helloworldws-async/src/main/webapp/META-INF/s...

Author: rfeng
Date: Fri Oct  6 18:20:44 2006
New Revision: 453828

URL: http://svn.apache.org/viewvc?view=rev&rev=453828
Log:
1) Replaced some logic on ServiceContract.getCallbackClass() which is java-centric
2) Fixed the wrong usages of operation in the JDKWireService (in some cases, we use the source operation for the target side)
3) Replaced "interface.java" with "interface.wsdl" and fixed some issues in the wsdl file. It's the same workaround as we did on the client side that we have to force the axis2 service to use WSDL interface so that data transformation is triggered.


Modified:
    incubator/tuscany/java/samples/sca/helloworldws-async/pom.xml
    incubator/tuscany/java/samples/sca/helloworldws-async/src/main/java/helloworld/HelloWorldImpl.java
    incubator/tuscany/java/samples/sca/helloworldws-async/src/main/resources/wsdl/helloworld.wsdl
    incubator/tuscany/java/samples/sca/helloworldws-async/src/main/webapp/META-INF/sca/default.scdl
    incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java
    incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java
    incubator/tuscany/java/sca/services/bindings/binding.axis2/pom.xml
    incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Service.java
    incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceCallbackTargetInvoker.java
    incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java
    incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml
    incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml

Modified: incubator/tuscany/java/samples/sca/helloworldws-async/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldws-async/pom.xml?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldws-async/pom.xml (original)
+++ incubator/tuscany/java/samples/sca/helloworldws-async/pom.xml Fri Oct  6 18:20:44 2006
@@ -78,6 +78,12 @@
             <scope>runtime</scope> <!-- runtime is need for webapp integration to include jar -->
         </dependency>        
         <dependency>
+            <groupId>org.apache.tuscany.sca.services.databinding</groupId>
+            <artifactId>databinding-sdo</artifactId>
+            <version>${pom.version}</version>
+            <scope>runtime</scope> <!-- runtime is need for webapp integration to include jar -->
+        </dependency>                
+        <dependency>
             <groupId>org.apache.tuscany.sca.runtime</groupId>
             <artifactId>webapp</artifactId>
             <version>${pom.version}</version>

Modified: incubator/tuscany/java/samples/sca/helloworldws-async/src/main/java/helloworld/HelloWorldImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldws-async/src/main/java/helloworld/HelloWorldImpl.java?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldws-async/src/main/java/helloworld/HelloWorldImpl.java (original)
+++ incubator/tuscany/java/samples/sca/helloworldws-async/src/main/java/helloworld/HelloWorldImpl.java Fri Oct  6 18:20:44 2006
@@ -30,18 +30,24 @@
 @Service(HelloWorldService.class)
 @Scope("MODULE")
 public class HelloWorldImpl implements HelloWorldService {
-    
+
     private HelloWorldCallback helloWorldCallback;
-    
+
     @Callback
-    void setHelloWorldCallback(HelloWorldCallback helloWorldCallback) {
+    public void setHelloWorldCallback(HelloWorldCallback helloWorldCallback) {
         System.err.println("injecting @callback");
         this.helloWorldCallback = helloWorldCallback;
     }
 
     public String getGreetings(String name) {
-        System.err.println("In getGreetings, returning greeting");
-        return "Hola " + name;
+        System.out.println("In getGreetingsWithCallback, invoking callback");
+        try {
+            helloWorldCallback.getGreetingsCallback("Alo " + name);
+        } catch (Throwable t) {
+            t.printStackTrace();
+        }
+        System.out.println("In getGreetingsWithCallback, invoked callback");
+        return "This should not be seen";
     }
 
     public String getGreetings1(DataObject name) {
@@ -51,13 +57,12 @@
     }
 
     public void getGreetingsWithCallback(String name) {
-        //System.err.println("In getGreetingsWithCallback, invoking callback");
-        System.err.println("In getGreetingsWithCallback, invoking callback: " + helloWorldCallback);
+        System.out.println("In getGreetingsWithCallback, invoking callback: " + helloWorldCallback);
         try {
             helloWorldCallback.getGreetingsCallback("Alo " + name);
-        } catch(Throwable t) {
+        } catch (Throwable t) {
             t.printStackTrace();
         }
-        System.err.println("In getGreetingsWithCallback, invoked callback");
+        System.out.println("In getGreetingsWithCallback, invoked callback");
     }
 }

Modified: incubator/tuscany/java/samples/sca/helloworldws-async/src/main/resources/wsdl/helloworld.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldws-async/src/main/resources/wsdl/helloworld.wsdl?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldws-async/src/main/resources/wsdl/helloworld.wsdl (original)
+++ incubator/tuscany/java/samples/sca/helloworldws-async/src/main/resources/wsdl/helloworld.wsdl Fri Oct  6 18:20:44 2006
@@ -70,7 +70,7 @@
                     </sequence>
                 </complexType>
             </element>
-                        
+
             <element name="getGreetingsWithCallback">
                 <complexType>
                     <sequence>
@@ -85,8 +85,8 @@
                         <element name="getGreetingsReturn" type="xsd:string"/>
                     </sequence>
                 </complexType>
-            </element>
-            
+            </element>            
+                        
         </schema>
     </wsdl:types>
 
@@ -98,6 +98,10 @@
         <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
     </wsdl:message>
 
+    <wsdl:message name="getGreetingsCallback">
+        <wsdl:part element="tns:getGreetingsCallback" name="parameters"/>
+    </wsdl:message>
+
     <wsdl:message name="getGreetings1Request">
         <wsdl:part element="tns:getGreetings1" name="parameters"/>
     </wsdl:message>
@@ -169,7 +173,7 @@
 
     <wsdl:service name="HelloWorldService">
         <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
-            <wsdlsoap:address location="http://localhost:8080/sample-helloworldws-async-1.0-SNAPSHOT/services/HelloWorldWebService"/>
+            <wsdlsoap:address location="http://localhost:8080/sample-helloworldws-async-1.0-incubator-M2-SNAPSHOT/services/HelloWorldWebService"/>
         </wsdl:port>
     </wsdl:service>
 

Modified: incubator/tuscany/java/samples/sca/helloworldws-async/src/main/webapp/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldws-async/src/main/webapp/META-INF/sca/default.scdl?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldws-async/src/main/webapp/META-INF/sca/default.scdl (original)
+++ incubator/tuscany/java/samples/sca/helloworldws-async/src/main/webapp/META-INF/sca/default.scdl Fri Oct  6 18:20:44 2006
@@ -23,16 +23,15 @@
     <dbsdo:import.sdo xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0" location="wsdl/helloworld.wsdl" />
 
     <service name="HelloWorldWebService" target="http:///foo">
-        <!-- 
         <interface.wsdl xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance" 
             interface="http://helloworld#wsdl.interface(HelloWorld)" 
             callbackInterface="http://helloworld#wsdl.interface(HelloWorldCallback)"
             wsdli:wsdlLocation="http://helloworld wsdl/helloworld.wsdl" />
-        <interface.java interface="helloworld.HelloWorldService"/>
-        -->
         
+        <!-- 
         <interface.java interface="helloworld.HelloWorldService"
                         callbackInterface="helloworld.HelloWorldCallback"/>
+        -->
 
         <!--FIXME the location attribute is a really bad hack here!  does not follow to spec at all 
         -->

Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java Fri Oct  6 18:20:44 2006
@@ -225,6 +225,7 @@
                 e.setIdentifier(sourceWire.getReferenceName());
                 throw e;
             }
+            Operation<?> inboundOperation = inboundChain.getOperation();
             boolean isOneWayOperation = operation.isNonBlocking();
             boolean operationHasCallback = contract.getCallbackName() != null;
             if (isOneWayOperation && operationHasCallback) {
@@ -234,9 +235,8 @@
             if (target instanceof Component) {
                 Component component = (Component) target;
                 if (isOneWayOperation || operationHasCallback) {
-                    invoker = component.createAsyncTargetInvoker(targetWire, operation);
+                    invoker = component.createAsyncTargetInvoker(targetWire, inboundOperation);
                 } else {
-                    Operation<?> inboundOperation = inboundChain.getOperation();
                     String portName = sourceWire.getTargetName().getPortName();
                     invoker = component.createTargetInvoker(portName, inboundOperation);
                 }
@@ -244,11 +244,10 @@
                 Reference reference = (Reference) target;
                 if (!(reference instanceof CompositeReference) && operationHasCallback) {
                     // Notice that for bound references we only use async target invokers for callback operations
-                    invoker = reference.createAsyncTargetInvoker(sourceWire, operation);
+                    invoker = reference.createAsyncTargetInvoker(sourceWire, inboundOperation);
                 } else {
                     ServiceContract targetContract = targetWire.getServiceContract();
-                    Operation targetOperation = inboundChain.getOperation();
-                    invoker = reference.createTargetInvoker(targetContract, targetOperation);
+                    invoker = reference.createTargetInvoker(targetContract, inboundOperation);
                 }
             } else if (target instanceof CompositeService) {
                 CompositeService compServ = (CompositeService) target;

Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java Fri Oct  6 18:20:44 2006
@@ -246,9 +246,8 @@
             wire.addInvocationChain(operation, chain);
 
         }
-        Class<?> callbackInterface = contract.getCallbackClass();
-        if (callbackInterface != null) {
-            wire.setCallbackInterface(callbackInterface);
+        if (contract.getCallbackName() != null) {
+            wire.setCallbackInterface(contract.getCallbackClass());
             for (Operation<?> operation : contract.getCallbackOperations().values()) {
                 InboundInvocationChain callbackTargetChain = createInboundChain(operation);
                 // TODO handle policy
@@ -272,8 +271,7 @@
             chain.addInterceptor(new InvokerInterceptor());
             wire.addInvocationChain(operation, chain);
         }
-        Class<?> callbackInterface = contract.getCallbackClass();
-        if (callbackInterface != null) {
+        if (contract.getCallbackName() != null) {
             wire.setCallbackReferenceName(service.getCallbackReferenceName());
         }
         return wire;
@@ -305,9 +303,8 @@
         }
 
         // Add target callback chain to outbound wire, applicable to both bound and bindless services
-        Class<?> callbackInterface = contract.getCallbackClass();
-        if (callbackInterface != null) {
-            outboundWire.setCallbackInterface(callbackInterface);
+        if (contract.getCallbackName() != null) {
+            outboundWire.setCallbackInterface(contract.getCallbackClass());
             for (Operation<?> operation : contract.getCallbackOperations().values()) {
                 InboundInvocationChain callbackTargetChain = createInboundChain(operation);
 // TODO handle policy

Modified: incubator/tuscany/java/sca/services/bindings/binding.axis2/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.axis2/pom.xml?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.axis2/pom.xml (original)
+++ incubator/tuscany/java/sca/services/bindings/binding.axis2/pom.xml Fri Oct  6 18:20:44 2006
@@ -49,13 +49,6 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.tuscany.sca.services.databinding</groupId>
-            <artifactId>databinding-sdo</artifactId>
-            <version>${sca.version}</version>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
         </dependency>

Modified: incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Service.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Service.java?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Service.java (original)
+++ incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Service.java Fri Oct  6 18:20:44 2006
@@ -74,6 +74,8 @@
     private WorkContext workContext;
 
     private Map<MessageId, InvocationContext> invCtxMap = new HashMap<MessageId, InvocationContext>();
+    
+    private String serviceName;
 
     public Axis2Service(String theName,
                         ServiceContract<?> serviceContract,
@@ -91,6 +93,7 @@
         this.servletHost = servletHost;
         this.configContext = configContext;
         this.workContext = workContext;
+        this.serviceName = theName;
     }
 
     public void start() {
@@ -188,6 +191,7 @@
 
             Message msg = new MessageImpl();
             msg.setTargetInvoker(chain.getTargetInvoker());
+            msg.setFromAddress(getFromAddress());
             if (messageId == null) {
                 messageId = new MessageId();
             }
@@ -210,6 +214,10 @@
             }
             return body;
         }
+    }
+    
+    protected Object getFromAddress() {
+        return this.serviceName;
     }
 
     /**

Modified: incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceCallbackTargetInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceCallbackTargetInvoker.java?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceCallbackTargetInvoker.java (original)
+++ incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceCallbackTargetInvoker.java Fri Oct  6 18:20:44 2006
@@ -33,10 +33,12 @@
 import org.apache.tuscany.spi.wire.TargetInvoker;
 
 public class Axis2ServiceCallbackTargetInvoker implements TargetInvoker {
-    
+
     private WorkContext workContext;
     private Axis2Service service;
-    
+
+    private MessageId currentCorrelationId;
+
     public Axis2ServiceCallbackTargetInvoker(WorkContext workContext, Axis2Service service) {
         this.workContext = workContext;
         this.service = service;
@@ -45,32 +47,48 @@
     public Object invokeTarget(final Object payload) throws InvocationTargetException {
         try {
             // Use correlation id in context as index to retrieve inv context
-            MessageId correlationId = (MessageId)workContext.getCurrentCorrelationId();
-            InvocationContext invCtx = service.retrieveMapping(correlationId);
-            
+            // MessageId correlationId =
+            // (MessageId)workContext.getCurrentCorrelationId();
+            // InvocationContext invCtx =
+            // service.retrieveMapping(correlationId);
+
+            InvocationContext invCtx = service.retrieveMapping(this.currentCorrelationId);
+
             MessageContext outMC = Utils.createOutMessageContext(invCtx.inMessageContext);
-            outMC.getOperationContext().addMessageContext(invCtx.inMessageContext);  // REVIEW was adding newmsgCtx !
+            outMC.getOperationContext().addMessageContext(invCtx.inMessageContext); // REVIEW
+                                                                                    // was
+                                                                                    // adding
+                                                                                    // newmsgCtx
+                                                                                    // !
 
-            OMElement responseOM = (OMElement) payload;
+            OMElement responseOM = null;
+            if (payload != null && !payload.getClass().isArray()) {
+                responseOM = (OMElement)payload;
+            } else {
+                responseOM = (OMElement)((Object[])payload)[0];
+            }
             SOAPEnvelope soapEnvelope = invCtx.soapFactory.getDefaultEnvelope();
             soapEnvelope.getBody().addChild(responseOM);
             outMC.setEnvelope(soapEnvelope);
             outMC.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE);
 
             AxisEngine engine =
-                new AxisEngine(invCtx.inMessageContext.getOperationContext().getServiceContext().getConfigurationContext());
+                new AxisEngine(invCtx.inMessageContext.getOperationContext().getServiceContext()
+                    .getConfigurationContext());
             engine.send(outMC);
-            
-            service.removeMapping(correlationId);
-        } catch(AxisFault e) {
+
+            // service.removeMapping(correlationId);
+            service.removeMapping(this.currentCorrelationId);
+        } catch (AxisFault e) {
             throw new InvocationTargetException(e);
         }
-        
+
         return Axis2AsyncTargetInvoker.RESPONSE;
     }
 
     public Message invoke(Message msg) throws InvocationRuntimeException {
         try {
+            this.currentCorrelationId = (MessageId)msg.getCorrelationId();
             Object resp = invokeTarget(msg.getBody());
             msg.setBody(resp);
         } catch (Throwable e) {
@@ -81,7 +99,7 @@
 
     public Axis2ServiceCallbackTargetInvoker clone() throws CloneNotSupportedException {
         try {
-            return (Axis2ServiceCallbackTargetInvoker) super.clone();
+            return (Axis2ServiceCallbackTargetInvoker)super.clone();
         } catch (CloneNotSupportedException e) {
             // will not happen
             return null;

Modified: incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java (original)
+++ incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java Fri Oct  6 18:20:44 2006
@@ -21,18 +21,16 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.receivers.AbstractInOutAsyncMessageReceiver;
+import org.apache.axis2.receivers.AbstractMessageReceiver;
 import org.apache.tuscany.binding.axis2.Axis2Service.InvocationContext;
 import org.apache.tuscany.spi.component.WorkContext;
 import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.wire.InvocationRuntimeException;
 import org.apache.tuscany.spi.wire.MessageId;
 
-public class Axis2ServiceInOutAsyncMessageReceiver extends AbstractInOutAsyncMessageReceiver {
+public class Axis2ServiceInOutAsyncMessageReceiver extends AbstractMessageReceiver {
 
     private Operation<?> operation;
 
@@ -51,8 +49,31 @@
     public Axis2ServiceInOutAsyncMessageReceiver() {
     }
 
-    @Override
-    public void invokeBusinessLogic(MessageContext inMC, MessageContext outMC) throws AxisFault {
+    /*
+     * @Override public void invokeBusinessLogic(MessageContext inMC,
+     * MessageContext outMC) throws AxisFault { try { // Create a new message id
+     * and hand it to // JDKInboundInvocationHandler // via work context
+     * MessageId messageId = new MessageId();
+     * workContext.setCurrentMessageId(messageId); // Now use message id as
+     * index to context to be used by callback // target invoker
+     * InvocationContext invCtx = service.new InvocationContext(inMC, operation,
+     * getSOAPFactory(inMC)); service.addMapping(messageId, invCtx); OMElement
+     * requestOM = inMC.getEnvelope().getBody().getFirstElement(); Object[] args =
+     * new Object[] {requestOM}; // FIXME: It seems that the AsyncTargetInvoker
+     * always returns null OMElement responseOM =
+     * (OMElement)service.invokeTarget(operation, args); SOAPEnvelope
+     * soapEnvelope = getSOAPFactory(inMC).getDefaultEnvelope(); if (responseOM !=
+     * null) { soapEnvelope.getBody().addChild(responseOM); }
+     * outMC.setEnvelope(soapEnvelope);
+     * outMC.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN,
+     * Constants.VALUE_TRUE); } catch (InvocationTargetException e) { Throwable
+     * t = e.getCause(); if (t instanceof Exception) { throw
+     * AxisFault.makeFault((Exception)t); } throw new
+     * InvocationRuntimeException(e); } catch (Exception e) { throw
+     * AxisFault.makeFault(e); } }
+     */
+
+    public final void receive(final MessageContext messageCtx) {
         try {
             // Create a new message id and hand it to
             // JDKInboundInvocationHandler
@@ -61,22 +82,21 @@
             workContext.setCurrentMessageId(messageId);
             // Now use message id as index to context to be used by callback
             // target invoker
-            InvocationContext invCtx = service.new InvocationContext(inMC, operation, getSOAPFactory(inMC));
+            InvocationContext invCtx =
+                service.new InvocationContext(messageCtx, operation, getSOAPFactory(messageCtx));
             service.addMapping(messageId, invCtx);
 
+            invokeBusinessLogic(messageCtx);
+        } catch (AxisFault e) {
+            // log.error(e);
+        }
+    }
+
+    public void invokeBusinessLogic(MessageContext inMC) throws AxisFault {
+        try {
             OMElement requestOM = inMC.getEnvelope().getBody().getFirstElement();
             Object[] args = new Object[] {requestOM};
-
-            // FIXME: It seems that the AsyncTargetInvoker always returns null
-            OMElement responseOM = (OMElement)service.invokeTarget(operation, args);
-
-            SOAPEnvelope soapEnvelope = getSOAPFactory(inMC).getDefaultEnvelope();
-            if (responseOM != null) {
-                soapEnvelope.getBody().addChild(responseOM);
-            }
-            outMC.setEnvelope(soapEnvelope);
-            outMC.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE);
-
+            service.invokeTarget(operation, args);
         } catch (InvocationTargetException e) {
             Throwable t = e.getCause();
             if (t instanceof Exception) {

Modified: incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml (original)
+++ incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml Fri Oct  6 18:20:44 2006
@@ -24,24 +24,59 @@
     <parameter name="hotdeployment" locked="false">false</parameter>
     <parameter name="hotupdate" locked="false">false</parameter>
     <parameter name="enableMTOM" locked="false">false</parameter>
-    <!-- Uncomment this to enable REST support -->
-    <!--    <parameter name="enableREST" locked="false">true</parameter>-->
+    <parameter name="enableSwA" locked="false">false</parameter>
 
+    <!--Uncomment if you want to enable file caching for attachments -->
+    <!--parameter name="cacheAttachments" locked="false">true</parameter>
+    <parameter name="attachmentDIR" locked="false"></parameter>
+    <parameter name="sizeThreshold" locked="false">4000</parameter-->
+
+    <!--This will give out the timout of the configuration contexts, in seconds-->
+    <parameter name="ConfigContextTimeoutInterval" locked="false">30</parameter>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults" locked="false">true</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+    <parameter name="DrillDownToRootCauseForFaultReason" locked="false">false</parameter>
 
     <parameter name="userName" locked="false">admin</parameter>
     <parameter name="password" locked="false">axis2</parameter>
 
-    <parameter name="seralizeLocation" locked="false">.</parameter>
-    <hostConfiguration>
-        <ip>127.0.0.1</ip>
-        <port>5555</port>
-    </hostConfiguration>
+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
+    <!--root which can configured using the following contextRoot parameter-->
+    <!--<parameter name="contextRoot" locked="false">axis2</parameter>-->
 
+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush those endpoints-->
+    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
+    <!--context path to proper Axis2 servlets-->
+    <!--<parameter name="servicePath" locked="false">services</parameter>-->
+    <!--<parameter name="restPath" locked="false">rest</parameter>-->
 
-    <!--if you want to extract the service archive file and work with that please uncomment this-->
-    <!--else , it wont extract archive file or does not take into consideration if someone drop-->
-    <!--exploded directory into /service directory-->
-    <!--<parameter name="extractServiceArchive" locked="false">true</parameter>-->
+
+    <!--Set the flag to true if you want to enable transport level session mangment-->
+    <parameter name="manageTransportSession" locked="false">false</parameter>
+
+    <!--Following two parameters will be used to handle REST in Axis2. The default settings will make Axis2 to have two-->
+    <!--different endpoints, one for REST (AxisRESTServlet) one for SOAP message handling (AxisServlet). But following-->
+    <!--parameters help to tweak the message handling of two main servlets. -->
+
+    <!-- If the enableRESTInAxis2MainServlet is true, then Axis2MainServlet will handle both SOAP and REST messages -->
+    <parameter name="enableRESTInAxis2MainServlet" locked="true">false</parameter>
+
+    <!-- Following parameter will completely disable REST handling in both the servlets-->
+    <parameter name="disableREST" locked="true">false</parameter>
+
+    <!-- This will disable the separate servlet we have for REST handling. -->
+    <parameter name="disableSeparateEndpointForREST" locked="true">false</parameter>
+
+    <!-- If you have a frontend host which exposes this webservice using a different public URL  -->
+    <!-- use this parameter to override autodetected url -->
+    <!--<parameter name="httpFrontendHostUrl" locked="false">https://someotherhost/context</parameter>-->
 
 
     <!--    The way of adding listener to the system-->
@@ -69,39 +104,81 @@
     <!-- ================================================= -->
     <!-- Transport Ins -->
     <!-- ================================================= -->
-    <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
+    <transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
         <parameter name="port" locked="false">6060</parameter>
+        <!-- Here is the complete list of supported parameters (see example settings further below):
+            port: the port to listen on (default 6060)
+            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
+            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
+            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
+            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
+                                false to minimize bandwidth consumption by combining segments
+            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
+            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills us         (default 150)
+                                       note that default queue never fills up:  see HttpFactory
+            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
+                                  note that no such threads can exist with default unbounded request queue
+            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
+        -->
+        <!-- <parameter name="hostname"                  locked="false">http://www.myApp.com/ws</parameter> -->
+        <!-- <parameter name="originServer"              locked="false">My-Server/1.1</parameter>           -->
+        <!-- <parameter name="requestTimeout"            locked="false">10000</parameter>                   -->
+        <!-- <parameter name="requestTcpNoDelay"         locked="false">false</parameter>                   -->
+        <!-- <parameter name="requestCoreThreadPoolSize" locked="false">50</parameter>                      -->
+        <!-- <parameter name="RequestMaxThreadPoolSize"  locked="false">100</parameter>                     -->
+        <!-- <parameter name="threadKeepAliveTime"       locked="false">240000</parameter>                  -->
+        <!-- <parameter name="threadKeepAliveTimeUnit"   locked="false">MILLISECONDS</parameter>            -->
     </transportReceiver>
+    
+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+        <parameter name="myTopicConnectionFactory" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="myQueueConnectionFactory" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="default" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+    </transportReceiver>-->
+
+    <!--Uncomment if you want to have SMTP transport support-->
+    <!--<transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">-->
+    <!--<parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>-->
+    <!--<parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.port" locked="false">110</parameter>-->
+    <!--<parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>-->
+    <!--</transportReceiver>-->
 
-    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
-    <transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">
-          <parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>
-          <parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>
-          <parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>
-          <parameter name="transport.mail.pop3.port" locked="false">110</parameter>
-          <parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>
-      </transportReceiver> -->
-
-    <!--REMOVED FOR TUSCANY  transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer">
+    <transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
         <parameter name="port" locked="false">6060</parameter>
-    </transportReceiver -->
-
-    <!--REMOVED FOR TUSCANY transportReceiver name="jms" class="org.apache.axis2.transport.jms.SimpleJMSListener">
-        <parameter name="transport.jms.Destination" locked="false">dynamicQueues/FOO</parameter>
-        <parameter name="java.naming.factory.initial" locked="false">
-            org.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncommet following paramter , and set as you required.-->
+        <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
     </transportReceiver>
-    -->
 
     <!-- ================================================= -->
     <!-- Transport Outs -->
     <!-- ================================================= -->
 
-    <!--REMOVED FOR TUSCANY transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/> -->
-    <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
-    <!--REMOVED FOR TUSCANY transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/> -->
-    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+    <transportSender name="tcp"
+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
         <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
         <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
     </transportSender>
@@ -110,7 +187,12 @@
         <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
         <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
     </transportSender>
-
+    
+    <!-- Commented out by Tuscany 
+    <transportSender name="jms"
+                     class="org.apache.axis2.transport.jms.JMSSender"/>
+     -->
+     
     <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
    <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
        <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
@@ -124,8 +206,9 @@
     <!-- Global Modules  -->
     <!-- ================================================= -->
     <!-- Comment this to disable Addressing -->
-    <!--REMOVED FOR TUSCANY  module ref="addressing"/> -->
-
+    <!--  Commented out by Tuscany
+    <module ref="addressing"/>
+    -->
 
     <!--Configuring module , providing parameters for modules whether they refer or not-->
     <!--<moduleConfig name="addressing">-->
@@ -140,11 +223,11 @@
         <phase name="Transport">
             <handler name="RequestURIBasedDispatcher"
                      class="org.apache.axis2.engine.RequestURIBasedDispatcher">
-                <order phase="Dispatch"/>
+                <order phase="Transport"/>
             </handler>
             <handler name="SOAPActionBasedDispatcher"
                      class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
-                <order phase="Dispatch"/>
+                <order phase="Transport"/>
             </handler>
         </phase>
         <phase name="Security"/>
@@ -161,7 +244,7 @@
             </handler>
             <handler name="InstanceDispatcher"
                      class="org.apache.axis2.engine.InstanceDispatcher">
-                <order phase="PostDispatch"/>
+                <order phase="Dispatch"/>
             </handler>
         </phase>
         <!--  System pre defined phases       -->
@@ -175,6 +258,7 @@
         <!--these phase will run irrespective of the service-->
         <phase name="PolicyDetermination"/>
         <phase name="MessageOut"/>
+        <phase name="Security"/>
     </phaseOrder>
     <phaseOrder type="InFaultFlow">
         <phase name="PreDispatch"/>

Modified: incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml?view=diff&rev=453828&r1=453827&r2=453828
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml Fri Oct  6 18:20:44 2006
@@ -48,7 +48,7 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
-			<groupId>org.apache.ws.commons.axiom</groupId>
+			<groupId>org.apache.ws.commons</groupId>
 			<artifactId>axiom-api</artifactId>
 		</dependency>
 
@@ -57,7 +57,7 @@
             <artifactId>junit</artifactId>
         </dependency>
 		<dependency>
-			<groupId>org.apache.ws.commons.axiom</groupId>
+			<groupId>org.apache.ws.commons</groupId>
 			<artifactId>axiom-impl</artifactId>
 			<scope>test</scope>
 		</dependency>



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