package org.codehaus.xfire.jaxb; import java.util.Hashtable; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import net.webservicex.AddLocation; import net.webservicex.AddWeather; import net.webservicex.GetWeatherByZipCode; import net.webservicex.GetWeatherByZipCodeResponse; import net.webservicex.ModuleParam; import net.webservicex.WeatherDataType; @WebService(endpointInterface="org.codehaus.xfire.jaxb.WeatherService", serviceName="WeatherService") @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE) public class WeatherServiceImpl implements WeatherService { public GetWeatherByZipCodeResponse GetWeatherByZipCode(GetWeatherByZipCode body, ModuleParam param) { GetWeatherByZipCodeResponse res = new GetWeatherByZipCodeResponse(); String zipCode = body.getZipCode(); System.out.println("ModuleParam:" + param); if (param != null) { System.out.println("ModuleId:" + param.getModuleId()); System.out.println("AdditionalParam:" + param.getAdditionalParam()); System.out.println("SessionId:" + param.getSessionId()); } res.setLocation(WeatherCache.getLocation(zipCode)); Hashtable ht = WeatherCache.getWeathers(zipCode); res.getWeather().addAll(ht.values()); return res; } public void AddWeather(AddWeather body, ModuleParam param) { System.out.println("ModuleParam:" + param); if (param != null) { System.out.println("ModuleId:" + param.getModuleId()); System.out.println("AdditionalParam:" + param.getAdditionalParam()); System.out.println("SessionId:" + param.getSessionId()); } WeatherCache.addWeatherData(body.getZipCode(), body.getWeatherData()); } public void AddLocation(AddLocation body, ModuleParam param) { System.out.println("ModuleParam:" + param); if (param != null) { System.out.println("ModuleId:" + param.getModuleId()); System.out.println("AdditionalParam:" + param.getAdditionalParam()); System.out.println("SessionId:" + param.getSessionId()); } WeatherCache.addLocation(body.getZipCode(), body.getLocationData()); } }