public void setRoles(Set<String> set) { if (set != null && (set.contains(Soap11.getInstance().getNoneRole()) || set.contains(Soap12.getInstance().getNoneRole()))) { throw new WebServiceException(BUNDLE.getString("NONE_ROLE_ERR")); } this.roles = set; addRequiredRoles(); }
conf.setVersion(Soap12.getInstance()); conf.setVersion(Soap12.getInstance()); conf.setMtomEnabled(true);
if (namespace != null && cxfNamespace != null && !namespace.equals(cxfNamespace) && Soap12.SOAP_NAMESPACE.equals(namespace)) { cxfSoapMessage.setVersion(Soap12.getInstance()); cxfSoapMessage.put(Message.CONTENT_TYPE, cxfSoapMessage.getVersion().getContentType());
/** * {@inheritDoc} */ public Object convert(Object sourceObject, ReifiedType targetType) throws Exception { if ("1.2".equals(sourceObject)) { return Soap12.getInstance(); } else if ("1.1".equals(sourceObject)) { return Soap11.getInstance(); } throw new IllegalArgumentException("Unimplemented SOAP version requested."); } }
private void resolveSoapVersion(String n) { if (WSDLConstants.NS_SOAP11.equalsIgnoreCase(n)) { this.soapVersion = Soap11.getInstance(); } else if (WSDLConstants.NS_SOAP12.equalsIgnoreCase(n)) { this.soapVersion = Soap12.getInstance(); } else { throw new RuntimeException("Unknow bindingId: " + n + ". Can not resolve the SOAP version"); } }
/** * {@inheritDoc} */ public Object convert(Object sourceObject, ReifiedType targetType) throws Exception { if ("1.2".equals(sourceObject)) { return Soap12.getInstance(); } else if ("1.1".equals(sourceObject)) { return Soap11.getInstance(); } throw new IllegalArgumentException("Unimplemented SOAP version requested."); } }
private void resolveSoapVersion(String n) { if (WSDLConstants.NS_SOAP11.equalsIgnoreCase(n)) { this.soapVersion = Soap11.getInstance(); } else if (WSDLConstants.NS_SOAP12.equalsIgnoreCase(n)) { this.soapVersion = Soap12.getInstance(); } else { throw new RuntimeException("Unknow bindingId: " + n + ". Can not resolve the SOAP version"); } }
@Override public void setAsText(String text) throws IllegalArgumentException { if ("1.2".equals(text)) { this.version = Soap12.getInstance(); } else if ("1.1".equals(text)) { this.version = Soap11.getInstance(); } else { super.setAsText(text); } }
@Override public void setAsText(String text) throws IllegalArgumentException { if ("1.2".equals(text)) { this.version = Soap12.getInstance(); } else if ("1.1".equals(text)) { this.version = Soap11.getInstance(); } else { super.setAsText(text); } }
public void setRoles(Set<String> set) { if (set != null && (set.contains(Soap11.getInstance().getNoneRole()) || set.contains(Soap12.getInstance().getNoneRole()))) { throw new WebServiceException(BUNDLE.getString("NONE_ROLE_ERR")); } this.roles = set; addRequiredRoles(); }
private static void updateSoap12FaultCodes(SoapFault f) { //per Soap 1.2 spec, the fault code MUST be one of the 5 values specified in the spec. //Soap 1.1 allows the soap fault code to be arbitrary (recommends the 4 values in the spec, but //explicitely mentions that it can be extended to include additional codes). Soap 1.2 however //requires the use of one of the 5 defined codes. Additional detail or more specific information //can be transferred via the SubCodes. QName fc = f.getFaultCode(); SoapVersion v = Soap12.getInstance(); if (fc.getNamespaceURI().equals(Soap12.SOAP_NAMESPACE) && (fc.equals(v.getReceiver()) || fc.equals(v.getSender()) || fc.equals(v.getMustUnderstand()) || fc.equals(v.getDateEncodingUnknown()) || fc.equals(v.getVersionMismatch()))) { //valid fault codes, don't change anything return; } f.setFaultCode(Soap12.getInstance().getReceiver()); if (f.getSubCodes() == null) { f.setRootSubCode(fc); } else if (!f.getSubCodes().contains(fc)) { f.getSubCodes().add(fc); } } public static SoapFault createFault(Fault f, SoapVersion v) {
private boolean isSOAP12(Message message) { if (message.getExchange().getBinding() instanceof SoapBinding) { SoapBinding binding = (SoapBinding)message.getExchange().getBinding(); if (binding.getSoapVersion() == Soap12.getInstance()) { return true; } } return false; } }
private boolean isSOAP12(Message message) { if (message.getExchange().getBinding() instanceof SoapBinding) { SoapBinding binding = (SoapBinding) message.getExchange().getBinding(); if (binding.getSoapVersion() == Soap12.getInstance()) { return true; } } return false; }
private boolean isSOAP12(Message message) { if (message.getExchange().getBinding() instanceof SoapBinding) { SoapBinding binding = (SoapBinding) message.getExchange().getBinding(); if (binding.getSoapVersion() == Soap12.getInstance()) { return true; } } return false; }
private boolean isSOAP12(Message message) { if (message.getExchange().getBinding() instanceof SoapBinding) { SoapBinding binding = (SoapBinding)message.getExchange().getBinding(); if (binding.getSoapVersion() == Soap12.getInstance()) { return true; } } return false; } }
/** * 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 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; }
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; }
@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")); }