Author: antelder
Date: Mon Oct 16 15:44:19 2006
New Revision: 464704
URL: http://svn.apache.org/viewvc?view=rev&rev=464704
Log:
Fix up helloworldwsclient to runn in the standalone launcher
Removed:
incubator/tuscany/java/samples/sca/helloworldwsclient/src/test/resources/META-INF/
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/java/helloworld/HelloWorldService.java
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldServiceComponent.java
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/META-INF/sca/default.scdl
incubator/tuscany/java/samples/sca/helloworldwsclient/src/test/java/helloworld/HelloWorldWSClient.java
Modified: incubator/tuscany/java/samples/sca/helloworldwsclient/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient/pom.xml?view=diff&rev=464704&r1=464703&r2=464704
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldwsclient/pom.xml (original)
+++ incubator/tuscany/java/samples/sca/helloworldwsclient/pom.xml Mon Oct 16
15:44:19 2006
@@ -89,6 +89,7 @@
</dependencies>
<build>
+ <defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
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?view=diff&rev=464704&r1=464703&r2=464704
==============================================================================
---
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
Mon Oct 16 15:44:19 2006
@@ -21,56 +21,16 @@
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 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");
-
- // Create a Tuscany runtime for the sample module component
-// TuscanyRuntime tuscany = new
TuscanyRuntime("HelloWorldModuleComponent", "http://helloworld",
monitorFactory);
-
- // Start the Tuscany runtime and associate it with this thread
-// tuscany.start();
-
- // Get the SCA module context.
-// ModuleContext moduleContext = CurrentModuleContext.getContext();
-
- // Locate the HelloWorld service
-// HelloWorldService helloworldService = (HelloWorldService)
moduleContext.locateService("HelloWorldService");
-
- // Invoke the HelloWorld service
CompositeContext compositeContext =
CurrentCompositeContext.getContext();
HelloWorldService helloWorldService=
compositeContext.locateService(HelloWorldService.class,
"HelloWorldServiceComponent");
String value = helloWorldService.getGreetings("World");
-
System.out.println(value);
- System.out.flush();
-
- // Disassociate the runtime from this thread
-// tuscany.stop();
-
- // Shut down the runtime
-// tuscany.shutdown();
}
}
Modified:
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldService.java?view=diff&rev=464704&r1=464703&r2=464704
==============================================================================
---
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldService.java
(original)
+++
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldService.java
Mon Oct 16 15:44:19 2006
@@ -18,18 +18,11 @@
*/
package helloworld;
-import org.apache.tuscany.api.annotation.DataType;
import org.osoa.sca.annotations.Remotable;
import org.osoa.sca.annotations.Service;
-import commonj.sdo.DataObject;
-
@Remotable
@Service
public interface HelloWorldService {
public String getGreetings(String name);
-
- @DataType(name="commonj.sdo.DataObject")
- public String getGreetings1(DataObject name);
-
}
Modified:
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldServiceComponent.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldServiceComponent.java?view=diff&rev=464704&r1=464703&r2=464704
==============================================================================
---
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldServiceComponent.java
(original)
+++
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/java/helloworld/HelloWorldServiceComponent.java
Mon Oct 16 15:44:19 2006
@@ -20,22 +20,16 @@
import org.osoa.sca.annotations.Scope;
-import commonj.sdo.DataObject;
-
-
/**
* This client program shows how to create an SCA runtime, start it,
* locate the HelloWorld service and invoke it.
*/
-
-
@Scope("MODULE")
public class HelloWorldServiceComponent implements HelloWorldService {
HelloWorldService helloWorldService;
public String getGreetings(String name) {
-
return helloWorldService.getGreetings(name);
}
@@ -46,9 +40,4 @@
public void setHelloWorldService(HelloWorldService helloWorldService) {
this.helloWorldService = helloWorldService;
}
-
- public String getGreetings1(DataObject name) {
- return helloWorldService.getGreetings1(name);
- }
-
}
Modified:
incubator/tuscany/java/samples/sca/helloworldwsclient/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?view=diff&rev=464704&r1=464703&r2=464704
==============================================================================
---
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/META-INF/sca/default.scdl
(original)
+++
incubator/tuscany/java/samples/sca/helloworldwsclient/src/main/resources/META-INF/sca/default.scdl
Mon Oct 16 15:44:19 2006
@@ -29,9 +29,6 @@
</component>
<reference name="HelloWorldService">
- <!--
- <interface.java interface="helloworld.HelloWorldService"/>
- -->
<interface.wsdl xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
interface="http://helloworld#wsdl.interface(HelloWorld)"
wsdli:wsdlLocation="http://helloworld wsdl/helloworld.wsdl" />
Modified:
incubator/tuscany/java/samples/sca/helloworldwsclient/src/test/java/helloworld/HelloWorldWSClient.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient/src/test/java/helloworld/HelloWorldWSClient.java?view=diff&rev=464704&r1=464703&r2=464704
==============================================================================
---
incubator/tuscany/java/samples/sca/helloworldwsclient/src/test/java/helloworld/HelloWorldWSClient.java
(original)
+++
incubator/tuscany/java/samples/sca/helloworldwsclient/src/test/java/helloworld/HelloWorldWSClient.java
Mon Oct 16 15:44:19 2006
@@ -27,10 +27,6 @@
import org.osoa.sca.CompositeContext;
import org.osoa.sca.CurrentCompositeContext;
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.DataFactory;
-import commonj.sdo.helper.XSDHelper;
-
/**
* Test case for helloworld web service client
*/
@@ -41,27 +37,17 @@
@Override
protected void setUp() throws Exception {
setApplicationSCDL(HelloWorldService.class,
"META-INF/sca/default.scdl");
- ClassLoader classLoader = getClass().getClassLoader();
- addExtension("test.extensions",
classLoader.getResource("META-INF/tuscany/test-extensions.scdl"));
+ URL base = getClass().getResource("/META-INF/sca/binding.axis2.scdl");
+ addExtension("binding.ws", new URL(base, "default.scdl"));
+ base = getClass().getResource("/META-INF/sca/databinding.sdo.scdl");
+ addExtension("databindning.sdo", new URL(base, "default.scdl"));
super.setUp();
CompositeContext compositeContext =
CurrentCompositeContext.getContext();
helloWorldService =
compositeContext.locateService(HelloWorldService.class,
"HelloWorldServiceComponent");
}
public void testWSClient() throws Exception {
- URL wsdl = getClass().getResource("/wsdl/helloworld.wsdl");
- XSDHelper.INSTANCE.define(wsdl.openStream(), wsdl.toExternalForm());
-
- String msg = helloWorldService.getGreetings("John");
- Assert.assertEquals("Hello John", msg);
-
- DataObject name = DataFactory.INSTANCE.create("http://helloworld",
"NameType");
- name.setString("firstName", "John");
- name.setString("lastName", "Smith");
- String msg1 = helloWorldService.getGreetings1(name);
- Assert.assertEquals("Hello John Smith", msg1);
-
- msg = helloWorldService.getGreetings("Smith");
+ String msg = helloWorldService.getGreetings("Smith");
Assert.assertEquals("Hello Smith", msg);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]