Author: ffang
Date: Wed May  5 07:51:17 2010
New Revision: 941188

URL: http://svn.apache.org/viewvc?rev=941188&view=rev
Log:
Merged revisions 941187 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r941187 | ffang | 2010-05-05 15:37:34 +0800 (δΈ‰, 05  5 2010) | 1 line
  
  [CXF-2799]ant client-servlet doesn't work for wsdl-first demo anymore
........

Added:
    
cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/wsdl/cxf-servlet.xml
      - copied unchanged from r941187, 
cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/cxf-servlet.xml
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    
cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml
    
cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml?rev=941188&r1=941187&r2=941188&view=diff
==============================================================================
--- 
cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml
 (original)
+++ 
cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml
 Wed May  5 07:51:17 2010
@@ -51,6 +51,6 @@
 
     <target name="client-servlet" description="run demo client hitting 
servlet" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="com.example.customerservice.client.Client" 
param1="${base.url}/helloworld/services/hello_world?wsdl" param2="${op}" 
param3="${param}"/>
+        <cxfrun 
classname="com.example.customerservice.client.CustomerServiceClient" 
param1="${base.url}/helloworld/services/CustomerServicePort?wsdl" 
param2="${op}" param3="${param}"/>
     </target> 
 </project>

Modified: 
cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java?rev=941188&r1=941187&r2=941188&view=diff
==============================================================================
--- 
cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java
 (original)
+++ 
cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java
 Wed May  5 07:51:17 2010
@@ -18,6 +18,9 @@
  */
 package com.example.customerservice.client;
 
+import java.io.File;
+import java.net.URL;
+
 import com.example.customerservice.CustomerService;
 import com.example.customerservice.CustomerServiceService;
 import com.example.customerservice.NoSuchCustomerException;
@@ -26,9 +29,23 @@ 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();
+    public static void main(String args[]) throws Exception {
+        CustomerServiceService customerServiceService;
+        if (args.length != 0 && args[0].length() != 0) {
+            File wsdlFile = new File(args[0]);
+            URL wsdlURL;
+            if (wsdlFile.exists()) {
+                wsdlURL = wsdlFile.toURL();
+            } else {
+                wsdlURL = new URL(args[0]);
+            }
+            // Create the service client with specified wsdlurl
+            customerServiceService = new CustomerServiceService(wsdlURL);
+        } else {
+            // Create the service client with its default wsdlurl
+            customerServiceService = new CustomerServiceService();
+        }
+
         CustomerService customerService = 
customerServiceService.getCustomerServicePort();
         
         // Initialize the test class and call the tests


Reply via email to