String wsdl = ann.wsdlLocation(); if (StringUtils.hasText(wsdl)) { try {
String wsdl = ann.wsdlLocation(); if (StringUtils.hasText(wsdl)) { try {
public String getWsdlLocation() { for (WebService service : wsAnnotations) { if (!StringUtils.isEmpty(service.wsdlLocation())) { return service.wsdlLocation(); } } if (null != wsProviderAnnotation && !StringUtils.isEmpty(wsProviderAnnotation.wsdlLocation())) { return wsProviderAnnotation.wsdlLocation(); } return null; }
public String wsdlLocation() { if (ws == null) { return null; } return ws.wsdlLocation() != null && ws.wsdlLocation().isEmpty() ? null : ws.wsdlLocation(); }
private URL getWsdlLocation(WebService wsAnnotation) { URL url = null; if (wsAnnotation != null) { try { url = new URL(wsAnnotation.wsdlLocation()); } catch (java.net.MalformedURLException mue) { mue.printStackTrace(); } } return url; }
public String getWsdlLocation() { for (WebService service : wsAnnotations) { if (!StringUtils.isEmpty(service.wsdlLocation())) { return service.wsdlLocation(); } } if (null != wsProviderAnnotation && !StringUtils.isEmpty(wsProviderAnnotation.wsdlLocation())) { return wsProviderAnnotation.wsdlLocation(); } 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; }
/** * @param klass class supporting annotations * @return the 'wsdlLocation' attribute's value (from @WebService or @WebServiceProvider) */ public static String getWsdlLocation(Class<?> klass) { WebService ws = getWebService(klass); if (ws != null) { return ws.wsdlLocation(); } WebServiceProvider wsp = getWebServiceProvider(klass); if (wsp != null) { return wsp.wsdlLocation(); } throw new IllegalStateException("Class '" + klass + "' have neither @WebService nor @WebServiceProvider annotation"); }
private WSDLService getWSDLModelfromSEI(final Class sei) { WebService ws = AccessController.doPrivileged(new PrivilegedAction<WebService>() { public WebService run() { return (WebService) sei.getAnnotation(WebService.class); } }); if (ws == null || ws.wsdlLocation().equals("")) return null; String wsdlLocation = ws.wsdlLocation(); wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)); Source wsdl = new StreamSource(wsdlLocation); WSDLService service = null; try { URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId()); WSDLModel model = parseWSDL(url, wsdl, sei); service = model.getService(this.serviceName); if (service == null) throw new WebServiceException( ClientMessages.INVALID_SERVICE_NAME(this.serviceName, buildNameList(model.getServices().keySet()))); } catch (MalformedURLException e) { throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId())); } return service; }
private WSDLService getWSDLModelfromSEI(final Class sei) { WebService ws = AccessController.doPrivileged(new PrivilegedAction<WebService>() { public WebService run() { return (WebService) sei.getAnnotation(WebService.class); } }); if (ws == null || ws.wsdlLocation().equals("")) return null; String wsdlLocation = ws.wsdlLocation(); wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)); Source wsdl = new StreamSource(wsdlLocation); WSDLService service = null; try { URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId()); WSDLModel model = parseWSDL(url, wsdl, sei); service = model.getService(this.serviceName); if (service == null) throw new WebServiceException( ClientMessages.INVALID_SERVICE_NAME(this.serviceName, buildNameList(model.getServices().keySet()))); } catch (MalformedURLException e) { throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId())); } return service; }
private WSDLService getWSDLModelfromSEI(final Class sei) { WebService ws = AccessController.doPrivileged(new PrivilegedAction<WebService>() { public WebService run() { return (WebService) sei.getAnnotation(WebService.class); } }); if (ws == null || ws.wsdlLocation().equals("")) return null; String wsdlLocation = ws.wsdlLocation(); wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)); Source wsdl = new StreamSource(wsdlLocation); WSDLService service = null; try { URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId()); WSDLModel model = parseWSDL(url, wsdl, sei); service = model.getService(this.serviceName); if (service == null) throw new WebServiceException( ClientMessages.INVALID_SERVICE_NAME(this.serviceName, buildNameList(model.getServices().keySet()))); } catch (MalformedURLException e) { throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId())); } return service; }
/** * Returns the wsdl from @WebService, or @WebServiceProvider annotation using * wsdlLocation element. * * @param implType * endpoint implementation class * make sure that you called {@link #verifyImplementorClass} on it. * @return wsdl if there is wsdlLocation, else null */ public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) { if (metadataReader == null) { metadataReader = new ReflectAnnotationReader(); } WebService ws = metadataReader.getAnnotation(WebService.class, implType); if (ws != null) { return nullIfEmpty(ws.wsdlLocation()); } else { WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class); assert wsProvider != null; return nullIfEmpty(wsProvider.wsdlLocation()); } }
/** * Returns the wsdl from @WebService, or @WebServiceProvider annotation using * wsdlLocation element. * * @param implType * endpoint implementation class * make sure that you called {@link #verifyImplementorClass} on it. * @return wsdl if there is wsdlLocation, else null */ public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) { if (metadataReader == null) { metadataReader = new ReflectAnnotationReader(); } WebService ws = metadataReader.getAnnotation(WebService.class, implType); if (ws != null) { return nullIfEmpty(ws.wsdlLocation()); } else { WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class); assert wsProvider != null; return nullIfEmpty(wsProvider.wsdlLocation()); } }
/** * Returns the wsdl from @WebService, or @WebServiceProvider annotation using * wsdlLocation element. * * @param implType * endpoint implementation class * make sure that you called {@link #verifyImplementorClass} on it. * @return wsdl if there is wsdlLocation, else null */ public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) { if (metadataReader == null) { metadataReader = new ReflectAnnotationReader(); } WebService ws = metadataReader.getAnnotation(WebService.class, implType); if (ws != null) { return nullIfEmpty(ws.wsdlLocation()); } else { WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class); assert wsProvider != null; return nullIfEmpty(wsProvider.wsdlLocation()); } }
public static WebServiceAnnot createFromAnnotation(Annotation annotation) { WebServiceAnnot returnAnnot = null; if (annotation != null && annotation instanceof javax.jws.WebService) { javax.jws.WebService ws = (javax.jws.WebService) annotation; return new WebServiceAnnot(ws.name(), ws.targetNamespace(), ws.serviceName(), ws.wsdlLocation(), ws.endpointInterface(), ws.portName()); } return returnAnnot; }
public static WebServiceAnnot createFromAnnotation(Annotation annotation) { WebServiceAnnot returnAnnot = null; if (annotation != null && annotation instanceof javax.jws.WebService) { javax.jws.WebService ws = (javax.jws.WebService) annotation; return new WebServiceAnnot(ws.name(), ws.targetNamespace(), ws.serviceName(), ws.wsdlLocation(), ws.endpointInterface(), ws.portName()); } return returnAnnot; }
public WebServiceAnnotation getWebServiceAnnotation(Class clazz) { WebService webService = (WebService) clazz.getAnnotation(WebService.class); if (webService != null) { WebServiceAnnotation annotation = new WebServiceAnnotation(); annotation.setEndpointInterface(webService.endpointInterface()); annotation.setName(webService.name()); annotation.setServiceName(webService.serviceName()); annotation.setTargetNamespace(webService.targetNamespace()); annotation.setPortName(webService.portName()); annotation.setWsdlLocation(webService.wsdlLocation()); return annotation; } else { return null; } }
public String getAnnoWebServiceWSDLLocation() { if (annotation_WsdlLocation == null) { if (getAnnoWebService() != null) { annotation_WsdlLocation = getAnnoWebService().wsdlLocation(); //If this is not an implicit SEI, then make sure that its not on the SEI if (composite.isServiceProvider()) { if (!DescriptionUtils.isEmpty(getAnnoWebServiceEndpointInterface())) { DescriptionBuilderComposite seic = getServiceDescriptionImpl().getDBCMap() .get(composite.getWebServiceAnnot().endpointInterface()); if (!DescriptionUtils.isEmpty(seic.getWebServiceAnnot().wsdlLocation())) { annotation_WsdlLocation = seic.getWebServiceAnnot().wsdlLocation(); } } } } else if (getAnnoWebServiceProvider() != null && !DescriptionUtils.isEmpty(getAnnoWebServiceProvider().wsdlLocation())) { annotation_WsdlLocation = getAnnoWebServiceProvider().wsdlLocation(); } else { // There is no default value per JSR-181 MR Sec 4.1 pg 16 annotation_WsdlLocation = ""; } } return annotation_WsdlLocation; }
/** * This method will be used to attach @WebService annotation data to the * <code>DescriptionBuildercomposite</code> * * @param composite - <code>DescriptionBuilderComposite</code> */ private void attachWebServiceAnnotation(DescriptionBuilderComposite composite) { WebService webService = (WebService)ConverterUtils.getAnnotation( WebService.class, serviceClass); if (webService != null) { // Attach @WebService annotated data WebServiceAnnot wsAnnot = WebServiceAnnot.createWebServiceAnnotImpl(); wsAnnot.setEndpointInterface(webService.endpointInterface()); // check for SEI and save name if necessary seiClassName = webService.endpointInterface(); wsAnnot.setName(webService.name()); wsAnnot.setPortName(webService.portName()); wsAnnot.setServiceName(webService.serviceName()); wsAnnot.setTargetNamespace(webService.targetNamespace()); wsAnnot.setWsdlLocation(webService.wsdlLocation()); composite.setWebServiceAnnot(wsAnnot); } }
/** * This method will be used to attach @WebService annotation data to the * <code>DescriptionBuildercomposite</code> * * @param composite - <code>DescriptionBuilderComposite</code> */ private void attachWebServiceAnnotation(DescriptionBuilderComposite composite) { WebService webService = (WebService)ConverterUtils.getAnnotation( WebService.class, serviceClass); if (webService != null) { // Attach @WebService annotated data WebServiceAnnot wsAnnot = WebServiceAnnot.createWebServiceAnnotImpl(); wsAnnot.setEndpointInterface(webService.endpointInterface()); // check for SEI and save name if necessary seiClassName = webService.endpointInterface(); wsAnnot.setName(webService.name()); wsAnnot.setPortName(webService.portName()); wsAnnot.setServiceName(webService.serviceName()); wsAnnot.setTargetNamespace(webService.targetNamespace()); wsAnnot.setWsdlLocation(webService.wsdlLocation()); composite.setWebServiceAnnot(wsAnnot); } }