001: package org.objectweb.celtix.systest.dispatch;
002:
003: import java.util.concurrent.Future;
004:
005: import javax.jws.WebService;
006: import javax.xml.ws.AsyncHandler;
007: import javax.xml.ws.Response;
008:
009: import org.objectweb.hello_world_soap_http.BadRecordLitFault;
010: import org.objectweb.hello_world_soap_http.Greeter;
011: import org.objectweb.hello_world_soap_http.NoSuchCodeLitFault;
012: import org.objectweb.hello_world_soap_http.types.BareDocumentResponse;
013: import org.objectweb.hello_world_soap_http.types.ErrorCode;
014: import org.objectweb.hello_world_soap_http.types.GreetMeResponse;
015: import org.objectweb.hello_world_soap_http.types.GreetMeSometimeResponse;
016: import org.objectweb.hello_world_soap_http.types.NoSuchCodeLit;
017: import org.objectweb.hello_world_soap_http.types.SayHiResponse;
018: import org.objectweb.hello_world_soap_http.types.TestDocLitFaultResponse;
019:
020: import static junit.framework.Assert.assertTrue;
021:
022: @WebService(serviceName="SOAPService",portName="SoapPort",endpointInterface="org.objectweb.hello_world_soap_http.Greeter")
023: public class GreeterImpl implements Greeter {
024:
025: public String greetMe(String me) {
026: return "Hello " + me;
027: }
028:
029: public String sayHi() {
030: return "Bonjour";
031: }
032:
033: public void testDocLitFault(String faultType)
034: throws BadRecordLitFault, NoSuchCodeLitFault {
035: if (faultType.equals(BadRecordLitFault.class.getSimpleName())) {
036: throw new BadRecordLitFault("TestBadRecordLit",
037: "BadRecordLitFault");
038: }
039: if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) {
040: ErrorCode ec = new ErrorCode();
041: ec.setMajor((short) 1);
042: ec.setMinor((short) 1);
043: NoSuchCodeLit nscl = new NoSuchCodeLit();
044: nscl.setCode(ec);
045: throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl);
046: }
047: }
048:
049: public void greetMeOneWay(String requestType) {
050: System.out.println("********* greetMeOneWay: " + requestType);
051: assertTrue(requestType.equals("TestSOAPInputMessage1"));
052: }
053:
054: public String greetMeSometime(String me) {
055: //System.err.println("In greetMeSometime: " + me);
056: return "How are you " + me;
057: }
058:
059: public BareDocumentResponse testDocLitBare(String in) {
060: BareDocumentResponse res = new BareDocumentResponse();
061: res.setCompany("Celtix");
062: res.setId(1);
063: return res;
064: }
065:
066: public Future<?> greetMeSometimeAsync(String requestType,
067: AsyncHandler<GreetMeSometimeResponse> asyncHandler) {
068: System.err.println("In greetMeSometimeAsync 1");
069: return null;
070: /*not called */
071: }
072:
073: public Response<GreetMeSometimeResponse> greetMeSometimeAsync(
074: String requestType) {
075: System.err.println("In greetMeSometimeAsync 2");
076: return null;
077: /*not called */
078: }
079:
080: public Response<TestDocLitFaultResponse> testDocLitFaultAsync(
081: String faultType) {
082: System.err.println("In testDocLitFaultAsync 1");
083: return null;
084: /*not called */
085: }
086:
087: public Future<?> testDocLitFaultAsync(String faultType,
088: AsyncHandler ah) {
089: System.err.println("In testDocLitFaultAsync 2");
090: return null;
091: /*not called */
092: }
093:
094: public Future<?> testDocLitBareAsync(String bare, AsyncHandler ah) {
095: return null;
096: /* not called */
097: }
098:
099: public Response<BareDocumentResponse> testDocLitBareAsync(
100: String bare) {
101: return null;
102: /* not called */
103: }
104:
105: public Future<?> greetMeAsync(String requestType,
106: AsyncHandler<GreetMeResponse> asyncHandler) {
107: return null;
108: /*not called */
109: }
110:
111: public Response<GreetMeResponse> greetMeAsync(String requestType) {
112: return null;
113: /*not called */
114: }
115:
116: public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
117: return null;
118: /*not called */
119: }
120:
121: public Response<SayHiResponse> sayHiAsync() {
122: return null;
123: /*not called */
124: }
125:
126: }
|