@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; }
@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; }
@Override public void initialize(Client client, Bus bus) { Conduit conduit = client.getConduit(); if (conduitConfig != null && conduit instanceof HTTPConduit) { conduitConfig.apply((HTTPConduit)conduit); } }
public void connect(TokenHolder tokenHolder) { for (Class<? extends PublicInterface> interface1 : interfaces) { JaxWsProxyFactoryBean cpfb = new JaxWsProxyFactoryBean(); cpfb.setServiceClass(interface1); cpfb.setAddress(address + "/" + interface1.getSimpleName()); Map<String, Object> properties = new HashMap<String, Object>(); properties.put("mtom-enabled", Boolean.TRUE); cpfb.setProperties(properties); PublicInterface serviceInterface = (PublicInterface) cpfb.create(); client = ClientProxy.getClient(serviceInterface); HTTPConduit http = (HTTPConduit) client.getConduit(); http.getClient().setConnectionTimeout(360000); http.getClient().setAllowChunking(false); http.getClient().setReceiveTimeout(320000); if (!useSoapHeaderSessions) { ((BindingProvider) serviceInterface).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE); } add(interface1.getName(), serviceInterface); } tokenHolder.registerTokenChangeListener(this); notifyOfConnect(); }
@Override public void initialize(Client client, Bus bus) { Conduit conduit = client.getConduit(); if (conduitConfig != null && conduit instanceof HTTPConduit) { conduitConfig.apply((HTTPConduit)conduit); } }
@Override public void configureClient(Client client) { HTTPConduit httpConduit = (HTTPConduit) client.getConduit(); setupHttpConduit(httpConduit); }
protected void setHttpClientPolicy(PortT port, HTTPClientPolicy httpClientPolicy) { Client proxy = ClientProxy.getClient(port); HTTPConduit conduit = (HTTPConduit) proxy.getConduit(); conduit.setClient(httpClientPolicy); }
DynamicClientFactory dcf = DynamicClientFactory.newInstance(); Client client = dcf.createClient("WSDL Location"); AuthorizationPolicy authorization = ((HTTPConduit) client.getConduit()).getAuthorization(); authorization.setUserName( "user name" ); authorization.setPassword( "password" ); Object[] res = client.invoke(new QName("http://targetNameSpace/", "operationName"), params...); System.out.println("Echo response: " + res[0]);
public void clientCreated(final Client client) { if (null == store || null == retransmissionQueue) { return; } String id = RMUtils.getEndpointIdentifier(client.getEndpoint(), getBus()); Collection<SourceSequence> sss = store.getSourceSequences(id/*, protocol*/); if (null == sss || 0 == sss.size()) { return; } LOG.log(Level.FINE, "Number of source sequences: {0}", sss.size()); recoverReliableEndpoint(client.getEndpoint(), client.getConduit()/*, protocol*/); }
ProxyWs proxy = (ProxyWs) factory.create(); Client client = ClientProxy.getClient(proxy); HTTPConduit http = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(0); httpClientPolicy.setReceiveTimeout(0); http.setClient(httpClientPolicy);
private void setProxySetting(EventPortType port) { try{ Client client = ClientProxy.getClient(port); HTTPConduit http = (HTTPConduit) client.getConduit(); http.getClient().setProxyServer("***host***"); http.getClient().setProxyServerPort(80); http.getProxyAuthorization().setUserName("***username***"); http.getProxyAuthorization().setPassword("***password***"); }catch (Exception e) { logger.error("Please Enter your proxy setting in MyClass class", e); } }
ProxyWs proxy = (ProxyWs) factory.create(); Client client = ClientProxy.getClient(proxy); HTTPConduit http = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(0); httpClientPolicy.setReceiveTimeout(0); http.setClient(httpClientPolicy);
Client client = ClientProxy.getClient(proxy); HTTPConduit http = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(0); httpClientPolicy.setReceiveTimeout(0); http.setClient(httpClientPolicy);
public static void setKeepAliveConnection(Object proxy, boolean keepAlive, boolean force) { if (force || "HP-UX".equals(System.getProperty("os.name")) || "Windows XP".equals(System.getProperty("os.name"))) { Client client = ClientProxy.getClient(proxy); HTTPConduit hc = (HTTPConduit)client.getConduit(); HTTPClientPolicy cp = hc.getClient(); cp.setConnection(keepAlive ? ConnectionType.KEEP_ALIVE : ConnectionType.CLOSE); } }
MyWebService service = new MyWebService(); MyWebServicePortType client = service.MyWebServicePort(); Client cl = ClientProxy.getClient(client); HTTPConduit http = (HTTPConduit) cl.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(0); httpClientPolicy.setReceiveTimeout(0); http.setClient(httpClientPolicy); client.doSomething(...);
@Override public void initialize(Client client, Bus bus) { checkJmsConfig(); Conduit conduit = client.getConduit(); if (!(conduit instanceof JMSConduit)) { throw new ConfigurationException(new Message("JMSCONFIGFEATURE_ONLY_JMS", LOG)); } JMSConduit jmsConduit = (JMSConduit)conduit; jmsConduit.setJmsConfig(jmsConfig); super.initialize(client, bus); }
private void configureTimeouts(P port) { Client client = getClient(port); HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(connectionTimeoutMs); httpClientPolicy.setReceiveTimeout(receiveTimeoutMs); httpClientPolicy.setAutoRedirect(true); httpClientPolicy.setAllowChunking(true); conduit.setClient(httpClientPolicy); }
private void configureTimeout(final Client clientProxy) { final HTTPConduit conduit = (HTTPConduit) clientProxy.getConduit(); final HTTPClientPolicy policy = new HTTPClientPolicy(); policy.setReceiveTimeout(this.wsConfiguration.getReceiveTimeout()); policy.setConnectionTimeout(this.wsConfiguration.getReceiveTimeout()); policy.setAsyncExecuteTimeout(this.wsConfiguration.getReceiveTimeout()); conduit.setClient(policy); }
public void configureProxy(Client client) { HTTPConduit cond = (HTTPConduit)client.getConduit(); HTTPClientPolicy pol = cond.getClient(); if (pol == null) { pol = new HTTPClientPolicy(); cond.setClient(pol); } pol.setProxyServer("localhost"); pol.setProxyServerPort(PROXY_PORT); }
public void configureProxy(Client client) { HTTPConduit cond = (HTTPConduit)client.getConduit(); HTTPClientPolicy pol = cond.getClient(); if (pol == null) { pol = new HTTPClientPolicy(); cond.setClient(pol); } pol.setProxyServer("localhost"); pol.setProxyServerPort(PROXY_PORT); }