private static WinRm doCreateServiceWithReflectivelySetDelegate() { WinRmService service = doCreateService_1_CreateMinimalServiceInstance(); try { Field delegateField = javax.xml.ws.Service.class.getDeclaredField("delegate"); //ALLOW CXF SPECIFIC SERVICE DELEGATE ONLY! delegateField.setAccessible(true); ServiceDelegate previousDelegate = (ServiceDelegate) delegateField.get(service); if (!previousDelegate.getClass().getName().contains("cxf")) { ServiceDelegate serviceDelegate = ((Provider) Class.forName("org.apache.cxf.jaxws.spi.ProviderImpl").newInstance()) .createServiceDelegate(WinRmService.WSDL_LOCATION, WinRmService.SERVICE, service.getClass()); delegateField.set(service, serviceDelegate); } } catch (Exception e) { throw new RuntimeException("Error reflectively setting CXF WS service delegate", e); } return doCreateService_2_GetClient(service); }
@SuppressWarnings("rawtypes") @Override public ServiceDelegate createServiceDelegate(URL url, QName qname, Class cls) { final String busStrategy = ClientBusSelector.getInstance().selectStrategy(); ClassLoader origClassLoader = getContextClassLoader(); boolean restoreTCCL = false; Bus orig = null; try { restoreTCCL = checkAndFixContextClassLoader(origClassLoader); orig = BusFactory.getThreadDefaultBus(false); Bus bus = getOrCreateBus(busStrategy, origClassLoader); ServiceDelegate serviceDelegate = new JBossWSServiceImpl(bus, url, qname, cls); setDisableCacheSchema(bus); return serviceDelegate; } finally { restoreThreadDefaultBus(busStrategy, orig); if (restoreTCCL) setContextClassLoader(origClassLoader); } }
public ServiceDelegate createServiceDelegate( URL wsdlDocumentLocation, QName serviceName, Class serviceClass, WebServiceFeature ... features) { for (WebServiceFeature feature : features) { if (!(feature instanceof ServiceSharedFeatureMarker)) throw new WebServiceException("Doesn't support any Service specific features"); } return new WSServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass, features); }
@SuppressWarnings("rawtypes") @Override public ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass, WebServiceFeature... features) { //check feature types for (WebServiceFeature f : features) { final String fName = f.getClass().getName(); if (!fName.startsWith("javax.xml.ws") && !fName.startsWith("org.jboss.ws")) { throw Messages.MESSAGES.unknownFeature(f.getClass().getName()); } } final String busStrategy = ClientBusSelector.getInstance().selectStrategy(features); ClassLoader origClassLoader = getContextClassLoader(); boolean restoreTCCL = false; Bus orig = null; try { restoreTCCL = checkAndFixContextClassLoader(origClassLoader); orig = BusFactory.getThreadDefaultBus(false); Bus bus = getOrCreateBus(busStrategy, origClassLoader); ServiceDelegate serviceDelegate = new JBossWSServiceImpl(bus, wsdlDocumentLocation, serviceName, serviceClass, features); setDisableCacheSchema(bus); return serviceDelegate; } finally { restoreThreadDefaultBus(busStrategy, orig); if (restoreTCCL) setContextClassLoader(origClassLoader); } }
public ServiceDelegate createServiceDelegate( URL wsdlDocumentLocation, QName serviceName, Class serviceClass, WebServiceFeature ... features) { if (features.length > 0) { throw new WebServiceException("Doesn't support any Service specific features"); } return new WSServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass); }
@SuppressWarnings("unchecked") @Override public ServiceDelegate createServiceDelegate(final URL wsdlDocumentLocation, final QName serviceName, final Class serviceClass) { ServiceDelegate serviceDelegate = delegate.createServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass); serviceDelegate = new ServiceDelegateWrapper(serviceDelegate); return serviceDelegate; }
public ServiceDelegate createServiceDelegate(final URL wsdlDocumentLocation, final QName serviceName, final Class serviceClass) { ServiceDelegate serviceDelegate = delegate.createServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass); // the PortRef list is bound to this thread when using @WebServiceRef injection // When using the JAX-WS API we don't need to wrap the ServiceDelegate if (threadPortRefs.get() != null) { serviceDelegate = new ServiceDelegateWrapper(serviceDelegate); } return serviceDelegate; }
public ServiceDelegateWrapper(final ServiceDelegate serviceDelegate) { this.serviceDelegate = serviceDelegate; final ProviderWrapperData providerWrapperData = threadPortRefs.get(); if (providerWrapperData != null) { this.customizer = providerWrapperData.customizer; this.configuration = providerWrapperData.properties; } else { this.customizer = null; this.configuration = null; } }
@Override public ServiceDelegate createServiceDelegate( URL wsdlDocumentLocation, QName serviceName, Class serviceClass) { return new WSServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass); }
public ServiceDelegate createServiceDelegate( Source wsdlSource, QName serviceName, Class serviceClass) { return new WSServiceDelegate(wsdlSource, serviceName, serviceClass); }
@Override public ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class<? extends Service> serviceClass) { return null; }
@Override public ServiceDelegate createServiceDelegate(URL url, QName qname, Class clazz) { return createServiceDelegate(url, qname, clazz, (WebServiceFeature[])null); }
public ServiceDelegate createServiceDelegate(URL url, QName qname, Class clazz, WebServiceFeature... features) { return new org.apache.axis2.jaxws.spi.ServiceDelegate(url, qname, clazz, features); }
public ServiceDelegateWrapper(final ServiceDelegate serviceDelegate) { this.serviceDelegate = serviceDelegate; }
@Override public ServiceDelegate createServiceDelegate(final URL url, final QName qName, final Class aClass) { return null; }
public ServiceDelegate createServiceDelegate(final URL url, final QName qName, final Class aClass) { return null; }