private void validatePossibleFault(Message message, BindingOperationInfo bop, Node ds) { Element el = DOMUtils.getFirstElement(ds); if (!"Fault".equals(el.getLocalName())) { return; } message.put(Message.RESPONSE_CODE, 500); el = DOMUtils.getFirstElement(el); while (el != null && !"detail".equals(el.getLocalName())) { el = DOMUtils.getNextElement(el); } if (el != null) { Schema schema = EndpointReferenceUtils.getSchema(message.getExchange().getService() .getServiceInfos().get(0), message.getExchange().getBus()); try { validateFaultDetail(el, schema, bop); } catch (Exception e) { throw new Fault(e); } //We validated what we can from a fault standpoint message.put(Message.SCHEMA_VALIDATION_ENABLED, Boolean.FALSE); } } private void validateFaultDetail(Element detail, Schema schema, BindingOperationInfo bop) throws Exception {
private void validateFault(SoapMessage message, SOAPFault fault, BindingOperationInfo bop) { if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.OUT, message)) { Schema schema = EndpointReferenceUtils.getSchema(message.getExchange().getService() .getServiceInfos().get(0), message.getExchange().getBus()); Detail d = fault.getDetail(); try { validateFaultDetail(d, schema, bop); } catch (Exception e) { throw new SoapFault(e.getMessage(), e, message.getVersion().getReceiver()); } //We validated what we can from a fault standpoint message.put(Message.SCHEMA_VALIDATION_ENABLED, Boolean.FALSE); } }
message.getExchange().getBus()); writer.setSchema(schema);
WorkQueueManager mgr = outMessage.getExchange().getBus() .getExtension(WorkQueueManager.class); AutomaticWorkQueue qu = mgr.getNamedWorkQueue("http-conduit");
/** {@inheritDoc}*/ public Object create(Exchange e) throws Throwable { if (ctx == null) { ctx = e.getBus().getExtension(ApplicationContext.class); } return ctx.getBean(beanName); }
/** {@inheritDoc}*/ public Object create(Exchange e) throws Throwable { if (ctx == null) { ctx = e.getBus().getExtension(ApplicationContext.class); } return ctx.getBean(beanName); }
/** {@inheritDoc}*/ public Object create(Exchange e) throws Throwable { if (ctx == null) { ctx = e.getBus().getExtension(ApplicationContext.class); } return ctx.getBean(beanName); }
private String transformLocally(Message m, UriInfo ui, Source source) throws Exception { InputStream is = ResourceUtils.getResourceStream(stylesheetReference, m.getExchange().getBus()); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setFeature(javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING, true); Transformer t = transformerFactory.newTemplates(new StreamSource(is)).newTransformer(); t.setParameter("base.path", m.get("http.base.path")); StringWriter stringWriter = new StringWriter(); t.transform(source, new StreamResult(stringWriter)); return stringWriter.toString(); }
public static Properties loadJwsProperties(Message m, String propLoc) { try { return JoseUtils.loadProperties(propLoc, m.getExchange().getBus()); } catch (Exception ex) { LOG.warning("JWS init properties are not available"); throw new JwsException(JwsException.Error.NO_INIT_PROPERTIES); } }
public static Properties loadJweProperties(Message m, String propLoc) { try { return JoseUtils.loadProperties(propLoc, m.getExchange().getBus()); } catch (Exception ex) { LOG.warning("JWS init properties are not available"); throw new JweException(JweException.Error.NO_INIT_PROPERTIES); } } }
public static PrivateKey loadPrivateKey(Message m, String keyStoreLocPropPreferred, String keyStoreLocPropDefault, KeyOperation keyOper) { String keyStoreLoc = getMessageProperty(m, keyStoreLocPropPreferred, keyStoreLocPropDefault); Bus bus = m.getExchange().getBus(); try { Properties props = JoseUtils.loadProperties(keyStoreLoc, bus); return loadPrivateKey(m, props, keyOper); } catch (Exception ex) { throw new SecurityException(ex); } } public static PrivateKey loadPrivateKey(String keyStoreLoc,
public TokenStore newTokenStore(String key, Message message) { URL configFileURL = SecurityUtils.getConfigFileURL(message, SecurityConstants.CACHE_CONFIG_FILE, "cxf-ehcache.xml"); return new EHCacheTokenStore(key, message.getExchange().getBus(), configFileURL); }
private Destination createDecoupledDestination(Message message) { String replyToAddress = (String)message.getContextualProperty(WSAContextUtils.REPLYTO_PROPERTY); if (replyToAddress != null) { return setUpDecoupledDestination(message.getExchange().getBus(), replyToAddress, message); } return null; } /**
public static URL loadResource(Message message, Object o) { Message msg = message; if (msg == null) { msg = PhaseInterceptorChain.getCurrentMessage(); } ResourceManager manager = null; if (msg != null && msg.getExchange() != null && msg.getExchange().getBus() != null) { manager = msg.getExchange().getBus().getExtension(ResourceManager.class); } return loadResource(manager, o); }
private void setDataWriterValidation(Service service, Message message, DataWriter<?> writer) { if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.OUT, message)) { Schema schema = EndpointReferenceUtils.getSchema(service.getServiceInfos().get(0), message.getExchange().getBus()); writer.setSchema(schema); } }
/** * Based on the Schema Validation configuration, will initialise the DataWriter with or without the schema set. */ private void setDataWriterValidation(Service service, Message message, DataWriter<?> writer) { if (shouldValidate(message)) { Schema schema = EndpointReferenceUtils.getSchema(service.getServiceInfos().get(0), message.getExchange().getBus()); writer.setSchema(schema); } }
public static PublicKey loadPublicKey(Message m, String keyStoreLocPropPreferred, String keyStoreLocPropDefault) { String keyStoreLoc = getMessageProperty(m, keyStoreLocPropPreferred, keyStoreLocPropDefault); Bus bus = m.getExchange().getBus(); try { Properties props = JoseUtils.loadProperties(keyStoreLoc, bus); return KeyManagementUtils.loadPublicKey(m, props); } catch (Exception ex) { LOG.warning("Public key can not be loaded"); throw new JoseException(ex); } } public static PublicKey loadPublicKey(String keyStorePropLoc, Bus bus) {
protected boolean isServiceCounterEnabled(Exchange ex) { Bus bus = ex.getBus(); CounterRepository counterRepo = bus.getExtension(CounterRepository.class); if (counterRepo == null) { return false; } ObjectName serviceCounterName = getServiceCounterName(ex); Counter serviceCounter = counterRepo.getCounter(serviceCounterName); //If serviceCounter is null, we need to wait ResponseTimeOutInterceptor to create it , hence set to true return serviceCounter == null || serviceCounter.isEnabled(); }
/** * Based on the Schema Validation configuration, will initialise the DataWriter with or without the schema set. */ private void setDataWriterValidation(Service service, Message message, DataWriter<?> writer) { if (shouldValidate(message)) { Schema schema = EndpointReferenceUtils.getSchema(service.getServiceInfos().get(0), message.getExchange().getBus()); writer.setSchema(schema); } }
private void setDataWriterValidation(Service service, Message message, DataWriter<?> writer) { if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.OUT, message)) { Schema schema = EndpointReferenceUtils.getSchema(service.getServiceInfos().get(0), message.getExchange().getBus()); writer.setSchema(schema); } }