protected SoapBindingConfiguration createSoapBindingConfig() { return new SoapBindingConfiguration(); } protected BindingInfo createBindingInfo() {
@Override public String getStyle() { SOAPBinding sb = getServiceClass().getAnnotation(SOAPBinding.class); if (sb != null) { if (sb.style().equals(Style.DOCUMENT)) { return "document"; } else if (sb.style().equals(Style.RPC)) { return "rpc"; } } return super.getStyle(); }
@Override public String getUse() { SOAPBinding sb = getServiceClass().getAnnotation(SOAPBinding.class); if (sb != null) { if (sb.use().equals(Use.LITERAL)) { return "literal"; } else if (sb.use().equals(Use.ENCODED)) { return "encoded"; } } return super.getUse(); } }
/** * 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; }
config = (SoapBindingConfiguration)conf; } else { config = new SoapBindingConfiguration(); config.setVersion(Soap12.getInstance()); config.setTransportURI(WSDLConstants.NS_SOAP_HTTP_TRANSPORT); config.getVersion()); info.setName(config.getBindingName(si)); info.setStyle(config.getStyle()); info.setTransportURI(config.getTransportURI()); if (config.isMtomEnabled()) { info.setProperty(Message.MTOM_ENABLED, Boolean.TRUE); sop.setAction(config.getSoapAction(op)); sop.setStyle(config.getStyle(op));
private void configureBinding(ServerFactoryBean svrFactory) { SoapBindingConfiguration bindingConfig = new SoapBindingConfiguration(); bindingConfig.setBindingName(wsTransactionConfiguration.getBindingName()); svrFactory.setBindingConfig(bindingConfig); }
public Boolean isWrapped() { if (getBindingConfig() instanceof SoapBindingConfiguration && ((SoapBindingConfiguration)getBindingConfig()).isSetStyle() && "rpc".equals(((SoapBindingConfiguration)getBindingConfig()).getStyle())) { return Boolean.FALSE; } return null; } }
private void setupHeaders(BindingOperationInfo op, BindingMessageInfo bMsg, BindingMessageInfo unwrappedBMsg, MessageInfo msg, SoapBindingConfiguration config) { List<MessagePartInfo> parts = new ArrayList<>(); for (MessagePartInfo part : msg.getMessageParts()) { if (config.isHeader(op, part)) { SoapHeaderInfo headerInfo = new SoapHeaderInfo(); headerInfo.setPart(part); headerInfo.setUse(config.getUse()); bMsg.addExtensor(headerInfo); } else { parts.add(part); } } unwrappedBMsg.setMessageParts(parts); }
/** * 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; }
config = (SoapBindingConfiguration)conf; } else { config = new SoapBindingConfiguration(); config.setVersion(Soap12.getInstance()); config.setTransportURI(WSDLConstants.NS_SOAP_HTTP_TRANSPORT); config.getVersion()); info.setName(config.getBindingName(si)); info.setStyle(config.getStyle()); info.setTransportURI(config.getTransportURI()); if (config.isMtomEnabled()) { info.setProperty(Message.MTOM_ENABLED, Boolean.TRUE); sop.setAction(config.getSoapAction(op)); sop.setStyle(config.getStyle(op));
public Boolean isWrapped() { if (getBindingConfig() instanceof SoapBindingConfiguration && ((SoapBindingConfiguration)getBindingConfig()).isSetStyle() && "rpc".equals(((SoapBindingConfiguration)getBindingConfig()).getStyle())) { return Boolean.FALSE; } return null; } }
private void setupHeaders(BindingOperationInfo op, BindingMessageInfo bMsg, BindingMessageInfo unwrappedBMsg, MessageInfo msg, SoapBindingConfiguration config) { List<MessagePartInfo> parts = new ArrayList<>(); for (MessagePartInfo part : msg.getMessageParts()) { if (config.isHeader(op, part)) { SoapHeaderInfo headerInfo = new SoapHeaderInfo(); headerInfo.setPart(part); headerInfo.setUse(config.getUse()); bMsg.addExtensor(headerInfo); } else { parts.add(part); } } unwrappedBMsg.setMessageParts(parts); }
/** * 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; }
protected SoapBindingConfiguration createSoapBindingConfig() { return new SoapBindingConfiguration(); } protected BindingInfo createBindingInfo() {
public String getStyle() { if (getBindingConfig() instanceof SoapBindingConfiguration && ((SoapBindingConfiguration)getBindingConfig()).isSetStyle()) { return ((SoapBindingConfiguration)getBindingConfig()).getStyle(); } return null; } public Boolean isWrapped() {
public String getStyle(OperationInfo op) { return getStyle(); }
@Override public String getUse() { SOAPBinding sb = getServiceClass().getAnnotation(SOAPBinding.class); if (sb != null) { if (sb.use().equals(Use.LITERAL)) { return "literal"; } else if (sb.use().equals(Use.ENCODED)) { return "encoded"; } } return super.getUse(); } }
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; }
public String getStyle() { if (getBindingConfig() instanceof SoapBindingConfiguration && ((SoapBindingConfiguration)getBindingConfig()).isSetStyle()) { return ((SoapBindingConfiguration)getBindingConfig()).getStyle(); } return null; } public Boolean isWrapped() {
public String getStyle(OperationInfo op) { return getStyle(); }