1 package demo.hw.server; 2 3 import java.util.logging.Logger ; 4 import org.objectweb.hello_world_soap_http.Greeter; 5 import org.objectweb.hello_world_soap_http.PingMeFault; 6 import org.objectweb.hello_world_soap_http.types.FaultDetail; 7 8 @javax.jws.WebService(name = "Greeter", serviceName = "SOAPService", 9 targetNamespace = "http://objectweb.org/hello_world_soap_http", 10 wsdlLocation = "file:./wsdl/hello_world.wsdl") 11 12 public class GreeterImpl implements Greeter { 13 14 private static final Logger LOG = 15 Logger.getLogger(GreeterImpl.class.getPackage().getName()); 16 17 20 public String greetMe(String me) { 21 LOG.info("Executing operation greetMe"); 22 System.out.println("Executing operation greetMe"); 23 System.out.println("Message received: " + me + "\n"); 24 return "Hello " + me; 25 } 26 27 30 public void greetMeOneWay(String me) { 31 LOG.info("Executing operation greetMeOneWay"); 32 System.out.println("Executing operation greetMeOneWay\n"); 33 System.out.println("Hello there " + me); 34 } 35 36 39 public String sayHi() { 40 LOG.info("Executing operation sayHi"); 41 System.out.println("Executing operation sayHi\n"); 42 return "Bonjour"; 43 } 44 45 public void pingMe() throws PingMeFault { 46 FaultDetail faultDetail = new FaultDetail(); 47 faultDetail.setMajor((short)2); 48 faultDetail.setMinor((short)1); 49 LOG.info("Executing operation pingMe, throwing PingMeFault exception"); 50 System.out.println("Executing operation pingMe, throwing PingMeFault exception\n"); 51 throw new PingMeFault("PingMeFault raised by server", faultDetail); 52 } 53 54 55 } 56 | Popular Tags |