KickJava   Java API By Example, From Geeks To Geeks.

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


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