Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
package routines;
public class MyAsyncWeather extends Thread{
public String result;
private String cityCode;
public MyAsyncWeather(String cityCode)
{
this.cityCode = cityCode;
}
public void run() {
try
{
System.out.println("Thread starts : ");
routines.WeatherSoap_PortType weatherSoap = new routines.WeatherLocator().getWeatherSoap();
//routines.WeatherSoap_BindingStub stub = (routines.WeatherSoap_BindingStub)weatherSoap;
result = weatherSoap.getWeather(cityCode);
System.out.println("Thread ends : "+result);
}
catch(Exception e)
{
System.err.println(e.getLocalizedMessage());
}
}
}
MyAsyncWeather myAsyncWeather = new MyAsyncWeather("Paris");
myAsyncWeather.start();