/* * */ package mycompany.cliente_wsdl_first; import java.net.MalformedURLException; import java.net.URL; import javax.xml.namespace.QName; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceFeature; import javax.xml.ws.Service; import mycompany.osgi_wsdl_first.Greeter; @WebServiceClient(name = "SOAPService", wsdlLocation = "http://localhost:8181/cxf/GreeterService?wsdl", targetNamespace = "mycompany.osgi_wsdl_first") public class SOAPService extends Service { public final static URL WSDL_LOCATION; public final static QName SERVICE = new QName("mycompany.osgi_wsdl_first", "SOAPService"); public final static QName SoapPort = new QName("mycompany.osgi_wsdl_first", "SoapPort"); static { URL url = null; try { //url = new URL("file:helloworld.wsdl"); url = new URL("http://localhost:8181/cxf/GreeterService?wsdl"); } catch (MalformedURLException e) { java.util.logging.Logger.getLogger(SOAPService.class.getName()) .log(java.util.logging.Level.INFO, "Can not initialize the default wsdl from {0}", "http://localhost:8181/cxf/GreeterService?wsdl"); } WSDL_LOCATION = url; } public SOAPService(URL wsdlLocation) { super(wsdlLocation, SERVICE); } public SOAPService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } public SOAPService() { super(WSDL_LOCATION, SERVICE); } //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2 //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1 //compliant code instead. public SOAPService(WebServiceFeature ... features) { super(WSDL_LOCATION, SERVICE, features); } //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2 //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1 //compliant code instead. public SOAPService(URL wsdlLocation, WebServiceFeature ... features) { super(wsdlLocation, SERVICE, features); } //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2 //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1 //compliant code instead. public SOAPService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) { super(wsdlLocation, serviceName, features); } /** * * @return * returns Greeter */ @WebEndpoint(name = "SoapPort") public Greeter getSoapPort() { return super.getPort(SoapPort, Greeter.class); } /** * * @param features * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. * @return * returns Greeter */ @WebEndpoint(name = "SoapPort") public Greeter getSoapPort(WebServiceFeature... features) { return super.getPort(SoapPort, Greeter.class, features); } }