public static void main(String args[]) { try { SpringBusFactory bf = new SpringBusFactory(); URL busFile = Client.class.getResource("/client.xml"); Bus bus = bf.createBus(busFile.toString()); BusFactory.setDefaultBus(bus); SOAPService service = new SOAPService(); Greeter port = service.getSoapPort(); System.out.println("Invoking sayHi..."); String resp = port.sayHi(); System.out.println("Server responded with: " + resp + "\n"); System.out.println("Invoking greetMe..."); resp = port.greetMe(USER_NAME); System.out.println("Server responded with: " + resp + "\n"); System.out.println("Invoking greetMeOneWay..."); port.greetMeOneWay(USER_NAME); System.out.println("No response from server as method is OneWay\n"); try { System.out.println("Invoking pingMe, expecting exception..."); port.pingMe(); } catch (PingMeFault ex) { System.out.println("Expected exception occurred: " + ex); } } catch (Exception ex) { ex.printStackTrace(); } finally { System.exit(0); } }