/** * Create a new instance using a specific <tt>Bus</tt>. * * @param b the <tt>Bus</tt> to use in subsequent operations with the * instance * @return the new instance */ public static JaxWsDynamicClientFactory newInstance(Bus b) { return new JaxWsDynamicClientFactory(b); }
public ServiceTaskHandler(KieSession ksession, int timeout) { this.dcf = JaxWsDynamicClientFactory.newInstance(); this.ksession = ksession; this.asyncTimeout = timeout; }
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); Client client = dcf.createClient("http://ws.strikeiron.com/IPLookup2?wsdl"); Thread.currentThread().setContextClassLoader(classLoader);
/** * Creates and returns service * * @param wsdlLocation wsdl location url * @return */ protected Client getDynamicClient(String wsdlLocation) { if (wsdlLocation == null) { throw new IllegalArgumentException("wsdlLocation can't be null"); } JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); Client client = clientFactory.createClient(wsdlLocation); return client; } }
@Test public void testCxf5061() throws Exception { if (JavaUtils.isJava9Compatible()) { System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true"); } //using dcf to generate client from the wsdl which ensure the wsdl is valid JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); dcf.createClient(ADDRESS + "?wsdl"); }
/** * 创建动态客户端对象 * * @param wsdlUrl web service地址 * * @return {@link Client} */ public static Client createDynamicClient(String wsdlUrl) { if (clientMap.containsKey(wsdlUrl)) { return clientMap.get(wsdlUrl); } Client client = jaxWsDynamicClientFactory.createClient(wsdlUrl); clientMap.put(wsdlUrl, client); return client; }
protected synchronized DynamicClientFactory getDynamicClientFactory() { if (this.dcf == null) { this.dcf = JaxWsDynamicClientFactory.newInstance(); } return this.dcf; }
/** * Create a new instance using a default <tt>Bus</tt>. * * @return the new instance * @see CXFBusFactory#getDefaultBus() */ public static JaxWsDynamicClientFactory newInstance() { Bus bus = BusFactory.getThreadDefaultBus(); return new JaxWsDynamicClientFactory(bus); } }
@Test public void testArrayList() throws Exception { JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); Client client = dcf.createClient(new URL("http://localhost:" + PORT1 + "/ArrayService?wsdl")); String[] values = new String[] {"foobar", "something" }; List<String> list = Arrays.asList(values); client.getOutInterceptors().add(new LoggingOutInterceptor()); client.getInInterceptors().add(new LoggingInInterceptor()); client.invoke("init", list); }
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); Client client = dcf.createClient("ws.strikeiron.com/IPLookup2?WSDL"); Thread.currentThread().setContextClassLoader(classLoader);
protected synchronized DynamicClientFactory getDynamicClientFactory(CommandContext ctx) { if (this.dcf == null) { this.dcf = JaxWsDynamicClientFactory.newInstance(); } return this.dcf; }
/** * Create a new instance using a specific <tt>Bus</tt>. * * @param b the <tt>Bus</tt> to use in subsequent operations with the * instance * @return the new instance */ public static JaxWsDynamicClientFactory newInstance(Bus b) { return new JaxWsDynamicClientFactory(b); }
@org.junit.Test public void testGetWSDL() throws Exception { BusFactory bf = BusFactory.newInstance(); Bus bus = bf.createBus(); bus.getInInterceptors().add(new LoggingInInterceptor()); bus.getOutInterceptors().add(new LoggingOutInterceptor()); MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer(); bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class); JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus); factory.createClient(ADDRESS + "?wsdl"); }
ClassLoader loader = this.getClass().getClassLoader(); JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); Client client = dcf.createClient("wsdlPath", classLoader);
public ServiceTaskHandler(KieSession ksession, ClassLoader classloader) { this.dcf = JaxWsDynamicClientFactory.newInstance(); this.ksession = ksession; this.classLoader = classloader; }
/** * Create a new instance using a default <tt>Bus</tt>. * * @return the new instance * @see CXFBusFactory#getDefaultBus() */ public static JaxWsDynamicClientFactory newInstance() { Bus bus = BusFactory.getThreadDefaultBus(); return new JaxWsDynamicClientFactory(bus); } }
ClassLoader loader = this.getClass().getClassLoader(); JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); Client client = dcf.createClient("wsdlPath", classLoader);
public ServiceTaskHandler() { this.dcf = JaxWsDynamicClientFactory.newInstance(); }
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); Client client = dcf.createClient("echo.wsdl"); Object[] res = client.invoke("echo", "test echo"); System.out.println("Echo response: " + res[0]);
public ServiceTaskHandler(KieSession ksession) { this.dcf = JaxWsDynamicClientFactory.newInstance(); this.ksession = ksession; }