tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r529090 - in /incubator/tuscany/java/sca/modules/binding-ws-axis2: ./ src/main/assembly/ src/main/java/org/apache/tuscany/binding/axis2/ src/main/resources/org/apache/tuscany/binding/axis2/engine/config/ src/test/java/org/apache/tuscany/bin...
Date Sun, 15 Apr 2007 23:08:07 GMT
Author: antelder
Date: Sun Apr 15 16:08:06 2007
New Revision: 529090

URL: http://svn.apache.org/viewvc?view=rev&rev=529090
Log:
Axis2 binding bring up, get WS services going and add a service to the helloworld testcase

Added:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldService.java   (with props)
Modified:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/assembly/axis2.xml
    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/Axis2ModuleActivator.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceBinding.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceServlet.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/TuscanyDispatcher.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/HelloWorld.composite

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml?view=diff&rev=529090&r1=529089&r2=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml Sun Apr 15 16:08:06 2007
@@ -95,6 +95,17 @@
             <artifactId>tuscany-databinding-axiom</artifactId>
             <version>1.0-incubating-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-http</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-http-jetty</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
             <dependency>
                 <groupId>org.apache.axis2</groupId>
                 <artifactId>axis2-kernel</artifactId>

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/assembly/axis2.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/assembly/axis2.xml?view=diff&rev=529090&r1=529089&r2=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/assembly/axis2.xml (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/assembly/axis2.xml Sun Apr 15 16:08:06 2007
@@ -7,32 +7,300 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.
+ * under the License.    
 -->
-<assembly>
-    <id>bin</id>
-    <includeBaseDirectory>false</includeBaseDirectory>
-    <formats>
-        <format>zip</format>
-        <format>tar.gz</format>
-    </formats>
-
-    <dependencySets>
-        <dependencySet>
-            <outputDirectory>extension</outputDirectory>
-            <includes>
-                <include>org.apache.tuscany.bindings:axis2</include>
-            </includes>
-            <fileMode>644</fileMode>
-        </dependencySet>
-    </dependencySets>
-</assembly>
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment" locked="false">false</parameter>
+    <parameter name="hotupdate" locked="false">false</parameter>
+    <parameter name="enableMTOM" locked="false">false</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>
+
+    <!--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>-->
+
+
+    <!--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">true</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-->
+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
+    <!--        <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>-->
+    <!--    </listener>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+    <!--any operation -->
+    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
+    <messageReceivers>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+                         class="org.apache.tuscany.binding.axis2.Axis2ServiceInMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+                         class="org.apache.tuscany.binding.axis2.Axis2ServiceInOutAsyncMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+                         class="org.apache.tuscany.binding.axis2.Axis2ServiceInOutSyncMessageReceiver"/>
+    </messageReceivers>
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <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>-->
+
+    <transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port" locked="false">6060</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 -->
+    <!-- ================================================= -->
+
+    <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>
+    <transportSender name="https"
+                     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>
+    
+    <!-- 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>
+       <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
+   </transportSender>
+   -->
+
+    <!-- ================================================= -->
+    <!-- Global Modules  -->
+    <!-- ================================================= -->
+    <!-- Comment this to disable Addressing -->
+    <!--  Commented out by Tuscany
+    <module ref="addressing"/>
+    -->
+
+    <!--Configuring module , providing parameters for modules whether they refer or not-->
+    <!--<moduleConfig name="addressing">-->
+    <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->
+    <!--</moduleConfig>-->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport">
+            <handler name="TuscanyDispatcher"
+                     class="org.apache.tuscany.binding.axis2.TuscanyDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+        </phase>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="OperationInPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFlow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationOutPhase"/>
+        <!--system predefined phase-->
+        <!--these phase will run irrespective of the service-->
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="PostDispatch"/>
+            </handler>
+        </phase>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationInFaultPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFaultFlow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+    </phaseOrder>
+</axisconfig>
 

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=529090&r1=529089&r2=529090
==============================================================================
--- 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 16:08:06 2007
@@ -19,15 +19,23 @@
 package org.apache.tuscany.binding.axis2;
 
 import java.net.URI;
+import java.util.List;
+
+import javax.wsdl.Port;
+import javax.wsdl.extensions.soap.SOAPAddress;
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.tuscany.assembly.CompositeReference;
+import org.apache.tuscany.assembly.CompositeService;
 import org.apache.tuscany.binding.axis2.util.TuscanyAxisConfigurator;
 import org.apache.tuscany.binding.ws.WebServiceBinding;
+import org.apache.tuscany.http.ServletHostExtensionPoint;
+import org.apache.tuscany.interfacedef.InterfaceContract;
 import org.apache.tuscany.spi.builder.BuilderException;
 import org.apache.tuscany.spi.component.ReferenceBinding;
+import org.apache.tuscany.spi.component.ServiceBinding;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.extension.BindingBuilderExtension;
 
@@ -40,7 +48,7 @@
     // TODO: what to do about the base URI?
     private static final String BASE_URI = "http://localhost:8080/";
 
-//    private ServletHost servletHost;
+    private ServletHostExtensionPoint servletHost;
 
     private ConfigurationContext configContext;
 //
@@ -50,168 +58,43 @@
         initAxis();
     }
 
-//    public void setServletHost(ServletHost servletHost) {
-//        this.servletHost = servletHost;
-//    }
-//
-//    public void setWorkContext(WorkContext workContext) {
-//        this.workContext = workContext;
-//    }
+    public void setServletHost(ServletHostExtensionPoint servletHost) {
+        this.servletHost = servletHost;
+    }
 
     @Override
     protected Class<WebServiceBinding> getBindingType() {
         return WebServiceBinding.class;
     }
 
-    public ReferenceBinding build(CompositeReference compositeReference,
-                                  WebServiceBinding wsBinding,
-                                  DeploymentContext context) throws BuilderException {
-        compositeReference.getInterfaceContract().getInterface().setDefaultDataBinding(OMElement.class.getName());
-        
+    @Override
+    public ReferenceBinding build(CompositeReference compositeReference, WebServiceBinding wsBinding, DeploymentContext context) throws BuilderException {
+
+        // Set to use the Axiom data binding 
+        compositeReference.getInterfaceContract().getInterface().setDefaultDataBinding(OMElement.class.getName());        
+
         URI targetURI = wsBinding.getURI() != null ? URI.create(wsBinding.getURI()) : URI.create("foo");
-        return new Axis2ReferenceBinding(URI.create(context.getComponentId() + "#" + wsBinding.getName()), targetURI, wsBinding);
+        URI name = URI.create(context.getComponentId() + "#" + wsBinding.getName());
+
+        return new Axis2ReferenceBinding(name, targetURI, wsBinding);
     }
-    
-//    @SuppressWarnings("unchecked")
-//    public ServiceBinding build(
-//        ServiceDefinition serviceDefinition,
-//        WebServiceBindingDefinition wsBinding, DeploymentContext deploymentContext) {
-//
-//        try {
-//            // Set the default databinding
-//            ServiceContract outboundContract = serviceDefinition.getServiceContract();
-//            if (outboundContract instanceof WSDLServiceContract) {
-//                outboundContract.setDataBinding(OM_DATA_BINDING);
-//            }
-//
-//            // TODO: TUSCANY-1148, <binding.ws> with no wsdl only works with <interface.wsdl>
-//            if (wsBinding.getWSDLDefinition() == null) {
-//                if (outboundContract instanceof WSDLServiceContract) {
-//                    String ns = ((WSDLServiceContract)outboundContract).getPortType().getQName().getNamespaceURI();
-//                    wsBinding.setWSDLDefinition(wsdlReg.getDefinition(ns));
-//                } else {
-//                    throw new IllegalStateException("<binding.ws> with no WSDL requires using <interface.wsdl>");
-//                }
-//            }
-//
-//            // FIXME: We need to define how the WSDL PortType is honored in the case that
-//            // both the service.ws and interface.wsdl are in place.
-//            // The WSDL portType from the WSDL Port decides the incoming SOAP message format
-//            // There are also cases that interface.java is used.
-//
-//            ServiceContract<?> inboundContract;
-//            Port port = wsBinding.getWSDLPort();
-//            if (port == null) {
-//                // FIXME: [rfeng] No WSDL is referenced by service.ws, we need to create one from
-//                // the outbound service contract if it's JavaServiceContract
-//                inboundContract = outboundContract;
-//            }
-//
-//            PortType portType = wsBinding.getWSDLPort().getBinding().getPortType();
-//            inboundContract = introspector.introspect(portType);
-//
-//            // FIXME:  
-//            inboundContract.setInterfaceClass(serviceDefinition.getServiceContract().getInterfaceClass());
-//            inboundContract.setDataBinding(OM_DATA_BINDING);
-//            inboundContract.setCallbackName(serviceDefinition.getServiceContract().getCallbackName());
-//            
-////            inboundContract.setInteractionScope(serviceDefinition.getServiceContract().getInteractionScope()); // TODO: gone
-//
-//// TODO: gone            
-////            try {
-////                wireService.checkCompatibility(inboundContract, outboundContract, true);
-////            } catch (IncompatibleServiceContractException e) {
-////                throw new Axis2BindingBuilderRuntimeException(e);
-////            }
-//
-//            URI axisServiceName;
-//            if (wsBinding.isSpec10Compliant()) {
-//                wsBinding.setActualURI(computeActualURI(wsBinding, BASE_URI, serviceDefinition.getTarget(), serviceDefinition.getUri()));
-//                String name = wsBinding.getActualURI().getPath();
-//                if (name != null && name.length() > 1 && name.startsWith("/")) {
-//                    name = name.substring(1);
-//                }
-//                axisServiceName = URI.create(name);
-//            } else {
-//                axisServiceName = serviceDefinition.getUri();  // TODO: verify name
-//            }
-//
-//            ServiceBinding serviceBinding =
-//                new Axis2ServiceBinding(axisServiceName, outboundContract, inboundContract, wsBinding,
-//                    servletHost, configContext, workContext);
-//            return serviceBinding;
-//
-//        } catch (InvalidServiceContractException e) {
-//            throw new Axis2BindingBuilderRuntimeException(e);
-//        }
-//    }
-//
-//    @SuppressWarnings("unchecked")
-//    @Override
-//    public ReferenceBinding buildx(
-//        ReferenceDefinition boundReferenceDefinition,
-//        WebServiceBinding wsBinding,
-//        DeploymentContext deploymentContext) {
-//
-//        // Set the default binding
-//        ServiceContract inboundContract = boundReferenceDefinition.getServiceContract();
-//        if (inboundContract instanceof WSDLServiceContract) {
-//            inboundContract.setDataBinding(OM_DATA_BINDING);
-//        }
-//
-//        // TODO: TUSCANY-1148, <binding.ws> with no wsdl only works with <interface.wsdl>
-//        if (wsBinding.getWSDLDefinition() == null) {
-//            if (inboundContract instanceof WSDLServiceContract) {
-//                String ns = ((WSDLServiceContract)inboundContract).getPortType().getQName().getNamespaceURI();
-//                wsBinding.setWSDLDefinition(wsdlReg.getDefinition(ns));
-//            } else {
-//                throw new IllegalStateException("<binding.ws> with no WSDL requires using <interface.wsdl>");
-//            }
-//        }
-//
-//        // FIXME: We need to define how the WSDL PortType is honored in the case that
-//        // both the binding.ws and interface.wsdl are in place
-//        // The WSDL portType from the WSDL Port decides the incoming SOAP message format
-//
-//        ServiceContract<?> outboundContract = inboundContract;
-//        Port port = wsBinding.getWSDLPort();
-//        if (port == null) {
-//            // FIXME: [rfeng] No WSDL is referenced by binding.ws, we need to create one from
-//            // the inbound service contract if it's JavaServiceContract
-//            outboundContract = inboundContract;
-//        }
-//        PortType portType = port.getBinding().getPortType();
-//        try {
-//            outboundContract = introspector.introspect(portType);
-//        } catch (InvalidServiceContractException e) {
-//            new Axis2BindingBuilderRuntimeException(e);
-//        }
-//
-//        // Set the default databinding
-//        outboundContract.setDataBinding(OM_DATA_BINDING);
-//        //FIXME ... need to figure out how to specify scope on wsdl.
-////        outboundContract.setInteractionScope(inboundContract.getInteractionScope()); // methdod gone
-//
-//// TODO: gone        
-////        try {
-////            wireService.checkCompatibility(inboundContract, outboundContract, true);
-////        } catch (IncompatibleServiceContractException e) {
-////            throw new Axis2BindingBuilderRuntimeException(e);
-////        }
-//
-//        if (wsBinding.isSpec10Compliant()) {
-//            wsBinding.setActualURI(computeActualURI(wsBinding, BASE_URI, null, boundReferenceDefinition.getUri()));
-//        }
-//
-//        return new Axis2ReferenceBinding(boundReferenceDefinition.getUri(), wsBinding,
-//            inboundContract, outboundContract, workContext);
-//
-//    }
-//
-//    protected Class<WebServiceBindingDefinition> getBindingType() {
-//        return WebServiceBindingDefinition.class;
-//    }
-//
+
+    @Override
+    public ServiceBinding build(CompositeService compositeService, WebServiceBinding wsBinding, DeploymentContext context) throws BuilderException {
+
+        InterfaceContract interfaceContract = compositeService.getInterfaceContract();
+        
+        // Set to use the Axiom data binding 
+        interfaceContract.getInterface().setDefaultDataBinding(OMElement.class.getName());        
+
+        URI name = URI.create(context.getComponentId() + "#" + wsBinding.getName());
+        URI uri = computeActualURI(wsBinding, BASE_URI, name, compositeService.getName()).normalize();
+
+        ServiceBinding serviceBinding = new Axis2ServiceBinding(uri, interfaceContract, null, wsBinding, servletHost, configContext, null);
+
+        return serviceBinding;
+    }
+
     protected void initAxis() {
         // TODO: consider having a system component wrapping the Axis2 ConfigContext
         try {
@@ -220,93 +103,103 @@
             throw new RuntimeException(e); // TODO better exception
         }
     }
-//    
-//    /**
-//     * Compute the endpoint URI based on section 2.1.1 of the WS binding spec
-//     * 1. The URIs in the endpoint(s) of the referenced WSDL, which may be relative
-//     * 2. The URI specified by the wsa:Address element of the wsa:EndpointReference, which may be relative
-//     * 3. The explicitly stated URI in the "uri" attribute of the binding.ws element, which may be relative,
-//     * 4. The implicit URI as defined by in section 1.7 in the SCA Assembly spec 
-//     * If the <binding.ws> has no wsdlElement but does have a uri attribute then the uri takes precidence
-//     * over any implicitly used WSDL.
-//     * @param parent 
-//     */
-//    protected URI computeActualURI(WebServiceBindingDefinition wsBinding, String baseURI, URI componentURI, URI bindingName) {
-//        URI wsdlURI = null;         
-//        if (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null) {
-//            // <binding.ws> explicitly points at a wsdl port, may be a relative URI
-//            wsdlURI = wsBinding.getPortURI();
-//        }
-//        if (wsdlURI != null && wsdlURI.isAbsolute()) {
-//            if (wsBinding.getURI() != null && (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null)) {
-//                throw new IllegalArgumentException("binding URI cannot be used with absolute WSDL endpoint URI");
-//            }
-//            return URI.create(wsdlURI.toString());
-//        }
-//        
-//        // there is no wsdl port endpoint URI or that URI is relative
-//        
-//        URI bindingURI = null;
-//        if (wsBinding.getURI() != null) {
-//            bindingURI = URI.create(wsBinding.getURI());
-//        }
-//
-//        if (bindingURI != null && bindingURI.isAbsolute()) {
-//            if (wsdlURI != null) {
-//                return URI.create(bindingURI + "/" + wsdlURI).normalize();
-//            } else {
-//                return bindingURI;
-//            }
-//        }
-//        
-//        if (componentURI == null) { // null for references
-//            wsdlURI = wsBinding.getPortURI();
-//            if (bindingURI != null) {
-//                return URI.create(wsdlURI + "/" + bindingURI).normalize();
-//            } else {
-//                return wsdlURI;
-//            }
-//        }
-//        
-//
-//        // TODO: TUSCANY-xxx, how to tell if component has multiple services using <binding.ws>?
-//        //        boolean singleService = (parent != null) && (((Component)parent.getChild(componentURI.toString())).getInboundWires().size() == 1);
-//        //        if (bindingURI == null && !singleService) {
-//
-//        if (bindingURI == null) {
-//            bindingURI = bindingName;
-//        }
-//
-//        if (componentURI.isAbsolute()) {
-//            if (bindingURI == null && wsdlURI == null) {
-//                return componentURI;
-//            } else if (wsdlURI == null) {
-//                return URI.create(componentURI + "/" + bindingURI).normalize();
-//            } else if (bindingURI == null) {
-//                return URI.create(componentURI + "/" + wsdlURI).normalize();
-//            } else {
-//                return URI.create(componentURI + "/" + bindingURI + "/" + wsdlURI).normalize();
-//            }
-//        }
-//                
-//        String actualURI = "";
-//
-//        if (bindingURI == null) {
-//            actualURI = baseURI + "/" + componentURI + "/";
-//        } else {
-//            actualURI = baseURI + "/" + componentURI + "/" + bindingURI + "/";
-//        }
-//
-//        if (wsdlURI != null) {
-//            actualURI = actualURI + wsdlURI.toString();
-//        }
-//
-//        if (actualURI.endsWith("/")) {
-//            actualURI = actualURI.substring(0, actualURI.length() -1);
-//        }
-//        
-//        // normalize to handle any . or .. occurances 
-//        return URI.create(actualURI).normalize();
-//    }
 
+    /**
+     * Compute the endpoint URI based on section 2.1.1 of the WS binding spec
+     * 1. The URIs in the endpoint(s) of the referenced WSDL, which may be relative
+     * 2. The URI specified by the wsa:Address element of the wsa:EndpointReference, which may be relative
+     * 3. The explicitly stated URI in the "uri" attribute of the binding.ws element, which may be relative,
+     * 4. The implicit URI as defined by in section 1.7 in the SCA Assembly spec 
+     * If the <binding.ws> has no wsdlElement but does have a uri attribute then the uri takes precidence
+     * over any implicitly used WSDL.
+     * @param parent 
+     */
+    protected URI computeActualURI(WebServiceBinding wsBinding, String baseURI, URI componentURI, String bindingName) {
+        URI wsdlURI = null;         
+        if (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null) {
+            // <binding.ws> explicitly points at a wsdl port, may be a relative URI
+            wsdlURI = getEndpoint(wsBinding.getPort());
+        }
+        if (wsdlURI != null && wsdlURI.isAbsolute()) {
+            if (wsBinding.getURI() != null && (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null)) {
+                throw new IllegalArgumentException("binding URI cannot be used with absolute WSDL endpoint URI");
+            }
+            return URI.create(wsdlURI.toString());
+        }
+        
+        // there is no wsdl port endpoint URI or that URI is relative
+        
+        URI bindingURI = null;
+        if (wsBinding.getURI() != null) {
+            bindingURI = URI.create(wsBinding.getURI());
+        }
+
+        if (bindingURI != null && bindingURI.isAbsolute()) {
+            if (wsdlURI != null) {
+                return URI.create(bindingURI + "/" + wsdlURI);
+            } else {
+                return bindingURI;
+            }
+        }
+        
+        if (componentURI == null) { // null for references
+            wsdlURI = getEndpoint(wsBinding.getPort());
+            if (bindingURI != null) {
+                return URI.create(wsdlURI + "/" + bindingURI);
+            } else {
+                return wsdlURI;
+            }
+        }
+
+        // TODO: TUSCANY-xxx, how to tell if component has multiple services using <binding.ws>?
+        //        boolean singleService = (parent != null) && (((Component)parent.getChild(componentURI.toString())).getInboundWires().size() == 1);
+        //        if (bindingURI == null && !singleService) {
+
+        if (bindingURI == null) {
+            bindingURI = URI.create(bindingName);
+        }
+
+        if (componentURI.isAbsolute()) {
+            if (bindingURI == null && wsdlURI == null) {
+                return componentURI;
+            } else if (wsdlURI == null) {
+                return URI.create(componentURI + "/" + bindingURI);
+            } else if (bindingURI == null) {
+                return URI.create(componentURI + "/" + wsdlURI);
+            } else {
+                return URI.create(componentURI + "/" + bindingURI + "/" + wsdlURI);
+            }
+        }
+                
+        String actualURI = "";
+
+        if (bindingURI == null) {
+            actualURI = baseURI + "/" + componentURI + "/";
+        } else {
+            actualURI = baseURI + "/" + componentURI + "/" + bindingURI + "/";
+        }
+
+        if (wsdlURI != null) {
+            actualURI = actualURI + wsdlURI.toString();
+        }
+
+        if (actualURI.endsWith("/")) {
+            actualURI = actualURI.substring(0, actualURI.length() -1);
+        }
+        
+        return URI.create(actualURI);
+    }
+
+    /**
+     * Returns the endpoint of a given port.
+     */
+    protected URI getEndpoint(Port wsdlPort) {
+        final List wsdlPortExtensions = wsdlPort.getExtensibilityElements();
+        for (final Object extension : wsdlPortExtensions) {
+            if (extension instanceof SOAPAddress) {
+                return URI.create(((SOAPAddress) extension).getLocationURI());
+            }
+        }
+        return null;
+    }
 }

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ModuleActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ModuleActivator.java?view=diff&rev=529090&r1=529089&r2=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ModuleActivator.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ModuleActivator.java Sun Apr 15 16:08:06 2007
@@ -23,20 +23,26 @@
 
 import org.apache.tuscany.binding.ws.xml.WebServiceBindingProcessor;
 import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.http.ServletHostExtensionPoint;
 import org.apache.tuscany.spi.bootstrap.ExtensionPointRegistry;
 import org.apache.tuscany.spi.bootstrap.ModuleActivator;
 import org.apache.tuscany.spi.builder.BuilderRegistry;
 
 public class Axis2ModuleActivator implements ModuleActivator {
 
-    public void start(ExtensionPointRegistry registry) {
-        StAXArtifactProcessorExtensionPoint artifactProcessorRegistry = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+    public void start(ExtensionPointRegistry extensionPointRegistry) {
+
+        StAXArtifactProcessorExtensionPoint artifactProcessorRegistry = extensionPointRegistry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
         artifactProcessorRegistry.addExtension(new WebServiceBindingProcessor());
 
-        BuilderRegistry builderRegistry = registry.getExtensionPoint(BuilderRegistry.class);
+        ServletHostExtensionPoint servletHost = extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);
+        
+        BuilderRegistry builderRegistry = extensionPointRegistry.getExtensionPoint(BuilderRegistry.class);
         Axis2BindingBuilder builder = new Axis2BindingBuilder();
         builder.setBuilderRegistry(builderRegistry);
+        builder.setServletHost(servletHost);
         builder.init();
+
     }
 
     public void stop(ExtensionPointRegistry registry) {

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceBinding.java?view=diff&rev=529090&r1=529089&r2=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceBinding.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceBinding.java Sun Apr 15 16:08:06 2007
@@ -50,6 +50,7 @@
 import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004Constants;
 import org.apache.tuscany.binding.axis2.util.WebServicePortMetaData;
 import org.apache.tuscany.binding.ws.WebServiceBinding;
+import org.apache.tuscany.http.ServletHostExtensionPoint;
 import org.apache.tuscany.interfacedef.InterfaceContract;
 import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.interfacedef.Operation.ConversationSequence;
@@ -57,8 +58,8 @@
 import org.apache.tuscany.spi.builder.BuilderConfigException;
 import org.apache.tuscany.spi.component.TargetInvokerCreationException;
 import org.apache.tuscany.spi.component.WorkContext;
+import org.apache.tuscany.spi.component.WorkContextTunnel;
 import org.apache.tuscany.spi.extension.ServiceBindingExtension;
-import org.apache.tuscany.spi.host.ServletHost;
 import org.apache.tuscany.spi.wire.Interceptor;
 import org.apache.tuscany.spi.wire.InvocationChain;
 import org.apache.tuscany.spi.wire.Message;
@@ -66,36 +67,27 @@
 import org.apache.tuscany.spi.wire.TargetInvoker;
 import org.osoa.sca.annotations.Destroy;
 
-// org.apache.tuscany.spi.model
 /**
  * An implementation of a {@link ServiceBindingExtension} configured with the Axis2 binding
- *
- * @version $Rev$ $Date$
  */
 public class Axis2ServiceBinding extends ServiceBindingExtension {
-    private static final QName BINDING_WS = new QName(SCA_NS, "binding.ws");
 
     private InterfaceContract serviceContract;
-
-    private ServletHost servletHost;
-
     private ConfigurationContext configContext;
-
-    private WebServiceBinding binding;
-
+    private WebServiceBinding wsBinding;
     private Map<Object, InvocationContext> invCtxMap = new HashMap<Object, InvocationContext>();
-
     private String serviceName;
-
-    private WorkContext workContext;
-
+//    private WorkContext workContext;
     private Set<String> seenConversations = Collections.synchronizedSet(new HashSet<String>());
+    private ServletHostExtensionPoint servletHost;
+
+    private static final QName BINDING_WS = new QName(SCA_NS, "binding.ws");
 
     public Axis2ServiceBinding(URI uri,
                                InterfaceContract serviceContract,
                                InterfaceContract serviceBindingContract,
-                               WebServiceBinding binding,
-                               ServletHost servletHost,
+                               WebServiceBinding wsBinding,
+                               ServletHostExtensionPoint servletHost,
                                ConfigurationContext configContext,
                                WorkContext workContext) {
 
@@ -103,18 +95,20 @@
 
         this.serviceContract = serviceContract;
         this.bindingServiceContract = serviceBindingContract;
-        this.binding = binding;
+        this.wsBinding = wsBinding;
         this.servletHost = servletHost;
         this.configContext = configContext;
         this.serviceName = uri.toString(); // TODO: whats this for, better name
-        this.workContext = workContext;
+//        this.workContext = workContext;
+
+        start(); // TODO: hack while start isn't getting called by runtime 
     }
 
     public void start() {
         super.start();
 
         try {
-            configContext.getAxisConfiguration().addService(createAxisService(binding));
+            configContext.getAxisConfiguration().addService(createAxisService(wsBinding));
         } catch (AxisFault e) {
             throw new Axis2BindingRunTimeException(e);
         }
@@ -122,12 +116,12 @@
         Axis2ServiceServlet servlet = new Axis2ServiceServlet();
         servlet.init(configContext);
         configContext.setContextRoot(getUri().toString());
-        servletHost.registerMapping("/services/" + getUri().toString(), servlet);
+        servletHost.addServletMapping(8080, getUri().getPath(), servlet);
     }
 
     @Destroy
     public void stop() {
-        servletHost.unregisterMapping("/services/" + getUri().toString());
+        servletHost.removeServletMapping(8080, getUri().getPath());
         try {
             configContext.getAxisConfiguration().removeService(getUri().toString());
         } catch (AxisFault e) {
@@ -148,7 +142,11 @@
         builder.setServerSide(true);
         AxisService axisService = builder.populateService();
 
-        axisService.setName(getUri().toString());
+        String path = getUri().getPath();
+        if (path != null && path.length() > 1 && path.startsWith("/")) {
+            path = path.substring(1);
+        }
+        axisService.setName(path);
         axisService.setServiceDescription("Tuscany configured AxisService for service: " + getUri().toString());
 
         // Use the existing WSDL
@@ -209,6 +207,7 @@
         }
         
         Interceptor headInterceptor = chain.getHeadInterceptor();
+        WorkContext workContext = WorkContextTunnel.getThreadWorkContext();
         String oldConversationID = (String) workContext.getIdentifier(Scope.CONVERSATION);
         if (isConversational() && conversationID != null) {
             workContext.setIdentifier(Scope.CONVERSATION, conversationID);
@@ -232,6 +231,8 @@
                     msg.setMessageId(messageId);
                 }
                 msg.setBody(args);
+                msg.setWorkContext(workContext);
+
                 Message resp;
 
                 if (isConversational()) {

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java?view=diff&rev=529090&r1=529089&r2=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java Sun Apr 15 16:08:06 2007
@@ -49,9 +49,8 @@
             
             String conversationID = axis2Service.isConversational() ?  Axis2ServiceBinding.getConversationID(inMC) : null;
 
-            OMElement responseOM = null; //(OMElement)axis2Service.invokeTarget(operation, args, null, conversationID);
+            OMElement responseOM = (OMElement) axis2Service.invokeTarget(operation, args, null, conversationID);
 
-            
             SOAPEnvelope soapEnvelope = getSOAPFactory(inMC).getDefaultEnvelope();
             if(null != responseOM ){
                 soapEnvelope.getBody().addChild(responseOM);

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceServlet.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceServlet.java?view=diff&rev=529090&r1=529089&r2=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceServlet.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceServlet.java Sun Apr 15 16:08:06 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.binding.axis2;
 
+import static org.apache.tuscany.host.embedded.SimpleRuntimeInfo.DEFAULT_COMPOSITE;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.MalformedURLException;
@@ -37,6 +39,10 @@
 
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.transport.http.AxisServlet;
+import org.apache.tuscany.core.component.SimpleWorkContext;
+import org.apache.tuscany.spi.Scope;
+import org.apache.tuscany.spi.component.WorkContext;
+import org.apache.tuscany.spi.component.WorkContextTunnel;
 
 /**
  * This overrides the servlet init of the AxisServlet so Tuscany can use
@@ -201,6 +207,12 @@
                 inited = true;
             }
         }
+
+        // Create a work context TODO: where should this get done?
+        WorkContext workContext = new SimpleWorkContext();
+        workContext.setIdentifier(Scope.COMPOSITE, DEFAULT_COMPOSITE);
+        WorkContextTunnel.setThreadWorkContext(workContext);
+        
         super.service(request, response);
     }
 

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/TuscanyDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/TuscanyDispatcher.java?view=diff&rev=529090&r1=529089&r2=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/TuscanyDispatcher.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/TuscanyDispatcher.java Sun Apr 15 16:08:06 2007
@@ -57,7 +57,7 @@
 
             String path = URI.create(toEPR.getAddress()).getPath();
             
-            // remove the leading slash
+            // remove the leading slash as Axis2 doesn't work if the service name starts with one
             if (path != null && path.length() > 1 && path.startsWith("/")) {
                 path = path.substring(1);
             }

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml?view=diff&rev=529090&r1=529089&r2=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml Sun Apr 15 16:08:06 2007
@@ -66,7 +66,7 @@
     <!--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>
+    <parameter name="enableRESTInAxis2MainServlet" locked="true">true</parameter>
 
     <!-- Following parameter will completely disable REST handling in both the servlets-->
     <parameter name="disableREST" locked="true">false</parameter>
@@ -223,6 +223,10 @@
     <phaseOrder type="InFlow">
         <!--  System pre defined phases       -->
         <phase name="Transport">
+            <handler name="TuscanyDispatcher"
+                     class="org.apache.tuscany.binding.axis2.TuscanyDispatcher">
+                <order phase="Transport"/>
+            </handler>
             <handler name="RequestURIBasedDispatcher"
                      class="org.apache.axis2.engine.RequestURIBasedDispatcher">
                 <order phase="Transport"/>

Added: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldService.java?view=auto&rev=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldService.java (added)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldService.java Sun Apr 15 16:08:06 2007
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.binding.axis2.itests;
+
+public class HelloWorldService implements HelloWorld {
+
+    public String getGreetings(String s) {
+        return "Hello " + s;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/HelloWorld.composite?view=diff&rev=529090&r1=529089&r2=529090
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/HelloWorld.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/HelloWorld.composite Sun Apr 15 16:08:06 2007
@@ -21,6 +21,16 @@
 
            name="HelloWorld">
 
+    <service name="helloWorld" promote="HelloWorldService">
+        <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+        <!-- interface.java interface="org.apache.tuscany.binding.axis2.itests.HelloWorld" / -->
+        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
+    </service>
+
+    <component name="HelloWorldService">
+		<implementation.java class="org.apache.tuscany.binding.axis2.itests.HelloWorldService"/>
+    </component>
+
     <component name="HelloWorldComponent">
 		<implementation.java class="org.apache.tuscany.binding.axis2.itests.HelloWorldComponent"/>
         <reference name="helloWorldWS" />



---------------------------------------------------------------------
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