JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(WebServiceClass); BindingConfiguration config = new BindingConfiguration() { @Override public String getBindingId() { // TODO Auto-generated method stub return "http://www.w3.org/2003/05/soap/bindings/HTTP/";//SOAPVersion.SOAP_12.httpBindingId } }; factory.setBindingConfig(config);
/** * 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; }
SoapBindingConfiguration config = new SoapBindingConfiguration(); config.setVersion(Soap12.getInstance()); pf.setBindingConfig(config); pf.setBus(bus); WrappedGreeter greeter = (WrappedGreeter) pf.create();
SoapBindingConfiguration config = new SoapBindingConfiguration(); config.setVersion(Soap12.getInstance()); pf.setBindingConfig(config); pf.setBus(bus); Greeter greeter = (Greeter) pf.create();
@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")); }