KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > systest > dispatch > GreeterImpl


1 package org.objectweb.celtix.systest.dispatch;
2
3 import java.util.concurrent.Future JavaDoc;
4
5 import javax.jws.WebService;
6 import javax.xml.ws.AsyncHandler;
7 import javax.xml.ws.Response;
8
9 import org.objectweb.hello_world_soap_http.BadRecordLitFault;
10 import org.objectweb.hello_world_soap_http.Greeter;
11 import org.objectweb.hello_world_soap_http.NoSuchCodeLitFault;
12 import org.objectweb.hello_world_soap_http.types.BareDocumentResponse;
13 import org.objectweb.hello_world_soap_http.types.ErrorCode;
14 import org.objectweb.hello_world_soap_http.types.GreetMeResponse;
15 import org.objectweb.hello_world_soap_http.types.GreetMeSometimeResponse;
16 import org.objectweb.hello_world_soap_http.types.NoSuchCodeLit;
17 import org.objectweb.hello_world_soap_http.types.SayHiResponse;
18 import org.objectweb.hello_world_soap_http.types.TestDocLitFaultResponse;
19
20 import static junit.framework.Assert.assertTrue;
21 @WebService(serviceName = "SOAPService",
22             portName = "SoapPort",
23             endpointInterface = "org.objectweb.hello_world_soap_http.Greeter")
24 public class GreeterImpl implements Greeter {
25
26     public String JavaDoc greetMe(String JavaDoc me) {
27         return "Hello " + me;
28     }
29
30     public String JavaDoc sayHi() {
31         return "Bonjour";
32     }
33
34     public void testDocLitFault(String JavaDoc faultType) throws BadRecordLitFault, NoSuchCodeLitFault {
35         if (faultType.equals(BadRecordLitFault.class.getSimpleName())) {
36             throw new BadRecordLitFault("TestBadRecordLit", "BadRecordLitFault");
37         }
38         if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) {
39             ErrorCode ec = new ErrorCode();
40             ec.setMajor((short)1);
41             ec.setMinor((short)1);
42             NoSuchCodeLit nscl = new NoSuchCodeLit();
43             nscl.setCode(ec);
44             throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl);
45         }
46     }
47
48     public void greetMeOneWay(String JavaDoc requestType) {
49         System.out.println("********* greetMeOneWay: " + requestType);
50         assertTrue(requestType.equals("TestSOAPInputMessage1"));
51     }
52     
53     public String JavaDoc greetMeSometime(String JavaDoc me) {
54         //System.err.println("In greetMeSometime: " + me);
55
return "How are you " + me;
56     }
57     
58     public BareDocumentResponse testDocLitBare(String JavaDoc in) {
59         BareDocumentResponse res = new BareDocumentResponse();
60         res.setCompany("Celtix");
61         res.setId(1);
62         return res;
63     }
64     
65     public Future JavaDoc<?> greetMeSometimeAsync(String JavaDoc requestType,
66                                            AsyncHandler<GreetMeSometimeResponse> asyncHandler) {
67         System.err.println("In greetMeSometimeAsync 1");
68         return null;
69         /*not called */
70     }
71     
72     public Response<GreetMeSometimeResponse> greetMeSometimeAsync(String JavaDoc requestType) {
73         System.err.println("In greetMeSometimeAsync 2");
74         return null;
75         /*not called */
76     }
77     
78     public Response<TestDocLitFaultResponse> testDocLitFaultAsync(String JavaDoc faultType) {
79         System.err.println("In testDocLitFaultAsync 1");
80         return null;
81         /*not called */
82     }
83     
84     public Future JavaDoc<?> testDocLitFaultAsync(String JavaDoc faultType, AsyncHandler ah) {
85         System.err.println("In testDocLitFaultAsync 2");
86         return null;
87         /*not called */
88     }
89     
90     public Future JavaDoc<?> testDocLitBareAsync(String JavaDoc bare, AsyncHandler ah) {
91         return null;
92         /* not called */
93     }
94     
95     public Response<BareDocumentResponse> testDocLitBareAsync(String JavaDoc bare) {
96         return null;
97         /* not called */
98     }
99     
100     public Future JavaDoc<?> greetMeAsync(String JavaDoc requestType, AsyncHandler<GreetMeResponse> asyncHandler) {
101         return null;
102         /*not called */
103     }
104     
105     public Response<GreetMeResponse> greetMeAsync(String JavaDoc requestType) {
106         return null;
107         /*not called */
108     }
109     
110     public Future JavaDoc<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
111         return null;
112         /*not called */
113     }
114     
115     public Response<SayHiResponse> sayHiAsync() {
116         return null;
117         /*not called */
118     }
119     
120 }
121
Popular Tags