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();
}
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);
}
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);
}
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;
}
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);
}
Aggregations