01: package demo.ws_rm.server;
02:
03: import java.util.logging.Logger;
04: import org.objectweb.hello_world_soap_http.Greeter;
05: import org.objectweb.hello_world_soap_http.PingMeFault;
06: import org.objectweb.hello_world_soap_http.types.FaultDetail;
07:
08: @javax.jws.WebService(name="Greeter",serviceName="SOAPService",targetNamespace="http://objectweb.org/hello_world_soap_http",wsdlLocation="file:./wsdl/hello_world_rm.wsdl")
09: public class GreeterImpl implements Greeter {
10:
11: private static final Logger LOG = Logger
12: .getLogger(GreeterImpl.class.getPackage().getName());
13:
14: /* (non-Javadoc)
15: * @see org.objectweb.hello_world_soap_http.Greeter#greetMe(java.lang.String)
16: */
17: public String greetMe(String me) {
18: LOG.info("Executing operation greetMe");
19: System.out.println("Executing operation greetMe");
20: System.out.println("Message received: " + me + "\n");
21: return "Hello " + me;
22: }
23:
24: /* (non-Javadoc)
25: * @see org.objectweb.hello_world_soap_http.Greeter#greetMeOneWay(java.lang.String)
26: */
27: public void greetMeOneWay(String me) {
28: LOG.info("Executing operation greetMeOneWay");
29: System.out.println("Executing operation greetMeOneWay\n");
30: System.out.println("Hello there " + me);
31: }
32:
33: /* (non-Javadoc)
34: * @see org.objectweb.hello_world_soap_http.Greeter#sayHi()
35: */
36: public String sayHi() {
37: LOG.info("Executing operation sayHi");
38: System.out.println("Executing operation sayHi\n");
39: return "Bonjour";
40: }
41:
42: public void pingMe() throws PingMeFault {
43: FaultDetail faultDetail = new FaultDetail();
44: faultDetail.setMajor((short) 2);
45: faultDetail.setMinor((short) 1);
46: LOG
47: .info("Executing operation pingMe, throwing PingMeFault exception");
48: System.out
49: .println("Executing operation pingMe, throwing PingMeFault exception\n");
50: throw new PingMeFault("PingMeFault raised by server",
51: faultDetail);
52: }
53:
54: }
|