Search in sources :

Example 1 with SpringBus

use of org.apache.cxf.bus.spring.SpringBus in project iaf by ibissource.

the class WebServiceListener method configure.

/**
 * initialize listener and register <code>this</code> to the JNDI
 */
@Override
public void configure() throws ConfigurationException {
    super.configure();
    if (StringUtils.isEmpty(getAddress()) && isMtomEnabled())
        throw new ConfigurationException("can only use MTOM when address attribute has been set");
    if (StringUtils.isNotEmpty(getAddress()) && getAddress().contains(":"))
        throw new ConfigurationException("address cannot contain colon ( : ) character");
    if (StringUtils.isNotEmpty(getAttachmentSessionKeys())) {
        StringTokenizer stringTokenizer = new StringTokenizer(getAttachmentSessionKeys(), " ,;");
        while (stringTokenizer.hasMoreTokens()) {
            attachmentSessionKeysList.add(stringTokenizer.nextToken());
        }
    }
    if (isSoap()) {
        // String msg = ClassUtils.nameOf(this) +"["+getName()+"]: the use of attribute soap=true has been deprecated. Please use the SoapWrapperPipe instead";
        // ConfigurationWarnings.getInstance().add(log, msg, true);
        soapWrapper = SoapWrapper.getInstance();
    }
    if (StringUtils.isEmpty(getServiceNamespaceURI()) && StringUtils.isEmpty(getAddress())) {
        String msg = "calling webservices via de ServiceDispatcher_ServiceProxy is deprecated. Please specify an address or serviceNamespaceURI and modify the call accordingly";
        ConfigurationWarnings.add(this, log, msg, SuppressKeys.DEPRECATION_SUPPRESS_KEY, null);
    }
    Bus bus = getApplicationContext().getBean("cxf", Bus.class);
    if (bus instanceof SpringBus) {
        cxfBus = (SpringBus) bus;
        log.debug("found CXF SpringBus id [" + bus.getId() + "]");
    } else {
        throw new ConfigurationException("unable to find SpringBus, cannot register " + this.getClass().getSimpleName());
    }
}
Also used : Bus(org.apache.cxf.Bus) SpringBus(org.apache.cxf.bus.spring.SpringBus) StringTokenizer(java.util.StringTokenizer) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) SpringBus(org.apache.cxf.bus.spring.SpringBus)

Example 2 with SpringBus

use of org.apache.cxf.bus.spring.SpringBus in project iaf by ibissource.

the class IbisApplicationInitializer method initWebApplicationContext.

/*
	 * Purely here to print the CXF SpringBus ID
	 */
@Override
public WebApplicationContext initWebApplicationContext(ServletContext servletContext) {
    try {
        WebApplicationContext wac = super.initWebApplicationContext(servletContext);
        SpringBus bus = (SpringBus) wac.getBean("cxf");
        servletContext.log("Successfully started IBIS WebApplicationInitializer with SpringBus [" + bus.getId() + "]");
        return wac;
    } catch (Exception e) {
        log.fatal("IBIS ApplicationInitializer failed to initialize", e);
        throw e;
    }
}
Also used : SpringBus(org.apache.cxf.bus.spring.SpringBus) WebApplicationContext(org.springframework.web.context.WebApplicationContext) XmlWebApplicationContext(org.springframework.web.context.support.XmlWebApplicationContext)

Example 3 with SpringBus

use of org.apache.cxf.bus.spring.SpringBus in project iaf by ibissource.

the class NamespaceUriProviderBean method afterPropertiesSet.

@Override
public void afterPropertiesSet() throws Exception {
    // TODO look into NamespaceHandlerResolver
    Bus bus = (Bus) applicationContext.getBean("cxf");
    if (bus instanceof SpringBus) {
        log.debug("default CXF SpringBus [" + bus.getId() + "]");
        log.info("registering NamespaceURI Provider with JAX-WS CXF Dispatcher");
        namespaceRouter = new EndpointImpl(bus, new NamespaceUriProvider());
        namespaceRouter.publish("/rpcrouter");
        if (namespaceRouter.isPublished()) {
            log.info("published NamespaceURI Provider on CXF endpoint [rpcrouter] on SpringBus [" + namespaceRouter.getBus().getId() + "]");
        } else {
            throw new IllegalStateException("unable to NamespaceURI Service Provider on CXF endpoint [rpcrouter]");
        }
    } else {
        throw new IllegalStateException("CXF bus [" + bus + "] not instance of [SpringBus]");
    }
}
Also used : Bus(org.apache.cxf.Bus) SpringBus(org.apache.cxf.bus.spring.SpringBus) NamespaceUriProvider(nl.nn.adapterframework.http.cxf.NamespaceUriProvider) SpringBus(org.apache.cxf.bus.spring.SpringBus) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 4 with SpringBus

use of org.apache.cxf.bus.spring.SpringBus in project uavstack by uavorg.

the class CxfConfig method endpoint.

@Bean
public Endpoint endpoint() {
    EndpointImpl endpoint = new EndpointImpl(new SpringBus(), userService());
    endpoint.publish("/user");
    return endpoint;
}
Also used : EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) SpringBus(org.apache.cxf.bus.spring.SpringBus) ServletRegistrationBean(org.springframework.boot.web.servlet.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

SpringBus (org.apache.cxf.bus.spring.SpringBus)4 Bus (org.apache.cxf.Bus)2 EndpointImpl (org.apache.cxf.jaxws.EndpointImpl)2 StringTokenizer (java.util.StringTokenizer)1 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)1 NamespaceUriProvider (nl.nn.adapterframework.http.cxf.NamespaceUriProvider)1 ServletRegistrationBean (org.springframework.boot.web.servlet.ServletRegistrationBean)1 Bean (org.springframework.context.annotation.Bean)1 WebApplicationContext (org.springframework.web.context.WebApplicationContext)1 XmlWebApplicationContext (org.springframework.web.context.support.XmlWebApplicationContext)1