KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > capeclear > www > GlobalWeather_wsdl > GlobalWeather_ServiceLocator


1 /**
2  * GlobalWeather_ServiceLocator.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis WSDL2Java emitter.
6  */

7
8 package com.capeclear.www.GlobalWeather_wsdl;
9
10 import javax.xml.rpc.ServiceException JavaDoc;
11 import javax.xml.namespace.QName JavaDoc;
12
13 import java.net.MalformedURLException JavaDoc;
14 import java.net.URL JavaDoc;
15 import java.rmi.Remote JavaDoc;
16
17 public class GlobalWeather_ServiceLocator extends org.apache.axis.client.Service implements GlobalWeather_Service {
18
19     // GlobalWeather
20

21     // Use to get a proxy class for GlobalWeather
22
private final String JavaDoc GlobalWeather_address = "http://live.capescience.com:80/ccx/GlobalWeather";
23
24     public String JavaDoc getGlobalWeatherAddress() {
25         return GlobalWeather_address;
26     }
27
28     // The WSDD service name defaults to the port name.
29
private String JavaDoc GlobalWeatherWSDDServiceName = "GlobalWeather";
30
31     public String JavaDoc getGlobalWeatherWSDDServiceName() {
32         return GlobalWeatherWSDDServiceName;
33     }
34
35     public void setGlobalWeatherWSDDServiceName(String JavaDoc name) {
36         GlobalWeatherWSDDServiceName = name;
37     }
38
39     public GlobalWeather_Port getGlobalWeather() throws ServiceException JavaDoc {
40        URL JavaDoc endpoint;
41         try {
42             endpoint = new java.net.URL JavaDoc(GlobalWeather_address);
43         }
44         catch (MalformedURLException JavaDoc e) {
45             throw new ServiceException JavaDoc(e);
46         }
47         return getGlobalWeather(endpoint);
48     }
49
50     public GlobalWeather_Port getGlobalWeather(URL JavaDoc portAddress) throws ServiceException JavaDoc {
51         try {
52             GlobalWeatherStub _stub = new GlobalWeatherStub(portAddress, this);
53             _stub.setPortName(getGlobalWeatherWSDDServiceName());
54             return _stub;
55         }
56         catch (org.apache.axis.AxisFault e) {
57             return null;
58         }
59     }
60
61
62     // Use to get a proxy class for StationInfo
63
private final String JavaDoc StationInfo_address = "http://live.capescience.com:80/ccx/GlobalWeather";
64
65     public String JavaDoc getStationInfoAddress() {
66         return StationInfo_address;
67     }
68
69     // The WSDD service name defaults to the port name.
70
private String JavaDoc StationInfoWSDDServiceName = "StationInfo";
71
72     public String JavaDoc getStationInfoWSDDServiceName() {
73         return StationInfoWSDDServiceName;
74     }
75
76     public void setStationInfoWSDDServiceName(String JavaDoc name) {
77         StationInfoWSDDServiceName = name;
78     }
79
80     public StationInfo getStationInfo() throws ServiceException JavaDoc {
81        java.net.URL JavaDoc endpoint;
82         try {
83             endpoint = new URL JavaDoc(StationInfo_address);
84         }
85         catch (MalformedURLException JavaDoc e) {
86             throw new ServiceException JavaDoc(e);
87         }
88         return getStationInfo(endpoint);
89     }
90
91     public StationInfo getStationInfo(URL JavaDoc portAddress) throws ServiceException JavaDoc {
92         try {
93             StationInfoStub _stub = new StationInfoStub(portAddress, this);
94             _stub.setPortName(getStationInfoWSDDServiceName());
95             return _stub;
96         }
97         catch (org.apache.axis.AxisFault e) {
98             return null;
99         }
100     }
101
102     /**
103      * For the given interface, get the stub implementation.
104      * If this service has no port for the given interface,
105      * then ServiceException is thrown.
106      */

107     public Remote JavaDoc getPort(Class JavaDoc serviceEndpointInterface) throws ServiceException JavaDoc {
108         try {
109             if (GlobalWeather_Port.class.isAssignableFrom(serviceEndpointInterface)) {
110                 GlobalWeatherStub _stub = new GlobalWeatherStub(new URL JavaDoc(GlobalWeather_address), this);
111                 _stub.setPortName(getGlobalWeatherWSDDServiceName());
112                 return _stub;
113             }
114             if (StationInfo.class.isAssignableFrom(serviceEndpointInterface)) {
115                 StationInfoStub _stub = new StationInfoStub(new URL JavaDoc(StationInfo_address), this);
116                 _stub.setPortName(getStationInfoWSDDServiceName());
117                 return _stub;
118             }
119         }
120         catch (java.lang.Throwable JavaDoc t) {
121             throw new ServiceException JavaDoc(t);
122         }
123         throw new ServiceException JavaDoc("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
124     }
125
126     /**
127      * For the given interface, get the stub implementation.
128      * If this service has no port for the given interface,
129      * then ServiceException is thrown.
130      */

131     public Remote JavaDoc getPort(QName JavaDoc portName, Class JavaDoc serviceEndpointInterface) throws ServiceException JavaDoc {
132         if (portName == null) {
133             return getPort(serviceEndpointInterface);
134         }
135         String JavaDoc inputPortName = portName.getLocalPart();
136         if ("GlobalWeather".equals(inputPortName)) {
137             return getGlobalWeather();
138         }
139         else if ("StationInfo".equals(inputPortName)) {
140             return getStationInfo();
141         }
142         else {
143             Remote JavaDoc _stub = getPort(serviceEndpointInterface);
144             ((org.apache.axis.client.Stub) _stub).setPortName(portName);
145             return _stub;
146         }
147     }
148
149     public QName JavaDoc getServiceName() {
150         return new QName JavaDoc("http://www.capeclear.com/GlobalWeather.wsdl", "GlobalWeather");
151     }
152
153     private java.util.HashSet JavaDoc ports = null;
154
155     public java.util.Iterator JavaDoc getPorts() {
156         if (ports == null) {
157             ports = new java.util.HashSet JavaDoc();
158             ports.add(new QName JavaDoc("GlobalWeather"));
159             ports.add(new QName JavaDoc("StationInfo"));
160         }
161         return ports.iterator();
162     }
163
164 }
165
Popular Tags