1 package org.objectweb.celtix.systest.ws.addressing; 2 3 import java.util.concurrent.Future ; 4 5 import javax.annotation.Resource; 6 import javax.jws.WebService; 7 import javax.xml.ws.AsyncHandler; 8 import javax.xml.ws.Response; 9 import javax.xml.ws.WebServiceContext; 10 11 import org.objectweb.celtix.ws.addressing.AddressingProperties; 12 import org.objectweb.hello_world_soap_http.BadRecordLitFault; 13 import org.objectweb.hello_world_soap_http.Greeter; 14 import org.objectweb.hello_world_soap_http.NoSuchCodeLitFault; 15 import org.objectweb.hello_world_soap_http.types.BareDocumentResponse; 16 import org.objectweb.hello_world_soap_http.types.ErrorCode; 18 import org.objectweb.hello_world_soap_http.types.GreetMeResponse; 19 import org.objectweb.hello_world_soap_http.types.GreetMeSometimeResponse; 20 import org.objectweb.hello_world_soap_http.types.NoSuchCodeLit; 21 import org.objectweb.hello_world_soap_http.types.SayHiResponse; 23 import org.objectweb.hello_world_soap_http.types.TestDocLitFaultResponse; 24 25 import static org.objectweb.celtix.ws.addressing.JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND; 26 27 28 @WebService(serviceName = "SOAPServiceAddressing", 29 portName = "SoapPort", 30 endpointInterface = "org.objectweb.hello_world_soap_http.Greeter", 31 targetNamespace = "http://objectweb.org/hello_world_soap_http") 32 public class GreeterImpl implements Greeter { 33 VerificationCache verificationCache; 34 35 38 @Resource 39 private WebServiceContext context; 40 41 42 public String greetMe(String me) { 43 verifyMAPs(); 44 return "Hello " + me; 45 } 46 47 public void greetMeOneWay(String requestType) { 48 verifyMAPs(); 49 } 50 51 public String sayHi() { 52 verifyMAPs(); 53 return "Bonjour"; 54 } 55 56 public void testDocLitFault(String faultType) throws BadRecordLitFault, NoSuchCodeLitFault { 57 verifyMAPs(); 58 if (faultType.equals(BadRecordLitFault.class.getSimpleName())) { 59 throw new BadRecordLitFault("TestBadRecordLit", "BadRecordLitFault"); 60 } 61 if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) { 62 ErrorCode ec = new ErrorCode(); 63 ec.setMajor((short)1); 64 ec.setMinor((short)1); 65 NoSuchCodeLit nscl = new NoSuchCodeLit(); 66 nscl.setCode(ec); 67 throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl); 68 } 69 } 70 71 public BareDocumentResponse testDocLitBare(String in) { 72 BareDocumentResponse res = new BareDocumentResponse(); 73 res.setCompany("Celtix"); 74 res.setId(1); 75 return res; 76 } 77 78 private void verifyMAPs() { 79 String property = SERVER_ADDRESSING_PROPERTIES_INBOUND; 80 AddressingProperties maps = (AddressingProperties) 81 context.getMessageContext().get(property); 82 verificationCache.put(MAPTest.verifyMAPs(maps, this)); 83 } 84 85 public String greetMeSometime(String me) { 86 return "How are you " + me; 87 } 88 89 public Future <?> greetMeSometimeAsync(String requestType, 90 AsyncHandler<GreetMeSometimeResponse> asyncHandler) { 91 return null; 92 93 } 94 95 public Response<GreetMeSometimeResponse> greetMeSometimeAsync(String requestType) { 96 return null; 97 98 } 99 100 public Response<TestDocLitFaultResponse> testDocLitFaultAsync(String faultType) { 101 return null; 102 103 } 104 105 public Future <?> testDocLitFaultAsync(String faultType, AsyncHandler ah) { 106 return null; 107 108 } 109 110 public Future <?> testDocLitBareAsync(String bare, AsyncHandler ah) { 111 return null; 112 113 } 114 115 public Response<BareDocumentResponse> testDocLitBareAsync(String bare) { 116 return null; 117 118 } 119 120 public Future <?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) { 121 return null; 122 123 } 124 125 public Response<GreetMeResponse> greetMeAsync(String requestType) { 126 return null; 127 128 } 129 130 public Future <?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) { 131 return null; 132 133 } 134 135 public Response<SayHiResponse> sayHiAsync() { 136 return null; 137 138 } 139 140 } 141 | Popular Tags |