You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2007/04/16 01:26:59 UTC

svn commit: r529094 - in /incubator/tuscany/java/sca/modules/binding-ws-axis2/src: main/java/org/apache/tuscany/binding/axis2/ test/java/org/apache/tuscany/binding/axis2/itests/ test/resources/org/apache/tuscany/binding/axis2/itests/

Author: antelder
Date: Sun Apr 15 16:26:57 2007
New Revision: 529094

URL: http://svn.apache.org/viewvc?view=rev&rev=529094
Log:
Axis2 binding - get the helloworld OM testcase working with a service

Added:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldOMService.java   (with props)
Modified:
    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/test/resources/org/apache/tuscany/binding/axis2/itests/helloworld-om.composite

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=529094&r1=529093&r2=529094
==============================================================================
--- 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:26:57 2007
@@ -18,8 +18,6 @@
  */
 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;
@@ -41,6 +39,7 @@
 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.bootstrap.ComponentNames;
 import org.apache.tuscany.spi.component.WorkContext;
 import org.apache.tuscany.spi.component.WorkContextTunnel;
 
@@ -210,7 +209,7 @@
 
         // Create a work context TODO: where should this get done?
         WorkContext workContext = new SimpleWorkContext();
-        workContext.setIdentifier(Scope.COMPOSITE, DEFAULT_COMPOSITE);
+        workContext.setIdentifier(Scope.COMPOSITE, ComponentNames.TUSCANY_APPLICATION_ROOT.resolve("default"));
         WorkContextTunnel.setThreadWorkContext(workContext);
         
         super.service(request, response);

Added: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldOMService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldOMService.java?view=auto&rev=529094
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldOMService.java (added)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/HelloWorldOMService.java Sun Apr 15 16:26:57 2007
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+
+public class HelloWorldOMService implements HelloWorldOM {
+
+    public OMElement getGreetings(OMElement requestOM) {
+        String name = requestOM.getFirstElement().getText();
+
+        OMFactory omFactory = OMAbstractFactory.getOMFactory();
+        OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld");
+        OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld");
+        responseOM.addChild(param);
+        param.addChild(omFactory.createOMText("Hello " + name));
+        
+        return  responseOM;
+    }
+
+}

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

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

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/helloworld-om.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-om.composite?view=diff&rev=529094&r1=529093&r2=529094
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/helloworld-om.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/helloworld-om.composite Sun Apr 15 16:26:57 2007
@@ -21,6 +21,16 @@
 
            name="HelloWorldOM">
 
+    <service name="helloWorld" promote="HelloWorldService">
+        <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
+        <!-- interface.java interface="org.apache.tuscany.binding.axis2.itests.HelloWorld" / -->
+        <binding.ws wsdlElement="http://helloworld-om#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
+    </service>
+
+    <component name="HelloWorldService">
+		<implementation.java class="org.apache.tuscany.binding.axis2.itests.HelloWorldOMService"/>
+    </component>
+
     <component name="HelloWorldComponent">
 		<implementation.java class="org.apache.tuscany.binding.axis2.itests.HelloWorldOMComponent"/>
         <reference name="helloWorldWS" />



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