Search in sources :

Example 1 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl in project cxf by apache.

the class ProviderImpl method createEndpoint.

// new in 2.2
public Endpoint createEndpoint(String bindingId, Object implementor, WebServiceFeature... features) {
    EndpointImpl ep = null;
    if (EndpointUtils.isValidImplementor(implementor)) {
        Bus bus = BusFactory.getThreadDefaultBus();
        ep = createEndpointImpl(bus, bindingId, implementor, features);
        return ep;
    }
    throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
}
Also used : Bus(org.apache.cxf.Bus) WebServiceException(javax.xml.ws.WebServiceException) Message(org.apache.cxf.common.i18n.Message) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 2 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl 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 3 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.

the class JmsConfiguratorTest method testCreateAndConfigureEndpoint.

@Test
public void testCreateAndConfigureEndpoint() {
    HelloWorldImpl2 implementor = new HelloWorldImpl2();
    String address = "local://JmsUriConfiguratorTest";
    ep = Endpoint.publish(address, implementor);
    JmsConfigurator jmsConfigurator = JmsConfigurator.create(ep);
    Assert.assertNotNull(jmsConfigurator);
    Assert.assertEquals("HelloWorldImpl2Port", jmsConfigurator.getConfigurationPrefix());
    Assert.assertEquals(SERVICE_NAME, jmsConfigurator.getServiceName());
    JMSConfiguration jmsConf = new JMSConfiguration();
    jmsConfigurator.setJmsConfiguration(jmsConf);
    Endpoint ep2 = jmsConfigurator.configureEndpoint(ep);
    Assert.assertNotNull(ep2);
    Configuration cnf = jmsConfigurator.getConfiguration();
    Assert.assertNotNull(cnf);
    Assert.assertEquals("org.apache.activemq.jndi.ActiveMQInitialContextFactory", cnf.get("jndiInitialContextFactory"));
    Assert.assertEquals("jndi", cnf.get("variant"));
    Assert.assertEquals("ConnectionFactory", cnf.get("jndiConnectionFactoryName"));
    Assert.assertEquals("tcp://localhost:61616", cnf.get("jndiURL"));
    Assert.assertEquals("dynamicQueues/libraryprovider.queue", cnf.get("destinationName"));
    List<Feature> features = ((EndpointImpl) ep2).getFeatures();
    boolean jmsConfigFeaturePresent = false;
    for (Feature f : features) {
        if (f instanceof org.apache.cxf.transport.jms.JMSConfigFeature) {
            jmsConfigFeaturePresent = true;
            break;
        }
    }
    Assert.assertTrue(jmsConfigFeaturePresent);
}
Also used : JMSConfiguration(org.apache.cxf.transport.jms.JMSConfiguration) Configuration(org.talend.esb.mep.requestcallback.feature.Configuration) JMSConfiguration(org.apache.cxf.transport.jms.JMSConfiguration) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) Feature(org.apache.cxf.feature.Feature) HelloWorldImpl2(org.talend.esb.mep.requestcallback.test.internal.HelloWorldImpl2) JmsConfigurator(org.talend.esb.mep.requestcallback.beans.JmsConfigurator) Endpoint(javax.xml.ws.Endpoint) Test(org.junit.Test)

Example 4 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.

the class JmsConfigurator method configureEndpoint.

public Endpoint configureEndpoint(Endpoint endpoint) {
    if (jmsConfiguration == null || !(endpoint instanceof EndpointImpl) || (serviceName == null && configuration == null)) {
        return null;
    }
    if (!jmsConfigured) {
        setupJmsConfiguration();
    }
    final EndpointImpl ei = (EndpointImpl) endpoint;
    final JMSConfigFeature feature = new JMSConfigFeature();
    feature.setJmsConfig(jmsConfiguration);
    List<Feature> features = ei.getFeatures();
    if (features == null) {
        features = new ArrayList<Feature>();
    }
    features.add(feature);
    ei.setFeatures(features);
    return endpoint;
}
Also used : JMSConfigFeature(org.apache.cxf.transport.jms.JMSConfigFeature) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) Feature(org.apache.cxf.feature.Feature) JMSConfigFeature(org.apache.cxf.transport.jms.JMSConfigFeature)

Example 5 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.

the class JmsUriConfigurator method create.

public static JmsUriConfigurator create(Endpoint endpoint) {
    if (!(endpoint instanceof EndpointImpl)) {
        return null;
    }
    final EndpointImpl ep = (EndpointImpl) endpoint;
    final QName serviceName = ep.getServiceName();
    if (serviceName == null) {
        return null;
    }
    final QName endpointName = ep.getEndpointName();
    final String portName = endpointName == null ? null : endpointName.getLocalPart();
    JmsUriConfigurator result = new JmsUriConfigurator();
    result.setConfigurationPrefix(portName);
    result.setServiceName(serviceName);
    return result;
}
Also used : QName(javax.xml.namespace.QName) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Aggregations

EndpointImpl (org.apache.cxf.jaxws.EndpointImpl)66 QName (javax.xml.namespace.QName)14 Bean (org.springframework.context.annotation.Bean)10 Bus (org.apache.cxf.Bus)9 Test (org.junit.Test)9 BeforeClass (org.junit.BeforeClass)7 Endpoint (javax.xml.ws.Endpoint)5 URL (java.net.URL)4 HashMap (java.util.HashMap)4 LoggingInInterceptor (org.apache.cxf.ext.logging.LoggingInInterceptor)4 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)4 Feature (org.apache.cxf.feature.Feature)4 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)4 SOAPBinding (javax.xml.ws.soap.SOAPBinding)3 SpringBusFactory (org.apache.cxf.bus.spring.SpringBusFactory)3 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 JAXBException (javax.xml.bind.JAXBException)2 XMLStreamException (javax.xml.stream.XMLStreamException)2