private String findWsdlLocation(Class<? extends Service> serviceClass) { return serviceClass.getAnnotation(WebServiceClient.class).wsdlLocation(); } }
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; }
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(); }
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; }
private static String getWsdlLocation(final Class<?> clazz) { final WebService webService = clazz.getAnnotation(WebService.class); if (webService != null) { String wsdlLocation = webService.wsdlLocation().trim(); if (wsdlLocation.length() == 0) { wsdlLocation = null; } return wsdlLocation; } final WebServiceClient webServiceClient = clazz.getAnnotation(WebServiceClient.class); if (webServiceClient != null) { String wsdlLocation = webServiceClient.wsdlLocation().trim(); if (wsdlLocation.length() == 0) { wsdlLocation = null; } return wsdlLocation; } final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class); if (webServiceProvider != null) { String wsdlLocation = webServiceProvider.wsdlLocation().trim(); if (wsdlLocation.length() == 0) { wsdlLocation = null; } return wsdlLocation; } return null; }
private static String getWsdlLocation(final Class<?> clazz) { final WebService webService = clazz.getAnnotation(WebService.class); if (webService != null) { String wsdlLocation = webService.wsdlLocation().trim(); if (wsdlLocation.length() == 0) { wsdlLocation = null; } return wsdlLocation; } final WebServiceClient webServiceClient = clazz.getAnnotation(WebServiceClient.class); if (webServiceClient != null) { String wsdlLocation = webServiceClient.wsdlLocation().trim(); if (wsdlLocation.length() == 0) { wsdlLocation = null; } return wsdlLocation; } final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class); if (webServiceProvider != null) { String wsdlLocation = webServiceProvider.wsdlLocation().trim(); if (wsdlLocation.length() == 0) { wsdlLocation = null; } return wsdlLocation; } return null; }
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()) ); } }
URL getSparseCompositeWsdlURL(DescriptionBuilderComposite sparseComposite) { // Use the WSDL file if it is specified in the composite URL url = null; if (sparseComposite != null) { WebServiceClient wsc = (WebServiceClient) sparseComposite.getWebServiceClientAnnot(); if (wsc != null && wsc.wsdlLocation() != null) { String wsdlLocation = wsc.wsdlLocation(); URL wsdlUrl = getWSDLURL(wsdlLocation); if (wsdlUrl == null) { throw ExceptionFactory.makeWebServiceException(Messages.getMessage("serviceDescErr4", wsdlLocation)); } else { url = wsdlUrl; } } } return url; }
URL getSparseCompositeWsdlURL(DescriptionBuilderComposite sparseComposite) { // Use the WSDL file if it is specified in the composite URL url = null; if (sparseComposite != null) { WebServiceClient wsc = (WebServiceClient) sparseComposite.getWebServiceClientAnnot(); if (wsc != null && wsc.wsdlLocation() != null) { String wsdlLocation = wsc.wsdlLocation(); URL wsdlUrl = getWSDLURL(wsdlLocation); if (wsdlUrl == null) { throw ExceptionFactory.makeWebServiceException(Messages.getMessage("serviceDescErr4", wsdlLocation)); } else { url = wsdlUrl; } } } return url; }
@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; } });
@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; } });
@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; } });
/** * 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; }
/** * 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; }
protected void run() { String address0 = "http://localhost:" + PORT0 + "/SoapExtHeader/SampleService"; Object implementor1 = new SamplePortTypeImpl(); Endpoint.publish(address0, implementor1); String address1 = "http://localhost:" + PORT1 + "/SoapExtHeader/SampleService"; JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); sf.setServiceClass(SamplePortTypeImpl.class); WebServiceClient webService = SampleService.class.getAnnotation(WebServiceClient.class); sf.setServiceName(new QName(webService.targetNamespace(), webService.name())); sf.setWsdlLocation(webService.wsdlLocation()); sf.setAddress(address1); extserver = sf.create(); }
String wsdlLocation = wsClient.wsdlLocation(); wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)); wsdl = new StreamSource(wsdlLocation);
String wsdlLocation = wsClient.wsdlLocation(); wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)); wsdl = new StreamSource(wsdlLocation);
String wsdlLocation = wsClient.wsdlLocation(); wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)); wsdl = new StreamSource(wsdlLocation);
returnAnnot.setTargetNamespace(sparseWSCAnnotation.targetNamespace()); if (!DescriptionBuilderUtils.isEmpty(sparseWSCAnnotation.wsdlLocation())) { returnAnnot.setWsdlLocation(sparseWSCAnnotation.wsdlLocation());
returnAnnot.setTargetNamespace(sparseWSCAnnotation.targetNamespace()); if (!DescriptionBuilderUtils.isEmpty(sparseWSCAnnotation.wsdlLocation())) { returnAnnot.setWsdlLocation(sparseWSCAnnotation.wsdlLocation());