Author: rfeng
Date: Tue Mar  9 01:25:10 2010
New Revision: 920606

URL: http://svn.apache.org/viewvc?rev=920606&view=rev
Log:
Start with a known WSDL

Added:
    
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/BindingWSJAXWSTestCase.java
   (with props)
Modified:
    tuscany/sandbox/rfeng/binding-ws-jaxws/pom.xml
    
tuscany/sandbox/rfeng/binding-ws-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSServiceBindingProvider.java
    
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/WeatherForecastClient.java
    
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/resources/WeatherForecast.composite

Modified: tuscany/sandbox/rfeng/binding-ws-jaxws/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/rfeng/binding-ws-jaxws/pom.xml?rev=920606&r1=920605&r2=920606&view=diff
==============================================================================
--- tuscany/sandbox/rfeng/binding-ws-jaxws/pom.xml (original)
+++ tuscany/sandbox/rfeng/binding-ws-jaxws/pom.xml Tue Mar  9 01:25:10 2010
@@ -55,14 +55,14 @@
             <artifactId>tuscany-binding-ws</artifactId>
             <version>2.0-SNAPSHOT</version>
         </dependency>
-
+        
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-ws-xml</artifactId>
+            <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
             <version>2.0-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
-
+        
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-core-databinding</artifactId>
@@ -93,6 +93,13 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-jetty</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-databinding</artifactId>
             <version>2.0-SNAPSHOT</version>
             <scope>compile</scope>

Modified: 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSServiceBindingProvider.java
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/rfeng/binding-ws-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSServiceBindingProvider.java?rev=920606&r1=920605&r2=920606&view=diff
==============================================================================
--- 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSServiceBindingProvider.java
 (original)
+++ 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSServiceBindingProvider.java
 Tue Mar  9 01:25:10 2010
@@ -85,7 +85,7 @@ public class JAXWSServiceBindingProvider
 
     public void start() {
         wsEndpoint = Endpoint.create(this);
-        wsEndpoint.publish(wsBinding.getURI());
+        wsEndpoint.publish("http://localhost:8085"; + wsBinding.getURI());
     }
 
     public void stop() {

Added: 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/BindingWSJAXWSTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/BindingWSJAXWSTestCase.java?rev=920606&view=auto
==============================================================================
--- 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/BindingWSJAXWSTestCase.java
 (added)
+++ 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/BindingWSJAXWSTestCase.java
 Tue Mar  9 01:25:10 2010
@@ -0,0 +1,61 @@
+/*
+ * 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 weather;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * 
+ */
+public class BindingWSJAXWSTestCase {
+    private static Node node;
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        String location = 
ContributionLocationHelper.getContributionLocation(WeatherForecastImpl.class);
+        node = 
NodeFactory.getInstance().createNode("WeatherForecast.composite", new 
Contribution("c1", location));
+        node.start();
+    }
+
+    @Test
+    public void testJAXWS() throws Exception {
+        WeatherForecastClient.testJAXWS(node);
+    }
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+        if (node != null) {
+            node.stop();
+        }
+    }
+
+}

Propchange: 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/BindingWSJAXWSTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/BindingWSJAXWSTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/WeatherForecastClient.java
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/WeatherForecastClient.java?rev=920606&r1=920605&r2=920606&view=diff
==============================================================================
--- 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/WeatherForecastClient.java
 (original)
+++ 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/java/weather/WeatherForecastClient.java
 Tue Mar  9 01:25:10 2010
@@ -21,7 +21,9 @@ package weather;
 import java.io.StringWriter;
 
 import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
+import javax.xml.bind.PropertyException;
 
 import org.apache.tuscany.sca.node.Contribution;
 import org.apache.tuscany.sca.node.ContributionLocationHelper;
@@ -42,6 +44,12 @@ public class WeatherForecastClient {
         String location = 
ContributionLocationHelper.getContributionLocation(WeatherForecastImpl.class);
         Node node = 
NodeFactory.newInstance().createNode("WeatherForecast.composite", new 
Contribution("c1", location));
         node.start();
+        testJAXWS(node);
+
+        node.stop();
+    }
+
+    static void testJAXWS(Node node) throws JAXBException, PropertyException {
         WeatherForecastSoap weatherService = 
node.getService(WeatherForecastSoap.class, "WeatherForecastService");
 
         WeatherForecasts result = weatherService.getWeatherByZipCode("94555");
@@ -61,7 +69,5 @@ public class WeatherForecastClient {
 
         String xml = writer.toString();
         System.out.println(xml);
-
-        node.stop();
     }
 }

Modified: 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/resources/WeatherForecast.composite
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/resources/WeatherForecast.composite?rev=920606&r1=920605&r2=920606&view=diff
==============================================================================
--- 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/resources/WeatherForecast.composite
 (original)
+++ 
tuscany/sandbox/rfeng/binding-ws-jaxws/src/test/resources/WeatherForecast.composite
 Tue Mar  9 01:25:10 2010
@@ -27,7 +27,7 @@
             <binding.ws 
wsdlElement="http://www.webservicex.net#wsdl.port(WeatherForecast/WeatherForecastSoap)"
 />
         </reference>
         <service name="WeatherForecastSoap">
-            <binding.ws/> 
+            <binding.ws 
wsdlElement="http://www.webservicex.net#wsdl.port(WeatherForecast/WeatherForecastSoap)"
 />
         </service>
     </component>
 


Reply via email to