1 22 package org.jboss.test.ws.jaxws.webserviceref; 23 24 import java.util.ArrayList ; 25 26 import javax.naming.InitialContext ; 27 import javax.xml.ws.WebServiceException; 28 import javax.xml.ws.WebServiceRef; 29 import javax.xml.ws.WebServiceRefs; 30 31 import org.jboss.logging.Logger; 32 33 @WebServiceRef(name = "service1", value = TestEndpointService.class, wsdlLocation = "META-INF/wsdl/TestEndpoint.wsdl") 35 36 @WebServiceRefs( { 38 @WebServiceRef(name = "service2", value = TestEndpointService.class), 39 @WebServiceRef(name = "port1", value = TestEndpointService.class, type = TestEndpoint.class) }) 40 public class ApplicationClient 41 { 42 private static Logger log = Logger.getLogger(ApplicationClient.class); 44 45 @WebServiceRef(name = "TestEndpointService3") 47 public static TestEndpointService service3; 48 49 @WebServiceRef 51 public static TestEndpointService service4; 52 53 @WebServiceRef(name = "TestEndpointService5") 55 public static void setServiceSetter5(TestEndpointService service) 56 { 57 ApplicationClient.service5 = service; 58 } 59 private static TestEndpointService service5; 60 61 @WebServiceRef 63 public static void setServiceSetter6(TestEndpointService service) 64 { 65 ApplicationClient.service6 = service; 66 } 67 private static TestEndpointService service6; 68 69 @WebServiceRef(name = "Port2", value = TestEndpointService.class) 71 public static TestEndpoint port2; 72 73 @WebServiceRef(value = TestEndpointService.class) 75 public static TestEndpoint port3; 76 77 public static InitialContext iniCtx; 78 public static String retStr; 79 80 public static void main(String [] args) 81 { 82 String inStr = args[0]; 83 log.info("echo: " + inStr); 84 85 ArrayList <TestEndpoint> ports = new ArrayList <TestEndpoint>(); 86 try 87 { 88 System.out.println("FIXME: EJBTHREE-760"); 89 ports.add((TestEndpoint)service3.getPort(TestEndpoint.class)); 92 ports.add((TestEndpoint)service4.getPort(TestEndpoint.class)); 94 ports.add((TestEndpoint)service5.getPort(TestEndpoint.class)); 96 ports.add((TestEndpoint)service6.getPort(TestEndpoint.class)); 98 ports.add(port2); 101 ports.add(port3); 103 } 105 catch (Exception ex) 106 { 107 log.error("Cannot add port", ex); 108 throw new WebServiceException(ex); 109 } 110 111 for (TestEndpoint port : ports) 112 { 113 String outStr = port.echo(inStr); 114 if (inStr.equals(outStr) == false) 115 throw new WebServiceException("Invalid echo return: " + inStr); 116 } 117 118 retStr = inStr; 119 } 120 121 } 122 | Popular Tags |