@WebServiceClient(targetNamespace = "http://jaxws.remoting.springframework.org/", name="OrderService") public static class OrderServiceService extends Service { public OrderServiceService() throws MalformedURLException { super(new URL("http://localhost:9999/OrderService?wsdl"), new QName("http://jaxws.remoting.springframework.org/", "OrderService")); } public OrderServiceService(URL wsdlDocumentLocation, QName serviceName) { super(wsdlDocumentLocation, serviceName); } }
new URL(this.wsdlLocation), new QName(clientAnn.targetNamespace(), clientAnn.name()));
/** * Create an instance of this annotation using the values from the annotation instance * passed in. * * @param annotation Use the values to create a new instance of annotation. Note this could * be an instance of the java annotation superclass as well. * @return a new instance of this annotation or null if one could not be created with the * annotation passed in. */ public static WebServiceClientAnnot createFromAnnotation(Annotation annotation) { WebServiceClientAnnot returnAnnot = null; if (annotation != null && annotation instanceof javax.xml.ws.WebServiceClient) { javax.xml.ws.WebServiceClient wsc = (javax.xml.ws.WebServiceClient) annotation; returnAnnot = new WebServiceClientAnnot(wsc.name(), wsc.targetNamespace(), wsc.wsdlLocation()); } return returnAnnot; }
@Override public Void run() { WebServiceClient wsc =sc.getAnnotation(WebServiceClient.class); if(wsc==null) { throw new WebServiceException("Service Interface Annotations required, exiting..."); } String tns = wsc.targetNamespace(); try { JAXWSUtils.getFileOrURL(wsc.wsdlLocation()); } catch (IOException e) { // TODO: report a reasonable error message throw new WebServiceException(e); } for (Method method : sc.getDeclaredMethods()) { WebEndpoint webEndpoint = method.getAnnotation(WebEndpoint.class); if (webEndpoint != null) { String endpointName = webEndpoint.name(); QName portQName = new QName(tns, endpointName); portQNames.add(portQName); } Class<?> seiClazz = method.getReturnType(); if (seiClazz!=void.class) { classes.add(seiClazz); } } return null; } });
private String findWsdlLocation(Class<? extends Service> serviceClass) { return serviceClass.getAnnotation(WebServiceClient.class).wsdlLocation(); } }
new URL(this.wsdlLocation), new QName(clientAnn.targetNamespace(), clientAnn.name()));
/** * Create an instance of this annotation using the values from the annotation instance * passed in. * * @param annotation Use the values to create a new instance of annotation. Note this could * be an instance of the java annotation superclass as well. * @return a new instance of this annotation or null if one could not be created with the * annotation passed in. */ public static WebServiceClientAnnot createFromAnnotation(Annotation annotation) { WebServiceClientAnnot returnAnnot = null; if (annotation != null && annotation instanceof javax.xml.ws.WebServiceClient) { javax.xml.ws.WebServiceClient wsc = (javax.xml.ws.WebServiceClient) annotation; returnAnnot = new WebServiceClientAnnot(wsc.name(), wsc.targetNamespace(), wsc.wsdlLocation()); } return returnAnnot; }
@Override public Void run() { WebServiceClient wsc =sc.getAnnotation(WebServiceClient.class); if(wsc==null) { throw new WebServiceException("Service Interface Annotations required, exiting..."); } String tns = wsc.targetNamespace(); try { JAXWSUtils.getFileOrURL(wsc.wsdlLocation()); } catch (IOException e) { // TODO: report a reasonable error message throw new WebServiceException(e); } for (Method method : sc.getDeclaredMethods()) { WebEndpoint webEndpoint = method.getAnnotation(WebEndpoint.class); if (webEndpoint != null) { String endpointName = webEndpoint.name(); QName portQName = new QName(tns, endpointName); portQNames.add(portQName); } Class<?> seiClazz = method.getReturnType(); if (seiClazz!=void.class) { classes.add(seiClazz); } } return null; } });
private URI getWSDLLocation(WebServiceClient webServiceClient) throws DeploymentException { String wsdlLocation = webServiceClient.wsdlLocation(); if (wsdlLocation != null && wsdlLocation.trim().length() > 0) { try { return new URI(wsdlLocation.trim()); } catch (URISyntaxException e) { throw new DeploymentException( "Invalid wsdl location in annotation: " + wsdlLocation, e); } } return null; }
@WebServiceClient(name = "HandlingReportServiceService", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", wsdlLocation = "file:///Users/peter/src/dddsample/src/main/resources/HandlingReportService.wsdl") public class HandlingReportServiceService extends Service
public void setServiceRef(Class annotatedClass, ServiceReferenceDescriptor ref) { WebServiceClient wsc = (WebServiceClient)annotatedClass.getAnnotation(javax.xml.ws.WebServiceClient.class); if (wsc != null) { ref.setWsdlFileUri(wsc.wsdlLocation()); //we set the service QName too from the @WebServiceClient annotation ref.setServiceName(new QName(wsc.targetNamespace(),wsc.name()) ); } }
new URL(this.wsdlLocation), new QName(clientAnn.targetNamespace(), clientAnn.name()));
@Override public Void run() { WebServiceClient wsc =sc.getAnnotation(WebServiceClient.class); if(wsc==null) { throw new WebServiceException("Service Interface Annotations required, exiting..."); } String tns = wsc.targetNamespace(); try { JAXWSUtils.getFileOrURL(wsc.wsdlLocation()); } catch (IOException e) { // TODO: report a reasonable error message throw new WebServiceException(e); } for (Method method : sc.getDeclaredMethods()) { WebEndpoint webEndpoint = method.getAnnotation(WebEndpoint.class); if (webEndpoint != null) { String endpointName = webEndpoint.name(); QName portQName = new QName(tns, endpointName); portQNames.add(portQName); } Class<?> seiClazz = method.getReturnType(); if (seiClazz!=void.class) { classes.add(seiClazz); } } return null; } });
private URL getWsdlURL(final UnifiedServiceRefMetaData serviceRefMD, final Class<?> serviceClass) { if (serviceRefMD.getWsdlLocation() == null) { final WebServiceClient webServiceClientAnnotation = serviceClass.getAnnotation(WebServiceClient.class); if (webServiceClientAnnotation != null) { // use the @WebServiceClien(wsdlLocation=...) if the service ref wsdl location returned at this time would be null if (webServiceClientAnnotation.wsdlLocation().length() > 0) { return serviceRefMD.getWsdlLocation(webServiceClientAnnotation.wsdlLocation()); } } } return serviceRefMD.getWsdlLocation(); }
@WebServiceClient(name = "Sonos", wsdlLocation = "file:/usr/src/mvn_workdir/airsonic-sonos-api/src/main/resources/sonos-1.1.wsdl", targetNamespace = "http://www.sonos.com/Services/1.1")
if (!DescriptionBuilderUtils.isEmpty(sparseWSCAnnotation.name())) { returnAnnot.setName(sparseWSCAnnotation.name()); if (!DescriptionBuilderUtils.isEmpty(sparseWSCAnnotation.targetNamespace())) { returnAnnot.setTargetNamespace(sparseWSCAnnotation.targetNamespace()); if (!DescriptionBuilderUtils.isEmpty(sparseWSCAnnotation.wsdlLocation())) { returnAnnot.setWsdlLocation(sparseWSCAnnotation.wsdlLocation());
private QName getServiceQName(WebServiceClient webServiceClient) { if (webServiceClient.targetNamespace() != null && webServiceClient.name() != null) { return new QName(webServiceClient.targetNamespace(), webServiceClient.name()); } else { return null; } }
private static String getWsdlLocation(Class<?> clazz) { WebService webService = clazz.getAnnotation(WebService.class); if (webService != null) { String wsdlLocation = webService.wsdlLocation().trim(); if (wsdlLocation.length() == 0) wsdlLocation = null; return wsdlLocation; } WebServiceClient webServiceClient = clazz.getAnnotation(WebServiceClient.class); if (webServiceClient != null) { String wsdlLocation = webServiceClient.wsdlLocation().trim(); if (wsdlLocation.length() == 0) wsdlLocation = null; return wsdlLocation; } WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class); if (webServiceProvider != null) { String wsdlLocation = webServiceProvider.wsdlLocation().trim(); if (wsdlLocation.length() == 0) wsdlLocation = null; return wsdlLocation; } return null; }
@WebServiceClient(name = "Sonos", wsdlLocation = "file:/usr/src/mvn_workdir/libresonic-sonos-api/src/main/resources/sonos-1.1.wsdl", targetNamespace = "http://www.sonos.com/Services/1.1")
if (!DescriptionBuilderUtils.isEmpty(sparseWSCAnnotation.name())) { returnAnnot.setName(sparseWSCAnnotation.name()); if (!DescriptionBuilderUtils.isEmpty(sparseWSCAnnotation.targetNamespace())) { returnAnnot.setTargetNamespace(sparseWSCAnnotation.targetNamespace()); if (!DescriptionBuilderUtils.isEmpty(sparseWSCAnnotation.wsdlLocation())) { returnAnnot.setWsdlLocation(sparseWSCAnnotation.wsdlLocation());