/** * Creates a vas subscriber web service proxy based on the delivery address. * * @param deliveryAddress delivery address * @return subscriber web service proxy */ public VasSubscriberService createVasSubscriberService(String deliveryAddress) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(VasSubscriberService.class); factory.setAddress(deliveryAddress); SoapBindingConfiguration conf = new SoapBindingConfiguration(); conf.setVersion(Soap12.getInstance()); factory.setBindingConfig(conf); factory.getFeatures().add(new WSAddressingFeature()); VasSubscriberService vasSubscriberService = (VasSubscriberService) factory.create(); //Force the use of the Async transport, even for synchronous calls ((BindingProvider) vasSubscriberService).getRequestContext().put("use.async.http.conduit", Boolean.TRUE); return vasSubscriberService; }
/** * Creates a charging station web service proxy. * * @param chargingStationAddress address of the charging station. * @return charging station web service proxy */ public ChargePointService createChargingStationService(String chargingStationAddress) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(ChargePointService.class); factory.setAddress(chargingStationAddress); SoapBindingConfiguration conf = new SoapBindingConfiguration(); conf.setVersion(Soap12.getInstance()); factory.setBindingConfig(conf); factory.getFeatures().add(new WSAddressingFeature()); ChargePointService chargePointService = (ChargePointService) factory.create(); //Force the use of the Async transport, even for synchronous calls ((BindingProvider) chargePointService).getRequestContext().put("use.async.http.conduit", Boolean.TRUE); return chargePointService; }
/** * Creates a charging station web service proxy. * * @param chargingStationAddress address of the charging station. * @return charging station web service proxy */ public ChargePointService createChargingStationService(String chargingStationAddress) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(ChargePointService.class); factory.setAddress(chargingStationAddress); SoapBindingConfiguration conf = new SoapBindingConfiguration(); conf.setVersion(Soap12.getInstance()); factory.setBindingConfig(conf); factory.getFeatures().add(new WSAddressingFeature()); ChargePointService chargePointService = (ChargePointService) factory.create(); //Force the use of the Async transport, even for synchronous calls ((BindingProvider) chargePointService).getRequestContext().put("use.async.http.conduit", Boolean.TRUE); return chargePointService; }
public static JaxWsProxyFactoryBean getServiceProxy(BindingProvider servicePort, String serviceAddr) { JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean(); if(serviceAddr != null) proxyFactory.setAddress(serviceAddr); proxyFactory.setServiceClass(servicePort.getClass()); proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor()); SoapBindingConfiguration config = new SoapBindingConfiguration(); config.setVersion(Soap12.getInstance()); proxyFactory.setBindingConfig(config); Client deviceClient = ClientProxy.getClient(servicePort); HTTPConduit http = (HTTPConduit) deviceClient.getConduit(); // AuthorizationPolicy authPolicy = new AuthorizationPolicy(); // authPolicy.setUserName(username); // authPolicy.setPassword(password); // authPolicy.setAuthorizationType("Basic"); // http.setAuthorization(authPolicy); HTTPClientPolicy httpClientPolicy = http.getClient(); httpClientPolicy.setConnectionTimeout(36000); httpClientPolicy.setReceiveTimeout(32000); httpClientPolicy.setAllowChunking(false); return proxyFactory; }
pf.setAddress(add14); SoapBindingConfiguration config = new SoapBindingConfiguration(); config.setVersion(Soap12.getInstance()); pf.setBindingConfig(config); pf.setBus(bus);
pf.setAddress(add12); SoapBindingConfiguration config = new SoapBindingConfiguration(); config.setVersion(Soap12.getInstance()); pf.setBindingConfig(config); pf.setBus(bus);
@Test public void testSoap12Endpoint() throws Exception { JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean(); pf.setServiceClass(Greeter.class); pf.setAddress(add12); SoapBindingConfiguration config = new SoapBindingConfiguration(); config.setVersion(Soap12.getInstance()); pf.setBindingConfig(config); pf.setBus(bus); Greeter greeter = (Greeter) pf.create(); assertEquals("sayHi", greeter.sayHi("test")); assertEquals("sayHi2", greeter.sayHi2("test")); }
config.setVersion(Soap12.getInstance()); config.setTransportURI(WSDLConstants.NS_SOAP_HTTP_TRANSPORT);
config.setVersion(Soap12.getInstance()); config.setTransportURI(WSDLConstants.NS_SOAP_HTTP_TRANSPORT);
sf.setBus(bus); SoapBindingConfiguration config = new SoapBindingConfiguration(); config.setVersion(Soap12.getInstance()); sf.setBindingConfig(config); sf.create(); sf.setAddress(add14); sf.setBus(bus); config.setVersion(Soap12.getInstance()); sf.setBindingConfig(config); sf.create();