use of org.apache.hello_world_soap_http.GreeterImpl in project cxf by apache.
the class NoSpringServletServer method run.
@Override
protected void run() {
// setup the system properties
String busFactory = System.getProperty(BusFactory.BUS_FACTORY_PROPERTY_NAME);
System.setProperty(BusFactory.BUS_FACTORY_PROPERTY_NAME, "org.apache.cxf.bus.CXFBusFactory");
try {
httpServer = new Server(Integer.parseInt(PORT));
ContextHandlerCollection contexts = new ContextHandlerCollection();
httpServer.setHandler(contexts);
ServletContextHandler root = new ServletContextHandler(contexts, "/", ServletContextHandler.SESSIONS);
bus = BusFactory.getDefaultBus(true);
CXFServlet cxf = new CXFServlet();
cxf.setBus(bus);
ServletHolder servlet = new ServletHolder(cxf);
servlet.setName("soap");
servlet.setForcedPath("soap");
root.addServlet(servlet, "/soap/*");
httpServer.start();
setBus(bus);
BusFactory.setDefaultBus(bus);
GreeterImpl impl = new GreeterImpl();
Endpoint.publish("/Greeter", impl);
HelloImpl helloImpl = new HelloImpl();
Endpoint.publish("/Hello", helloImpl);
((EndpointImpl) Endpoint.create(helloImpl)).publish("/");
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
// clean up the system properties
if (busFactory != null) {
System.setProperty(BusFactory.BUS_FACTORY_PROPERTY_NAME, busFactory);
} else {
System.clearProperty(BusFactory.BUS_FACTORY_PROPERTY_NAME);
}
}
}
use of org.apache.hello_world_soap_http.GreeterImpl in project cxf by apache.
the class Server method run.
protected void run() {
URL url = getClass().getResource("fault-stack-trace.xml");
if (url != null) {
System.setProperty("cxf.config.file.url", url.toString());
}
Object implementor;
String address;
implementor = new AsyncGreeter();
address = "http://localhost:" + PORT + "/SoapContext/AsyncSoapPort";
eps.add(Endpoint.publish(address, implementor));
implementor = new AsyncEchoProvider();
address = "http://localhost:" + PORT + "/SoapContext/AsyncEchoProvider";
eps.add(Endpoint.publish(address, implementor));
implementor = new GreeterImplMultiPort();
address = "http://localhost:" + PORT + "/MultiPort/GreeterPort";
eps.add(Endpoint.publish(address, implementor));
implementor = new DocLitBareGreeterMultiPort();
address = "http://localhost:" + PORT + "/MultiPort/DocBarePort";
eps.add(Endpoint.publish(address, implementor));
implementor = new GreeterImpl();
address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
Endpoint ep = Endpoint.publish(address, implementor);
eps.add(ep);
implementor = new GreeterImpl();
address = "http://localhost:" + PORT + "/SoapContext/SoapPortWithGzip";
Endpoint ep2 = Endpoint.publish(address, implementor);
((EndpointImpl) ep2).getService().getInInterceptors().add(new GZIPInInterceptor());
((EndpointImpl) ep2).getService().getOutInterceptors().add(new GZIPOutInterceptor());
eps.add(ep2);
implementor = new RefGreeterImpl();
address = "http://localhost:" + PORT + "/SoapContext/SoapPort2";
eps.add(Endpoint.publish(address, implementor));
// publish port with soap12 binding
address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
EndpointImpl e = (EndpointImpl) Endpoint.create(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING, new Greeter12Impl());
e.publish(address);
eps.add(e);
implementor = new DocLitBareGreeterImpl();
address = "http://localhost:" + BARE_PORT + "/SoapContext/SoapPort";
eps.add(Endpoint.publish(address, implementor));
implementor = new GreeterImplBogus();
address = "http://localhost:" + BOGUS_REAL_PORT + "/SoapContext/SoapPort";
eps.add(Endpoint.publish(address, implementor));
}
use of org.apache.hello_world_soap_http.GreeterImpl in project camel by apache.
the class CxfProducerSoapFaultTest method startService.
@BeforeClass
public static void startService() throws Exception {
GreeterImpl greeterImpl = new GreeterImpl();
Endpoint.publish(JAXWS_SERVER_ADDRESS, greeterImpl);
}
use of org.apache.hello_world_soap_http.GreeterImpl in project camel by apache.
the class CxfProducerTest method startService.
@Before
public void startService() throws Exception {
// start a simple front service
ServerFactoryBean svrBean = new ServerFactoryBean();
svrBean.setAddress(getSimpleServerAddress());
svrBean.setServiceClass(HelloService.class);
svrBean.setServiceBean(new HelloServiceImpl());
svrBean.setBus(BusFactory.getDefaultBus());
server = svrBean.create();
GreeterImpl greeterImpl = new GreeterImpl();
endpoint = Endpoint.publish(getJaxWsServerAddress(), greeterImpl);
}
use of org.apache.hello_world_soap_http.GreeterImpl in project cxf by apache.
the class WSAFeatureXmlTest method testServerFactory.
@Test
public void testServerFactory() {
JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
assertNotNull(bus != null);
sf.setServiceBean(new GreeterImpl());
sf.setAddress("http://localhost:" + PORT + "/test");
sf.setStart(false);
Configurer c = getBus().getExtension(Configurer.class);
c.configureBean("server", sf);
Server server = sf.create();
Endpoint endpoint = server.getEndpoint();
checkAddressInterceptors(endpoint.getInInterceptors());
}
Aggregations