javax.jws.WebService.wsdlLocation()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(12.0k)|赞(0)|评价(0)|浏览(253)

本文整理了Java中javax.jws.WebService.wsdlLocation()方法的一些代码示例,展示了WebService.wsdlLocation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebService.wsdlLocation()方法的具体详情如下:
包路径:javax.jws.WebService
类名称:WebService
方法名:wsdlLocation

WebService.wsdlLocation介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

  1. String wsdl = ann.wsdlLocation();
  2. if (StringUtils.hasText(wsdl)) {
  3. try {

代码示例来源:origin: org.springframework/spring-web

  1. String wsdl = ann.wsdlLocation();
  2. if (StringUtils.hasText(wsdl)) {
  3. try {

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

  1. public String getWsdlLocation() {
  2. for (WebService service : wsAnnotations) {
  3. if (!StringUtils.isEmpty(service.wsdlLocation())) {
  4. return service.wsdlLocation();
  5. }
  6. }
  7. if (null != wsProviderAnnotation
  8. && !StringUtils.isEmpty(wsProviderAnnotation.wsdlLocation())) {
  9. return wsProviderAnnotation.wsdlLocation();
  10. }
  11. return null;
  12. }

代码示例来源:origin: kumuluz/kumuluzee

  1. public String wsdlLocation() {
  2. if (ws == null) {
  3. return null;
  4. }
  5. return ws.wsdlLocation() != null && ws.wsdlLocation().isEmpty() ? null : ws.wsdlLocation();
  6. }

代码示例来源:origin: org.objectweb.celtix/celtix-rt

  1. private URL getWsdlLocation(WebService wsAnnotation) {
  2. URL url = null;
  3. if (wsAnnotation != null) {
  4. try {
  5. url = new URL(wsAnnotation.wsdlLocation());
  6. } catch (java.net.MalformedURLException mue) {
  7. mue.printStackTrace();
  8. }
  9. }
  10. return url;
  11. }

代码示例来源:origin: apache/cxf

  1. public String getWsdlLocation() {
  2. for (WebService service : wsAnnotations) {
  3. if (!StringUtils.isEmpty(service.wsdlLocation())) {
  4. return service.wsdlLocation();
  5. }
  6. }
  7. if (null != wsProviderAnnotation
  8. && !StringUtils.isEmpty(wsProviderAnnotation.wsdlLocation())) {
  9. return wsProviderAnnotation.wsdlLocation();
  10. }
  11. return null;
  12. }

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core

  1. private static String getWsdlLocation(Class<?> clazz) {
  2. WebService webService = clazz.getAnnotation(WebService.class);
  3. if (webService != null) {
  4. String wsdlLocation = webService.wsdlLocation().trim();
  5. if (wsdlLocation.length() == 0) wsdlLocation = null;
  6. return wsdlLocation;
  7. }
  8. WebServiceClient webServiceClient = clazz.getAnnotation(WebServiceClient.class);
  9. if (webServiceClient != null) {
  10. String wsdlLocation = webServiceClient.wsdlLocation().trim();
  11. if (wsdlLocation.length() == 0) wsdlLocation = null;
  12. return wsdlLocation;
  13. }
  14. WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
  15. if (webServiceProvider != null) {
  16. String wsdlLocation = webServiceProvider.wsdlLocation().trim();
  17. if (wsdlLocation.length() == 0) wsdlLocation = null;
  18. return wsdlLocation;
  19. }
  20. return null;
  21. }

代码示例来源:origin: org.ow2.jonas/jonas-webservices-jaxws-core

  1. /**
  2. * @param klass class supporting annotations
  3. * @return the 'wsdlLocation' attribute's value (from @WebService or @WebServiceProvider)
  4. */
  5. public static String getWsdlLocation(Class<?> klass) {
  6. WebService ws = getWebService(klass);
  7. if (ws != null) {
  8. return ws.wsdlLocation();
  9. }
  10. WebServiceProvider wsp = getWebServiceProvider(klass);
  11. if (wsp != null) {
  12. return wsp.wsdlLocation();
  13. }
  14. throw new IllegalStateException("Class '" + klass + "' have neither @WebService nor @WebServiceProvider annotation");
  15. }

代码示例来源:origin: javaee/metro-jax-ws

  1. private WSDLService getWSDLModelfromSEI(final Class sei) {
  2. WebService ws = AccessController.doPrivileged(new PrivilegedAction<WebService>() {
  3. public WebService run() {
  4. return (WebService) sei.getAnnotation(WebService.class);
  5. }
  6. });
  7. if (ws == null || ws.wsdlLocation().equals(""))
  8. return null;
  9. String wsdlLocation = ws.wsdlLocation();
  10. wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation));
  11. Source wsdl = new StreamSource(wsdlLocation);
  12. WSDLService service = null;
  13. try {
  14. URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId());
  15. WSDLModel model = parseWSDL(url, wsdl, sei);
  16. service = model.getService(this.serviceName);
  17. if (service == null)
  18. throw new WebServiceException(
  19. ClientMessages.INVALID_SERVICE_NAME(this.serviceName,
  20. buildNameList(model.getServices().keySet())));
  21. } catch (MalformedURLException e) {
  22. throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId()));
  23. }
  24. return service;
  25. }

代码示例来源:origin: com.sun.xml.ws/rt

  1. private WSDLService getWSDLModelfromSEI(final Class sei) {
  2. WebService ws = AccessController.doPrivileged(new PrivilegedAction<WebService>() {
  3. public WebService run() {
  4. return (WebService) sei.getAnnotation(WebService.class);
  5. }
  6. });
  7. if (ws == null || ws.wsdlLocation().equals(""))
  8. return null;
  9. String wsdlLocation = ws.wsdlLocation();
  10. wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation));
  11. Source wsdl = new StreamSource(wsdlLocation);
  12. WSDLService service = null;
  13. try {
  14. URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId());
  15. WSDLModel model = parseWSDL(url, wsdl, sei);
  16. service = model.getService(this.serviceName);
  17. if (service == null)
  18. throw new WebServiceException(
  19. ClientMessages.INVALID_SERVICE_NAME(this.serviceName,
  20. buildNameList(model.getServices().keySet())));
  21. } catch (MalformedURLException e) {
  22. throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId()));
  23. }
  24. return service;
  25. }

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

  1. private WSDLService getWSDLModelfromSEI(final Class sei) {
  2. WebService ws = AccessController.doPrivileged(new PrivilegedAction<WebService>() {
  3. public WebService run() {
  4. return (WebService) sei.getAnnotation(WebService.class);
  5. }
  6. });
  7. if (ws == null || ws.wsdlLocation().equals(""))
  8. return null;
  9. String wsdlLocation = ws.wsdlLocation();
  10. wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation));
  11. Source wsdl = new StreamSource(wsdlLocation);
  12. WSDLService service = null;
  13. try {
  14. URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId());
  15. WSDLModel model = parseWSDL(url, wsdl, sei);
  16. service = model.getService(this.serviceName);
  17. if (service == null)
  18. throw new WebServiceException(
  19. ClientMessages.INVALID_SERVICE_NAME(this.serviceName,
  20. buildNameList(model.getServices().keySet())));
  21. } catch (MalformedURLException e) {
  22. throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId()));
  23. }
  24. return service;
  25. }

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

  1. /**
  2. * Returns the wsdl from @WebService, or @WebServiceProvider annotation using
  3. * wsdlLocation element.
  4. *
  5. * @param implType
  6. * endpoint implementation class
  7. * make sure that you called {@link #verifyImplementorClass} on it.
  8. * @return wsdl if there is wsdlLocation, else null
  9. */
  10. public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) {
  11. if (metadataReader == null) {
  12. metadataReader = new ReflectAnnotationReader();
  13. }
  14. WebService ws = metadataReader.getAnnotation(WebService.class, implType);
  15. if (ws != null) {
  16. return nullIfEmpty(ws.wsdlLocation());
  17. } else {
  18. WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
  19. assert wsProvider != null;
  20. return nullIfEmpty(wsProvider.wsdlLocation());
  21. }
  22. }

代码示例来源:origin: javaee/metro-jax-ws

  1. /**
  2. * Returns the wsdl from @WebService, or @WebServiceProvider annotation using
  3. * wsdlLocation element.
  4. *
  5. * @param implType
  6. * endpoint implementation class
  7. * make sure that you called {@link #verifyImplementorClass} on it.
  8. * @return wsdl if there is wsdlLocation, else null
  9. */
  10. public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) {
  11. if (metadataReader == null) {
  12. metadataReader = new ReflectAnnotationReader();
  13. }
  14. WebService ws = metadataReader.getAnnotation(WebService.class, implType);
  15. if (ws != null) {
  16. return nullIfEmpty(ws.wsdlLocation());
  17. } else {
  18. WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
  19. assert wsProvider != null;
  20. return nullIfEmpty(wsProvider.wsdlLocation());
  21. }
  22. }

代码示例来源:origin: com.sun.xml.ws/rt

  1. /**
  2. * Returns the wsdl from @WebService, or @WebServiceProvider annotation using
  3. * wsdlLocation element.
  4. *
  5. * @param implType
  6. * endpoint implementation class
  7. * make sure that you called {@link #verifyImplementorClass} on it.
  8. * @return wsdl if there is wsdlLocation, else null
  9. */
  10. public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) {
  11. if (metadataReader == null) {
  12. metadataReader = new ReflectAnnotationReader();
  13. }
  14. WebService ws = metadataReader.getAnnotation(WebService.class, implType);
  15. if (ws != null) {
  16. return nullIfEmpty(ws.wsdlLocation());
  17. } else {
  18. WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
  19. assert wsProvider != null;
  20. return nullIfEmpty(wsProvider.wsdlLocation());
  21. }
  22. }

代码示例来源:origin: org.apache.axis2/axis2-metadata

  1. public static WebServiceAnnot createFromAnnotation(Annotation annotation) {
  2. WebServiceAnnot returnAnnot = null;
  3. if (annotation != null && annotation instanceof javax.jws.WebService) {
  4. javax.jws.WebService ws = (javax.jws.WebService) annotation;
  5. return new WebServiceAnnot(ws.name(),
  6. ws.targetNamespace(),
  7. ws.serviceName(),
  8. ws.wsdlLocation(),
  9. ws.endpointInterface(),
  10. ws.portName());
  11. }
  12. return returnAnnot;
  13. }

代码示例来源:origin: apache/axis2-java

  1. public static WebServiceAnnot createFromAnnotation(Annotation annotation) {
  2. WebServiceAnnot returnAnnot = null;
  3. if (annotation != null && annotation instanceof javax.jws.WebService) {
  4. javax.jws.WebService ws = (javax.jws.WebService) annotation;
  5. return new WebServiceAnnot(ws.name(),
  6. ws.targetNamespace(),
  7. ws.serviceName(),
  8. ws.wsdlLocation(),
  9. ws.endpointInterface(),
  10. ws.portName());
  11. }
  12. return returnAnnot;
  13. }

代码示例来源:origin: org.codehaus.xfire/xfire-java5

  1. public WebServiceAnnotation getWebServiceAnnotation(Class clazz)
  2. {
  3. WebService webService = (WebService) clazz.getAnnotation(WebService.class);
  4. if (webService != null)
  5. {
  6. WebServiceAnnotation annotation = new WebServiceAnnotation();
  7. annotation.setEndpointInterface(webService.endpointInterface());
  8. annotation.setName(webService.name());
  9. annotation.setServiceName(webService.serviceName());
  10. annotation.setTargetNamespace(webService.targetNamespace());
  11. annotation.setPortName(webService.portName());
  12. annotation.setWsdlLocation(webService.wsdlLocation());
  13. return annotation;
  14. }
  15. else
  16. {
  17. return null;
  18. }
  19. }

代码示例来源:origin: org.apache.axis2/axis2-metadata

  1. public String getAnnoWebServiceWSDLLocation() {
  2. if (annotation_WsdlLocation == null) {
  3. if (getAnnoWebService() != null) {
  4. annotation_WsdlLocation = getAnnoWebService().wsdlLocation();
  5. //If this is not an implicit SEI, then make sure that its not on the SEI
  6. if (composite.isServiceProvider()) {
  7. if (!DescriptionUtils.isEmpty(getAnnoWebServiceEndpointInterface())) {
  8. DescriptionBuilderComposite seic =
  9. getServiceDescriptionImpl().getDBCMap()
  10. .get(composite.getWebServiceAnnot().endpointInterface());
  11. if (!DescriptionUtils.isEmpty(seic.getWebServiceAnnot().wsdlLocation())) {
  12. annotation_WsdlLocation = seic.getWebServiceAnnot().wsdlLocation();
  13. }
  14. }
  15. }
  16. } else if (getAnnoWebServiceProvider() != null
  17. && !DescriptionUtils.isEmpty(getAnnoWebServiceProvider().wsdlLocation())) {
  18. annotation_WsdlLocation = getAnnoWebServiceProvider().wsdlLocation();
  19. } else {
  20. // There is no default value per JSR-181 MR Sec 4.1 pg 16
  21. annotation_WsdlLocation = "";
  22. }
  23. }
  24. return annotation_WsdlLocation;
  25. }

代码示例来源:origin: org.apache.axis2/axis2-metadata

  1. /**
  2. * This method will be used to attach @WebService annotation data to the
  3. * <code>DescriptionBuildercomposite</code>
  4. *
  5. * @param composite - <code>DescriptionBuilderComposite</code>
  6. */
  7. private void attachWebServiceAnnotation(DescriptionBuilderComposite composite) {
  8. WebService webService = (WebService)ConverterUtils.getAnnotation(
  9. WebService.class, serviceClass);
  10. if (webService != null) {
  11. // Attach @WebService annotated data
  12. WebServiceAnnot wsAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
  13. wsAnnot.setEndpointInterface(webService.endpointInterface());
  14. // check for SEI and save name if necessary
  15. seiClassName = webService.endpointInterface();
  16. wsAnnot.setName(webService.name());
  17. wsAnnot.setPortName(webService.portName());
  18. wsAnnot.setServiceName(webService.serviceName());
  19. wsAnnot.setTargetNamespace(webService.targetNamespace());
  20. wsAnnot.setWsdlLocation(webService.wsdlLocation());
  21. composite.setWebServiceAnnot(wsAnnot);
  22. }
  23. }

代码示例来源:origin: apache/axis2-java

  1. /**
  2. * This method will be used to attach @WebService annotation data to the
  3. * <code>DescriptionBuildercomposite</code>
  4. *
  5. * @param composite - <code>DescriptionBuilderComposite</code>
  6. */
  7. private void attachWebServiceAnnotation(DescriptionBuilderComposite composite) {
  8. WebService webService = (WebService)ConverterUtils.getAnnotation(
  9. WebService.class, serviceClass);
  10. if (webService != null) {
  11. // Attach @WebService annotated data
  12. WebServiceAnnot wsAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
  13. wsAnnot.setEndpointInterface(webService.endpointInterface());
  14. // check for SEI and save name if necessary
  15. seiClassName = webService.endpointInterface();
  16. wsAnnot.setName(webService.name());
  17. wsAnnot.setPortName(webService.portName());
  18. wsAnnot.setServiceName(webService.serviceName());
  19. wsAnnot.setTargetNamespace(webService.targetNamespace());
  20. wsAnnot.setWsdlLocation(webService.wsdlLocation());
  21. composite.setWebServiceAnnot(wsAnnot);
  22. }
  23. }

相关文章