View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.cxf.weatherservice.myweather;
8   
9   import java.io.File;
10  import java.net.MalformedURLException;
11  import java.net.URL;
12  
13  import javax.xml.namespace.QName;
14  
15  public final class WeatherHttpPost_WeatherHttpPost_Client {
16  
17      private static final QName SERVICE_NAME = new QName("http://ws.cdyne.com/WeatherWS/", "Weather");
18  
19      public static void main(String args[]) throws Exception {
20          URL wsdlURL = Weather.WSDL_LOCATION;
21          if (args.length > 0) {
22              File wsdlFile = new File(args[0]);
23              try {
24                  if (wsdlFile.exists()) {
25                      wsdlURL = wsdlFile.toURI().toURL();
26                  } else {
27                      wsdlURL = new URL(args[0]);
28                  }
29              } catch (MalformedURLException e) {
30                  e.printStackTrace();
31              }
32          }
33  
34          Weather ss = new Weather(wsdlURL, SERVICE_NAME);
35          WeatherHttpPost port = ss.getWeatherHttpPost();
36  
37          {
38          System.out.println("Invoking getCityWeatherByZIP...");
39          String _getCityWeatherByZIP_zip = "";
40          WeatherReturn _getCityWeatherByZIP__return = port.getCityWeatherByZIP(_getCityWeatherByZIP_zip);
41          System.out.println("getCityWeatherByZIP.result=" + _getCityWeatherByZIP__return);
42  
43  
44          }
45          {
46          System.out.println("Invoking getWeatherInformation...");
47          ArrayOfWeatherDescription _getWeatherInformation__return = port.getWeatherInformation();
48          System.out.println("getWeatherInformation.result=" + _getWeatherInformation__return);
49  
50  
51          }
52          {
53          System.out.println("Invoking getCityForecastByZIP...");
54          String _getCityForecastByZIP_zip = "";
55          ForecastReturn _getCityForecastByZIP__return = port.getCityForecastByZIP(_getCityForecastByZIP_zip);
56          System.out.println("getCityForecastByZIP.result=" + _getCityForecastByZIP__return);
57  
58  
59          }
60  
61          System.exit(0);
62      }
63  
64  }