/** * @author Hyacinthe MENIET * Created on 22 juil. 07 */ package net.dotmyself.wsclient; import net.dotmyself.ws.Department; import net.dotmyself.ws.DepartmentInformationService; import net.dotmyself.ws.DepartmentService; /** * Synchronous Client for Department's Web service */ public class SynchDepartmentWSClient { /** * The main method. * @param args the department's code * @throws Exception */ public static void main(String[] args) throws Exception { if(args == null || args.length < 1) { throw new IllegalArgumentException("You must indicate a department code"); } int code = Integer.parseInt(args[0]); // Synchronous Invocation DepartmentInformationService departInfoService = new DepartmentInformationService(); DepartmentService departService = departInfoService.getDepartmentServicePort(); Department dept = departService.getDepartment(code); System.out.println("Population ="+dept.getPopulation()+" habs, " +"Surface="+dept.getSurface()+" km2, " +"Urbanization="+dept.getUrbanization()); } }