cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r816407 - in /cxf/trunk/distribution: ./ src/main/release/samples/wsdl_first/ src/main/release/samples/wsdl_first/src/demo/ src/main/release/samples/wsdl_first/src/main/ src/main/release/samples/wsdl_first/src/main/java/ src/main/release/sa...
Date Thu, 17 Sep 2009 23:09:44 GMT
Author: cschneider
Date: Thu Sep 17 23:09:43 2009
New Revision: 816407

URL: http://svn.apache.org/viewvc?rev=816407&view=rev
Log: (empty)

Added:
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/client-beans.xml
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceSpringServer.java
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/cxf-servlet.xml
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/log4j.conf
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/CustomerService.wsdl   (with props)
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/binding.xml   (with props)
Removed:
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/demo/
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/cxf-servlet.xml
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/hello_world.wsdl
Modified:
    cxf/trunk/distribution/pom.xml
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/README.txt
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/build.xml
    cxf/trunk/distribution/src/main/release/samples/wsdl_first/pom.xml

Modified: cxf/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/pom.xml?rev=816407&r1=816406&r2=816407&view=diff
==============================================================================
--- cxf/trunk/distribution/pom.xml (original)
+++ cxf/trunk/distribution/pom.xml Thu Sep 17 23:09:43 2009
@@ -276,6 +276,11 @@
              <groupId>com.sun.xml.fastinfoset</groupId>
              <artifactId>FastInfoset</artifactId>
         </dependency>
+        <dependency>
+                <groupId>junit</groupId>
+                <artifactId>junit</artifactId>
+                <scope>compile</scope>
+        </dependency>
 
         <dependency>
             <groupId>ant</groupId>

Modified: cxf/trunk/distribution/src/main/release/samples/wsdl_first/README.txt
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/README.txt?rev=816407&r1=816406&r2=816407&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/README.txt (original)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/README.txt Thu Sep 17 23:09:43 2009
@@ -120,10 +120,10 @@
 
 For UNIX (must use forward slashes):
     java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties
-         demo.hw.server.Server &
+         com.example.customerservice.server.Server &
 
     java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties
-         demo.hw.client.Client ./wsdl/hello_world.wsdl
+         com.example.customerservice.client.Client ./wsdl/hello_world.wsdl
 
 The server process starts in the background.  After running the client,
 use the kill command to terminate the server process.
@@ -131,10 +131,10 @@
 For Windows (may use either forward or back slashes):
   start 
     java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties
-         demo.hw.server.Server
+         com.example.customerservice.server.Server
 
     java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties
-       demo.hw.client.Client .\wsdl\hello_world.wsdl
+       com.example.customerservice.client.Client .\wsdl\hello_world.wsdl
 
 A new command windows opens for the server process.  After running the
 client, terminate the server process by issuing Ctrl-C in its command window.
@@ -167,12 +167,12 @@
   For UNIX:
     
     java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties
-         demo.hw.client.Client http://localhost:#/helloworld/services/hello_world?wsdl
+         com.example.customerservice.client.Client http://localhost:#/helloworld/services/hello_world?wsdl
 
   For Windows:
 
     java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties
-       demo.hw.client.Client http://localhost:#/helloworld/services/hello_world?wsdl
+       com.example.customerservice.client.Client http://localhost:#/helloworld/services/hello_world?wsdl
 
 Where # is the TCP/IP port used by the servlet container,
 e.g., 8080.

Modified: cxf/trunk/distribution/src/main/release/samples/wsdl_first/build.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/build.xml?rev=816407&r1=816406&r2=816407&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/build.xml (original)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/build.xml Thu Sep 17 23:09:43 2009
@@ -23,38 +23,25 @@
         
     <target name="client" description="run demo client" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="demo.hw.client.Client"
-            param1="${basedir}/wsdl/hello_world.wsdl" 
-            param2="${op}" 
-            param3="${param}"/>
+        <cxfrun classname="com.example.customerservice.client.CustomerServiceClient"/>
     </target>
     
     <target name="spring.client" description="run demo client which is created from the spring context" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="demo.hw.client.SpringClient"/>
+        <cxfrun classname="com.example.customerservice.client.CustomerServiceSpringClient"/>
     </target>     
         
     <target name="server" description="run demo server" depends="build">
-        <cxfrun classname="demo.hw.server.Server" 
-            param1="${basedir}/wsdl/hello_world.wsdl"/>
+        <cxfrun classname="com.example.customerservice.server.CustomerServiceServer" />
     </target>
 
     <target name="spring.server" description="run demo server which is created from the spring context" depends="build">
-        <cxfrun classname="demo.hw.server.SpringServer"/>
+        <cxfrun classname="com.example.customerservice.server.CustomerServiceSpringServer"/>
     </target>
 
-
-    <target name="client.get" description="run demo client through HTTP GET" depends="build">
-        <property name="param" value=""/>
-        <cxfrun classname="demo.hw.client.Get"
-            param1="${basedir}/wsdl/hello_world.wsdl" 
-            param2="${op}" 
-            param3="${param}"/>
-    </target>
-        
     <target name="generate.code">
         <echo level="info" message="Generating code using wsdl2java..."/>
-        <wsdl2java file="hello_world.wsdl"/>
+        <wsdl2java file="CustomerService.wsdl" bindingfile="wsdl/binding.xml"/>
     </target>
 
     <property name="cxf.war.file.name" value="helloworld"/>
@@ -64,6 +51,6 @@
 
     <target name="client-servlet" description="run demo client hitting servlet" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/services/hello_world?wsdl" param2="${op}" param3="${param}"/>
+        <cxfrun classname="com.example.customerservice.client.Client" param1="${base.url}/helloworld/services/hello_world?wsdl" param2="${op}" param3="${param}"/>
     </target> 
 </project>

Modified: cxf/trunk/distribution/src/main/release/samples/wsdl_first/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/pom.xml?rev=816407&r1=816406&r2=816407&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/pom.xml (original)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/pom.xml Thu Sep 17 23:09:43 2009
@@ -26,7 +26,14 @@
         <cxf.version>[2,)</cxf.version>
     </properties>
     <build>
-        <sourceDirectory>src</sourceDirectory>
+        <resources>
+            <resource>
+                <directory>wsdl</directory>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
         <plugins>
             <plugin>
                 <artifactId>maven-compiler-plugin</artifactId>
@@ -46,7 +53,10 @@
                         <configuration>
                             <wsdlOptions>
                                 <wsdlOption>
-                                    <wsdl>${basedir}/wsdl/hello_world.wsdl</wsdl>
+                                    <wsdl>${basedir}/wsdl/CustomerService.wsdl</wsdl>
+                                    <bindingFiles>
+                                        <bindingFile>${basedir}/wsdl/binding.xml</bindingFile>
+                                    </bindingFiles>
                                 </wsdlOption>
                             </wsdlOptions>
                         </configuration>
@@ -57,7 +67,7 @@
                 </executions>
             </plugin>
         </plugins>
-    </build>   
+    </build>
     <profiles>
         <profile>
             <id>server</id>
@@ -74,7 +84,7 @@
                                     <goal>java</goal>
                                 </goals>
                                 <configuration>
-                                    <mainClass>demo.hw.server.Server</mainClass>
+                                    <mainClass>com.example.customerservice.server.CustomerServiceServer</mainClass>
                                 </configuration>
                             </execution>
                         </executions>
@@ -97,7 +107,7 @@
                                     <goal>java</goal>
                                 </goals>
                                 <configuration>
-                                    <mainClass>demo.hw.client.Client</mainClass>
+                                    <mainClass>com.example.customerservice.client.CustomerServiceClient</mainClass>
                                     <arguments>
                                         <argument>${basedir}/wsdl/hello_world.wsdl</argument>
                                     </arguments>
@@ -119,7 +129,7 @@
                         <enabled>true</enabled>
                     </snapshots>
                 </repository>
-                    <!-- for jaxb-impl -->
+                <!-- for jaxb-impl -->
                 <repository>
                     <id>java.net</id>
                     <url>http://download.java.net/maven/1/</url>
@@ -167,5 +177,10 @@
             <artifactId>cxf-rt-transports-http-jetty</artifactId>
             <version>${cxf.version}</version>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.7</version>
+        </dependency>
     </dependencies>
 </project>

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java Thu Sep 17 23:09:43 2009
@@ -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 com.example.customerservice.client;
+
+import com.example.customerservice.CustomerService;
+import com.example.customerservice.CustomerServiceService;
+import com.example.customerservice.NoSuchCustomerException;
+
+public class CustomerServiceClient {
+    protected CustomerServiceClient() {
+    }
+    
+    public static void main(String args[]) throws NoSuchCustomerException {
+        // Create the service client with its default wsdlurl
+        CustomerServiceService customerServiceService = new CustomerServiceService();
+        CustomerService customerService = customerServiceService.getCustomerServicePort();
+        
+        // Initialize the test class and call the tests
+        CustomerServiceTester client = new CustomerServiceTester();
+        client.setCustomerService(customerService);
+        client.testCustomerService();
+        System.exit(0); 
+    }
+}

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java Thu Sep 17 23:09:43 2009
@@ -0,0 +1,39 @@
+/**
+ * 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 com.example.customerservice.client;
+
+
+
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public final class CustomerServiceSpringClient {
+
+    private CustomerServiceSpringClient() {
+    }
+
+    public static void main(String args[]) throws Exception {
+        // Initialize the spring context and fetch our test client
+        ClassPathXmlApplicationContext context 
+            = new ClassPathXmlApplicationContext(new String[] {"classpath:client-applicationContext.xml"});
+        CustomerServiceTester client = (CustomerServiceTester)context.getBean("tester");
+        
+        client.testCustomerService();
+        System.exit(0);
+    }
+}

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java Thu Sep 17 23:09:43 2009
@@ -0,0 +1,67 @@
+/**
+ * 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 com.example.customerservice.client;
+
+import java.util.List;
+
+import junit.framework.Assert;
+
+import com.example.customerservice.Customer;
+import com.example.customerservice.CustomerService;
+import com.example.customerservice.NoSuchCustomerException;
+
+public final class CustomerServiceTester {
+    
+    // The CustomerService proxy will be injected either by spring or by a direct call to the setter 
+    CustomerService customerService;
+    
+    public CustomerService getCustomerService() {
+        return customerService;
+    }
+
+    public void setCustomerService(CustomerService customerService) {
+        this.customerService = customerService;
+    }
+
+    public void testCustomerService() throws NoSuchCustomerException {
+        List<Customer> customers = null;
+        
+        // First we test the positive case where customers are found and we retreive
+        // a list of customers
+        System.out.println("Sending request for customers named Smith");
+        customers = customerService.getCustomersByName("Smith");
+        System.out.println("Response received");
+        Assert.assertEquals(2, customers.size());
+        Assert.assertEquals("Smith", customers.get(0).getName());
+        
+        // Then we test for an unknown Customer name and expect the NoSuchCustomerException
+        try {
+            customers = customerService.getCustomersByName("None");
+            Assert.fail("We should get a NoSuchCustomerException here");
+        } catch (NoSuchCustomerException e) {
+            System.out.println(e.getMessage());
+            Assert.assertNotNull("FaultInfo must not be null", e.getFaultInfo());
+            Assert.assertEquals("None", e.getFaultInfo().getCustomerName());
+            System.out.println("NoSuchCustomer exception was received as expected");
+        }
+        System.out.println("All calls were succesful");
+    }
+
+}

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/client-beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/client-beans.xml?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/client-beans.xml (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/client-beans.xml Thu Sep 17 23:09:43 2009
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+	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.
+-->
+<!-- START SNIPPET: beans -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:jaxws="http://cxf.apache.org/jaxws"
+	xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+
+   <jaxws:client id="customerService" 
+    serviceClass="org.apache.hello_world_soap_http.Greeter"
+    serviceName="s:SOAPService"
+    endpointName="s:SoapPort"
+    xmlns:s="http://apache.org/hello_world_soap_http"
+    wsdlLocation="wsdl/hello_world.wsdl"
+    address="http://localhost:9000/SoapContext/SoapPort"/>	  
+    <bean id="client" class="com.example.customerservice.Client">
+    	<property name=""></property>
+    </bean>
+</beans>
+<!-- END SNIPPET: beans -->

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java Thu Sep 17 23:09:43 2009
@@ -0,0 +1,70 @@
+/**
+ * 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 com.example.customerservice.server;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+import com.example.customerservice.Customer;
+import com.example.customerservice.CustomerService;
+import com.example.customerservice.CustomerType;
+import com.example.customerservice.NoSuchCustomer;
+import com.example.customerservice.NoSuchCustomerException;
+
+public class CustomerServiceImpl implements CustomerService {
+    @Resource
+    WebServiceContext wsContext;
+
+    public List<Customer> getCustomersByName(String name) throws NoSuchCustomerException {
+        if ("None".equals(name)) {
+            NoSuchCustomer noSuchCustomer = new NoSuchCustomer();
+            noSuchCustomer.setCustomerName(name);
+            throw new NoSuchCustomerException("Did not find any matching customer for name=" + name,
+                                              noSuchCustomer);
+        }
+
+        List<Customer> customers = new ArrayList<Customer>();
+        for (int c = 0; c < 2; c++) {
+            Customer cust = new Customer();
+            cust.setName(name);
+            cust.getAddress().add("Pine Street 200");
+            Date bDate = new GregorianCalendar(2009, 01, 01).getTime();
+            cust.setBirthDate(bDate);
+            cust.setNumOrders(1);
+            cust.setRevenue(10000);
+            cust.setTest(new BigDecimal(1.5));
+            cust.setType(CustomerType.BUSINESS);
+            customers.add(cust);
+        }
+
+        return customers;
+    }
+
+    public void updateCustomer(Customer customer) {
+        // TODO Auto-generated method stub
+
+    }
+
+}

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java Thu Sep 17 23:09:43 2009
@@ -0,0 +1,50 @@
+/**
+ * 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 com.example.customerservice.server;
+
+import javax.xml.ws.Endpoint;
+
+import com.example.customerservice.CustomerService;
+
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.EndpointImpl;
+
+public class CustomerServiceServer {
+
+    protected CustomerServiceServer() throws Exception {
+        System.out.println("Starting Server");
+        CustomerService implementor = new CustomerServiceImpl();
+        EndpointImpl ep = (EndpointImpl)Endpoint.publish("http://localhost:9090/CustomerServicePort",
+                                                         implementor);
+
+        // Adding logging for incoming and outgoing messages
+        ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
+        ep.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
+    }
+
+    public static void main(String args[]) throws Exception {
+        new CustomerServiceServer();
+        System.out.println("Server ready...");
+        System.in.read();
+        System.out.println("Server exiting");
+        System.exit(0);
+    }
+}

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceSpringServer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceSpringServer.java?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceSpringServer.java (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceSpringServer.java Thu Sep 17 23:09:43 2009
@@ -0,0 +1,32 @@
+/**
+ * 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 com.example.customerservice.server;
+
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class CustomerServiceSpringServer {
+    
+    protected CustomerServiceSpringServer() {
+    }
+
+    public static void main(String args[]) throws Exception {
+        new ClassPathXmlApplicationContext("server-applicationContext.xml");
+        System.in.read();
+    }
+}

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml Thu Sep 17 23:09:43 2009
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		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.
+	-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:jaxws="http://cxf.apache.org/jaxws"
+	xmlns:customer="http://customerservice.example.com/"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
+		http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+		http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+">
+
+	<import resource="classpath:META-INF/cxf/cxf.xml" />
+	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
+
+	<!--
+		Define a cxf endpoint based on client stub generated from a wsdl. It
+		is important to provide serviceName and endpointName so the wsdl is
+		not needed at runtime. As far as I know the serviceName and
+		endpointName do not have to have a special convention but it is good
+		practice to use the service namespace and Service Interface name in
+		the names
+	-->
+	<jaxws:client id="customerService" 
+		serviceName="customer:CustomerServiceService" 
+		endpointName="customer:CustomerServiceEndpoint"
+		address="http://localhost:9090/CustomerServicePort" 
+		serviceClass="com.example.customerservice.CustomerService">
+	</jaxws:client>
+	
+	<bean id="tester" class="com.example.customerservice.client.CustomerServiceTester">
+		<property name="customerService" ref="customerService"></property>
+	</bean>
+</beans>

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/cxf-servlet.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/cxf-servlet.xml?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/cxf-servlet.xml (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/cxf-servlet.xml Thu Sep 17 23:09:43 2009
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:jaxws="http://cxf.apache.org/jaxws"
+      xmlns:soap="http://cxf.apache.org/bindings/soap"
+      xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+
+    <jaxws:endpoint
+        id="hello_world"
+        implementor="demo.hw.server.GreeterImpl"
+        wsdlLocation="WEB-INF/wsdl/hello_world.wsdl"
+        address="/hello_world">
+                <jaxws:features>
+ 		    <bean class="org.apache.cxf.feature.LoggingFeature"/>
+                </jaxws:features>
+    </jaxws:endpoint>
+</beans>

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/log4j.conf
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/log4j.conf?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/log4j.conf (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/log4j.conf Thu Sep 17 23:09:43 2009
@@ -0,0 +1,6 @@
+log4j.rootLogger = INFO, console
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%-5p %c %x - %m%n

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml Thu Sep 17 23:09:43 2009
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		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.
+	-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
+		http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+		http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+">
+
+	<import resource="classpath:META-INF/cxf/cxf.xml" />
+	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
+	<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
+	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+
+	<!-- HTTP Endpoint -->
+	<jaxws:endpoint xmlns:customer="http://customerservice.example.com/"
+		id="CustomerServiceHTTP" address="http://localhost:9090/CustomerServicePort"
+		serviceName="customer:CustomerServiceService" endpointName="customer:CustomerServiceEndpoint"
+		implementor="com.example.customerservice.server.CustomerServiceImpl">
+		<jaxws:features>
+			<bean class="org.apache.cxf.feature.LoggingFeature" />
+		</jaxws:features>
+	</jaxws:endpoint>
+
+</beans>

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/CustomerService.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/CustomerService.wsdl?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/CustomerService.wsdl (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/CustomerService.wsdl Thu Sep 17 23:09:43 2009
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<wsdl:definitions name="CustomerServiceService" targetNamespace="http://customerservice.example.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://customerservice.example.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:types>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://customerservice.example.com/" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://customerservice.example.com/">
+<xs:element name="getCustomersByName" type="tns:getCustomersByName"/>
+<xs:element name="getCustomersByNameResponse" type="tns:getCustomersByNameResponse"/>
+<xs:element name="updateCustomer" type="tns:updateCustomer"/>
+<xs:complexType name="updateCustomer">
+<xs:sequence>
+<xs:element minOccurs="0" name="customer" type="tns:customer"/>
+</xs:sequence>
+</xs:complexType>
+<xs:complexType name="customer">
+<xs:sequence>
+<xs:element name="customerId" type="xs:int"/>
+<xs:element minOccurs="0" name="name" type="xs:string"/>
+<xs:element maxOccurs="unbounded" minOccurs="0" name="address" nillable="true" type="xs:string"/>
+<xs:element minOccurs="0" name="numOrders" type="xs:int"/>
+<xs:element name="revenue" type="xs:double"/>
+<xs:element minOccurs="0" name="test" type="xs:decimal"/>
+<xs:element minOccurs="0" name="birthDate" type="xs:date"/>
+<xs:element minOccurs="0" name="type" type="tns:customerType"/>
+</xs:sequence>
+</xs:complexType>
+<xs:complexType name="getCustomersByName">
+<xs:sequence>
+<xs:element minOccurs="0" name="name" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:complexType name="getCustomersByNameResponse">
+<xs:sequence>
+<xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:customer"/>
+</xs:sequence>
+</xs:complexType>
+<xs:simpleType name="customerType">
+<xs:restriction base="xs:string">
+<xs:enumeration value="PRIVATE"/>
+<xs:enumeration value="BUSINESS"/>
+</xs:restriction>
+</xs:simpleType>
+<xs:element name="NoSuchCustomer" type="tns:NoSuchCustomer"/>
+<xs:complexType name="NoSuchCustomer">
+<xs:sequence>
+<xs:element name="customerName" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+</xs:schema>
+  </wsdl:types>
+  <wsdl:message name="getCustomersByNameResponse">
+    <wsdl:part name="parameters" element="tns:getCustomersByNameResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="getCustomersByName">
+    <wsdl:part name="parameters" element="tns:getCustomersByName">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="updateCustomer">
+    <wsdl:part name="parameters" element="tns:updateCustomer">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="NoSuchCustomerException">
+    <wsdl:part name="NoSuchCustomerException" element="tns:NoSuchCustomer">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="CustomerService">
+    <wsdl:operation name="updateCustomer">
+      <wsdl:input name="updateCustomer" message="tns:updateCustomer">
+    </wsdl:input>
+    </wsdl:operation>
+    <wsdl:operation name="getCustomersByName">
+      <wsdl:input name="getCustomersByName" message="tns:getCustomersByName">
+    </wsdl:input>
+      <wsdl:output name="getCustomersByNameResponse" message="tns:getCustomersByNameResponse">
+    </wsdl:output>
+      <wsdl:fault name="NoSuchCustomerException" message="tns:NoSuchCustomerException">
+    </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="CustomerServiceServiceSoapBinding" type="tns:CustomerService">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="updateCustomer">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input name="updateCustomer">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+    <wsdl:operation name="getCustomersByName">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input name="getCustomersByName">
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="getCustomersByNameResponse">
+        <soap:body use="literal"/>
+      </wsdl:output>
+      <wsdl:fault name="NoSuchCustomerException">
+        <soap:fault name="NoSuchCustomerException" use="literal"/>
+      </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="CustomerServiceService">
+    <wsdl:port name="CustomerServicePort" binding="tns:CustomerServiceServiceSoapBinding">
+      <soap:address location="http://localhost:9090/CustomerServicePort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Propchange: cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/CustomerService.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/binding.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/binding.xml?rev=816407&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/binding.xml (added)
+++ cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/binding.xml Thu Sep 17 23:09:43 2009
@@ -0,0 +1,17 @@
+<jaxws:bindings wsdlLocation="CustomerService.wsdl"
+          xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
+          xmlns:xs="http://www.w3.org/2001/XMLSchema"
+          xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  <!-- <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping> -->
+  <jaxws:bindings  node="wsdl:definitions/wsdl:types/xs:schema">
+      <jxb:globalBindings>
+        <jxb:javaType name="java.util.Date" xmlType="xs:dateTime"
+                      parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime"
+                      printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDateTime"/>
+        <jxb:javaType name="java.util.Date" xmlType="xs:date"
+                      parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDate"
+                      printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDate"/>
+      </jxb:globalBindings>
+  </jaxws:bindings>
+</jaxws:bindings>
\ No newline at end of file

Propchange: cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/binding.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message