Search in sources :

Example 26 with EndpointImpl

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

the class HttpNumberFactoryImpl method initDefaultServant.

protected void initDefaultServant() {
    servant = new HttpNumberImpl();
    String wsdlLocation = "testutils/factory_pattern.wsdl";
    String bindingId = null;
    EndpointImpl ep = new EndpointImpl(bus, servant, bindingId, wsdlLocation);
    ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPort"));
    ep.publish(getServantAddressRoot());
    endpoints.add(ep);
    templateEpr = ep.getServer().getDestination().getAddress();
}
Also used : QName(javax.xml.namespace.QName) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 27 with EndpointImpl

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

the class NumberFactoryImpl method initDefaultServant.

protected void initDefaultServant() {
    servant = new NumberImpl();
    String wsdlLocation = "testutils/factory_pattern.wsdl";
    String bindingId = null;
    EndpointImpl ep = new EndpointImpl(bus, servant, bindingId, wsdlLocation);
    ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPort"));
    ep.publish(getServantAddressRoot());
    endpoints.add(ep);
    templateEpr = ep.getServer().getDestination().getAddress();
    // jms port
    EmbeddedJMSBrokerLauncher.updateWsdlExtensors(bus, wsdlLocation);
    ep = new EndpointImpl(bus, servant, bindingId, wsdlLocation);
    ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPortJMS"));
    ep.setAddress("jms:jndi:dynamicQueues/test.cxf.factory_pattern.queue");
    ep.publish();
    ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
    ep.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
    endpoints.add(ep);
}
Also used : QName(javax.xml.namespace.QName) LoggingOutInterceptor(org.apache.cxf.ext.logging.LoggingOutInterceptor) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) LoggingInInterceptor(org.apache.cxf.ext.logging.LoggingInInterceptor)

Example 28 with EndpointImpl

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

the class Server method run.

protected void run() {
    // We use a null binding id in the call to EndpointImpl
    // constructor. Why?
    final String nullBindingID = null;
    // We need to specify to use defaults on constructing the
    // bus, because our configuration file doesn't have
    // everything needed.
    final boolean useDefaults = true;
    // We configure a new bus for this server.
    setBus(new SpringBusFactory().createBus(configFileURL, useDefaults));
    // This impl class must have the appropriate annotations
    // to match the WSDL file that we are using.
    Object implementor = new GreeterImpl(name);
    // I don't know why this works.
    ep = new EndpointImpl(getBus(), implementor, nullBindingID, this.getClass().getResource("greeting.wsdl").toString());
    // How the hell do I know what the name of the
    // http-destination is from using this call?
    ep.setEndpointName(new QName("http://apache.org/hello_world", name));
    ep.publish(address);
}
Also used : SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) QName(javax.xml.namespace.QName) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 29 with EndpointImpl

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

the class WSDLAddressRewriteTest method publishEndpoint.

private Endpoint publishEndpoint(boolean autoRewriteSoapAddress) {
    Endpoint endpoint = Endpoint.publish("http://localhost:" + PORT + "/SoapContext/GreeterPort", new GreeterImpl());
    EndpointInfo ei = ((EndpointImpl) endpoint).getServer().getEndpoint().getEndpointInfo();
    ei.setProperty("autoRewriteSoapAddress", autoRewriteSoapAddress);
    return endpoint;
}
Also used : EndpointInfo(org.apache.cxf.service.model.EndpointInfo) Endpoint(javax.xml.ws.Endpoint) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 30 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)

Aggregations

EndpointImpl (org.apache.cxf.jaxws.EndpointImpl)61 QName (javax.xml.namespace.QName)14 Test (org.junit.Test)9 Bus (org.apache.cxf.Bus)8 BeforeClass (org.junit.BeforeClass)7 Bean (org.springframework.context.annotation.Bean)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 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 WebServiceException (javax.xml.ws.WebServiceException)2