You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ri...@apache.org on 2006/08/04 21:59:07 UTC

svn commit: r428861 - in /incubator/tuscany/java/samples/sca/helloworldwsclient: ./ src/main/java/helloworld/ src/main/resources/ src/main/resources/META-INF/sca/ src/main/resources/wsdl/

Author: rineholt
Date: Fri Aug  4 12:59:07 2006
New Revision: 428861

URL: http://svn.apache.org/viewvc?rev=428861&view=rev
Log:
TUSCANY-575
http://issues.apache.org/jira/browse/TUSCANY-575
New WS client to test with

Added:
    incubator/tuscany/java/samples/sca/helloworldwsclient/
      - copied from r424728, incubator/tuscany/branches/java-post-M1/samples/sca/helloworldwsclient/
    incubator/tuscany/java/samples/sca/helloworldwsclient/run.bat
      - copied, changed from r428701, incubator/tuscany/java/samples/sca/eagerinit/run.bat
    incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/META-INF/sca/
    incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/META-INF/sca/default.scdl
      - copied, changed from r428701, incubator/tuscany/java/samples/sca/eagerinit/src/main/resources/META-INF/sca/default.scdl
Removed:
    incubator/tuscany/java/samples/sca/helloworldwsclient/build.xml
    incubator/tuscany/java/samples/sca/helloworldwsclient/readme.htm
    incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/sca.module
Modified:
    incubator/tuscany/java/samples/sca/helloworldwsclient/pom.xml
    incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java
    incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl

Modified: incubator/tuscany/java/samples/sca/helloworldwsclient/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient/pom.xml?rev=428861&r1=424728&r2=428861&view=diff
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldwsclient/pom.xml (original)
+++ incubator/tuscany/java/samples/sca/helloworldwsclient/pom.xml Fri Aug  4 12:59:07 2006
@@ -18,15 +18,13 @@
     <parent>
         <groupId>org.apache.tuscany.samples.sca</groupId>
         <artifactId>tuscany-samples-sca</artifactId>
-        <version>incubating-M1</version>
+        <version>1.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>sample-helloworldwsclient</artifactId>
     <packaging>jar</packaging>
     <name>Tuscany HelloWorld Web Service Client Sample</name>
     <description>A sample client for a HelloWorld Web Service.</description>
-    <version>incubating-M1</version>
-
     <properties>
         <ws.type>axis2</ws.type>
     </properties>
@@ -34,19 +32,13 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.tuscany</groupId>
-            <artifactId>tuscany-core</artifactId>
-            <version>${pom.version}</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca.containers</groupId>
-            <artifactId>tuscany-container-java</artifactId>
+            <artifactId>core</artifactId>
             <version>${pom.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.tuscany.sca.bindings</groupId>
-            <artifactId>tuscany-binding-${ws.type}</artifactId>
+            <groupId>org.apache.tuscany.bindings</groupId>
+            <artifactId>axis2</artifactId>
             <version>${pom.version}</version>
             <scope>provided</scope>
         </dependency>
@@ -58,4 +50,22 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+    
+     <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>helloworld.HelloWorldClient</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+    
 </project>

Copied: incubator/tuscany/java/samples/sca/helloworldwsclient/run.bat (from r428701, incubator/tuscany/java/samples/sca/eagerinit/run.bat)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient/run.bat?p2=incubator/tuscany/java/samples/sca/helloworldwsclient/run.bat&p1=incubator/tuscany/java/samples/sca/eagerinit/run.bat&r1=428701&r2=428861&rev=428861&view=diff
==============================================================================
--- incubator/tuscany/java/samples/sca/eagerinit/run.bat (original)
+++ incubator/tuscany/java/samples/sca/helloworldwsclient/run.bat Fri Aug  4 12:59:07 2006
@@ -4,4 +4,4 @@
 pushd target\standalone
 jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\standalone\1.0-SNAPSHOT\standalone-1.0-SNAPSHOT-bin.zip" 
 popd
-java %java_debug_set% -jar target\standalone\bin\launcher.jar  --classpath "%USERPROFILE%\.m2\repository\org\apache\tuscany\samples\sca\sample-eagerinit\1.0-SNAPSHOT\sample-eagerinit-1.0-SNAPSHOT.jar" %*
+java %java_debug_set% -jar target\standalone\bin\launcher.jar  --classpath "%USERPROFILE%\.m2\repository\org\apache\tuscany\samples\sca\sample-helloworldwsclient\1.0-SNAPSHOT\sample-helloworldwsclient-1.0-SNAPSHOT.jar" %*

Modified: incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java?rev=428861&r1=424728&r2=428861&view=diff
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java (original)
+++ incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java Fri Aug  4 12:59:07 2006
@@ -16,52 +16,59 @@
  */
 package helloworld;
 
-import java.util.logging.Level;
-import java.util.logging.LogManager;
-import java.util.Properties;
-
-import org.osoa.sca.CurrentModuleContext;
-import org.osoa.sca.ModuleContext;
-
-import org.apache.tuscany.core.client.TuscanyRuntime;
-import org.apache.tuscany.common.monitor.MonitorFactory;
-import org.apache.tuscany.common.monitor.impl.JavaLoggingMonitorFactory;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+
+
+//import org.osoa.sca.CurrentModuleContext;
+//import org.osoa.sca.ModuleContext;
+//
+//import org.apache.tuscany.core.client.TuscanyRuntime;
+//import org.apache.tuscany.common.monitor.MonitorFactory;
+//import org.apache.tuscany.common.monitor.impl.JavaLoggingMonitorFactory;
 
 /**
  * This client program shows how to create an SCA runtime, start it,
  * locate the HelloWorld service and invoke it.
  */
+
+
+
 public class HelloWorldClient {
+   
 
-    public static final void main(String[] args) throws Exception {
+    public  final static void main(String[] args) throws Exception {
         
         // Setup Tuscany monitoring to use java.util.logging
-        LogManager.getLogManager().readConfiguration(HelloWorldClient.class.getResourceAsStream("/logging.properties"));
-        Properties levels = new Properties();
-        MonitorFactory monitorFactory = new JavaLoggingMonitorFactory(levels, Level.FINEST, "MonitorMessages");
+//        LogManager.getLogManager().readConfiguration(HelloWorldClient.class.getResourceAsStream("/logging.properties"));
+//        Properties levels = new Properties();
+//        MonitorFactory monitorFactory = new JavaLoggingMonitorFactory(levels, Level.FINEST, "MonitorMessages");
 
         // Create a Tuscany runtime for the sample module component
-        TuscanyRuntime tuscany = new TuscanyRuntime("HelloWorldModuleComponent", "http://helloworld", monitorFactory);
+//        TuscanyRuntime tuscany = new TuscanyRuntime("HelloWorldModuleComponent", "http://helloworld", monitorFactory);
 
         // Start the Tuscany runtime and associate it with this thread
-        tuscany.start();
+//        tuscany.start();
 
         // Get the SCA module context.
-        ModuleContext moduleContext = CurrentModuleContext.getContext();
+//        ModuleContext moduleContext = CurrentModuleContext.getContext();
 
         // Locate the HelloWorld service
-        HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldService");
+//        HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldService");
         
         // Invoke the HelloWorld service
-        String value = helloworldService.getGreetings("World");
+        CompositeContext compositeContext = CurrentCompositeContext.getContext();
+        HelloWorldService helloWorldService= compositeContext.locateService(HelloWorldService.class, "HelloWorldService");
+        String value = helloWorldService.getGreetings("World");
         
         System.out.println(value);
         System.out.flush();
 
         // Disassociate the runtime from this thread
-        tuscany.stop();
+//        tuscany.stop();
 
         // Shut down the runtime
-        tuscany.shutdown();
+//        tuscany.shutdown();
     }
 }

Copied: incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/META-INF/sca/default.scdl (from r428701, incubator/tuscany/java/samples/sca/eagerinit/src/main/resources/META-INF/sca/default.scdl)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/META-INF/sca/default.scdl?p2=incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/META-INF/sca/default.scdl&p1=incubator/tuscany/java/samples/sca/eagerinit/src/main/resources/META-INF/sca/default.scdl&r1=428701&r2=428861&rev=428861&view=diff
==============================================================================
--- incubator/tuscany/java/samples/sca/eagerinit/src/main/resources/META-INF/sca/default.scdl (original)
+++ incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/META-INF/sca/default.scdl Fri Aug  4 12:59:07 2006
@@ -16,10 +16,12 @@
  -->
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
            xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
-           name="EagerInitComposite">
+           name="sampleHelloworld">
 
-    <component name="EagerInitComponent">
-        <implementation.java class="eagerinit.EagerInitImpl"/>
-    </component>
+    <reference name="HelloWorldService">
+        <interface.java interface="helloworld.HelloWorldService"/>
+        <binding.ws endpoint="http://helloworld#wsdl.endpoint(HelloWorldService/HelloWorldSoapPort)"
+			location="wsdl/helloworld.wsdl" />
+    </reference>
 
 </composite>

Modified: incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl?rev=428861&r1=424728&r2=428861&view=diff
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl (original)
+++ incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl Fri Aug  4 12:59:07 2006
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
-
-  Licensed 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.
- -->
-<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+  Licensed 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.
+ -->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 	name="helloworld">
-
+
     <wsdl:types>
         <schema elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
-
+
             <element name="getGreetings">
                 <complexType>
                     <sequence>
@@ -27,7 +27,7 @@
                     </sequence>
                 </complexType>
             </element>
-
+
             <element name="getGreetingsResponse">
                 <complexType>
                     <sequence>



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