1 package org.objectweb.celtix.systest.dispatch; 2 3 import java.util.concurrent.Future ; 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 greetMe(String me) { 27 return "Hello " + me; 28 } 29 30 public String sayHi() { 31 return "Bonjour"; 32 } 33 34 public void testDocLitFault(String 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 requestType) { 49 System.out.println("********* greetMeOneWay: " + requestType); 50 assertTrue(requestType.equals("TestSOAPInputMessage1")); 51 } 52 53 public String greetMeSometime(String me) { 54 return "How are you " + me; 56 } 57 58 public BareDocumentResponse testDocLitBare(String in) { 59 BareDocumentResponse res = new BareDocumentResponse(); 60 res.setCompany("Celtix"); 61 res.setId(1); 62 return res; 63 } 64 65 public Future <?> greetMeSometimeAsync(String requestType, 66 AsyncHandler<GreetMeSometimeResponse> asyncHandler) { 67 System.err.println("In greetMeSometimeAsync 1"); 68 return null; 69 70 } 71 72 public Response<GreetMeSometimeResponse> greetMeSometimeAsync(String requestType) { 73 System.err.println("In greetMeSometimeAsync 2"); 74 return null; 75 76 } 77 78 public Response<TestDocLitFaultResponse> testDocLitFaultAsync(String faultType) { 79 System.err.println("In testDocLitFaultAsync 1"); 80 return null; 81 82 } 83 84 public Future <?> testDocLitFaultAsync(String faultType, AsyncHandler ah) { 85 System.err.println("In testDocLitFaultAsync 2"); 86 return null; 87 88 } 89 90 public Future <?> testDocLitBareAsync(String bare, AsyncHandler ah) { 91 return null; 92 93 } 94 95 public Response<BareDocumentResponse> testDocLitBareAsync(String bare) { 96 return null; 97 98 } 99 100 public Future <?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) { 101 return null; 102 103 } 104 105 public Response<GreetMeResponse> greetMeAsync(String requestType) { 106 return null; 107 108 } 109 110 public Future <?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) { 111 return null; 112 113 } 114 115 public Response<SayHiResponse> sayHiAsync() { 116 return null; 117 118 } 119 120 } 121 | Popular Tags |