Endpoint ep = Endpoint.create(new WebserviceImpl()); List<Handler> handlerChain = ep.getBinding().getHandlerChain(); handlerChain.add(new SOAPLoggingHandler()); ep.getBinding().setHandlerChain(handlerChain); ep.publish(publishURL);
DynamicClientFactory dcf = DynamicClientFactory.newInstance(); Client client = dcf.createClient("http://admin:password@localhost:8080"+ "/services/MyService?wsdl"); Object[] a = client.invoke("test", ""); System.out.println(a);
public List<Interceptor<? extends Message>> getOutInterceptors() { if (server == null) { return out; } return new DoubleAddInterceptorList(out, server.getEndpoint().getOutInterceptors()); }
@Override public void run() { if(serverFactoryBean.getServer()!= null) { serverFactoryBean.getServer().destroy(); } if(serverFactoryBean.getBus()!=null) { serverFactoryBean.getBus().shutdown(true); } } };
@Override @SuppressWarnings("unchecked") protected <T> T doRefer(final Class<T> serviceType, final URL url) throws RpcException { ClientProxyFactoryBean proxyFactoryBean = new ClientProxyFactoryBean(); proxyFactoryBean.setAddress(url.setProtocol("http").toIdentityString()); proxyFactoryBean.setServiceClass(serviceType); proxyFactoryBean.setBus(bus); T ref = (T) proxyFactoryBean.create(); Client proxy = ClientProxy.getClient(ref); HTTPConduit conduit = (HTTPConduit) proxy.getConduit(); HTTPClientPolicy policy = new HTTPClientPolicy(); policy.setConnectionTimeout(url.getParameter(Constants.CONNECT_TIMEOUT_KEY, Constants.DEFAULT_CONNECT_TIMEOUT)); policy.setReceiveTimeout(url.getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT)); conduit.setClient(policy); return ref; }
public List<Interceptor<? extends Message>> getOutFaultInterceptors() { if (server == null) { return outFault; } return new DoubleAddInterceptorList(outFault, server.getEndpoint().getOutFaultInterceptors()); }
@Override public void setProperties(Map<String, Object> properties) { this.properties = properties; if (server != null) { server.getEndpoint().putAll(properties); } }
@BeforeClass public static void initialize() throws Exception { dateFormatStr = "yyyy-MM-dd"; System.setProperty("org.jbpm.event.emitters.elasticsearch.date_format", dateFormatStr); FakeElasticSearchRESTApplication application = new FakeElasticSearchRESTApplication(responseCollector); RuntimeDelegate delegate = RuntimeDelegate.getInstance(); JAXRSServerFactoryBean bean = delegate.createEndpoint(application, JAXRSServerFactoryBean.class); String url = "http://localhost:9998" + bean.getAddress(); bean.setAddress(url); server = bean.create(); server.start(); System.setProperty("org.jbpm.event.emitters.elasticsearch.url", url); }
public void close() throws IOException { client.destroy(); } }
@SuppressWarnings("unchecked") public T get() throws InterruptedException, ExecutionException { return (T)callback.get()[0]; } @SuppressWarnings("unchecked")
public Map<String, Object> getContext() { try { return callback.getResponseContext(); } catch (Exception ex) { return null; } } public boolean cancel(boolean mayInterruptIfRunning) {
@Override public void run() { if(serverFactoryBean.getServer()!= null) { serverFactoryBean.getServer().destroy(); } if(serverFactoryBean.getBus()!=null) { serverFactoryBean.getBus().shutdown(true); } } };
@Override @SuppressWarnings("unchecked") protected <T> T doRefer(final Class<T> serviceType, final URL url) throws RpcException { ClientProxyFactoryBean proxyFactoryBean = new ClientProxyFactoryBean(); proxyFactoryBean.setAddress(url.setProtocol("http").toIdentityString()); proxyFactoryBean.setServiceClass(serviceType); proxyFactoryBean.setBus(bus); T ref = (T) proxyFactoryBean.create(); Client proxy = ClientProxy.getClient(ref); HTTPConduit conduit = (HTTPConduit) proxy.getConduit(); HTTPClientPolicy policy = new HTTPClientPolicy(); policy.setConnectionTimeout(url.getParameter(Constants.CONNECT_TIMEOUT_KEY, Constants.DEFAULT_CONNECT_TIMEOUT)); policy.setReceiveTimeout(url.getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT)); conduit.setClient(policy); return ref; }
@BeforeClass public static void initialize() throws Exception { FakeElasticSearchRESTApplication application = new FakeElasticSearchRESTApplication(responseCollector); RuntimeDelegate delegate = RuntimeDelegate.getInstance(); JAXRSServerFactoryBean bean = delegate.createEndpoint(application, JAXRSServerFactoryBean.class); String url = "http://localhost:9998" + bean.getAddress(); bean.setAddress(url); server = bean.create(); server.start(); System.setProperty("org.jbpm.event.emitters.elasticsearch.url", url); }
@SuppressWarnings("unchecked") public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return (T)callback.get(timeout, unit)[0]; } public boolean isCancelled() {
@Override public void stop() { if (null != server) { server.destroy(); server = null; } }
public void destroy() { if (server != null) { server.destroy(); server = null; } } }
public void destroy() { if (server != null) { server.destroy(); server = null; } } public void setApplicationContext(ApplicationContext ctx) throws BeansException {