Search in sources :

Example 1 with GreeterImplMixedStyle

use of org.apache.hello_world_mixedstyle.GreeterImplMixedStyle in project cxf by apache.

the class Server method run.

protected void run() {
    setBus(BusFactory.getDefaultBus());
    getBus().getInInterceptors().add(new LoggingInInterceptor());
    String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
    Object implementor1 = new GreeterImplMixedStyle(" version1");
    EndpointImpl ep1 = (EndpointImpl) Endpoint.publish(address, implementor1);
    ep1.getServer().getEndpoint().put("version", "1");
    ep1.getServer().getEndpoint().put("allow-multiplex-endpoint", Boolean.TRUE);
    // Register a MediatorInInterceptor on this dummy service
    Object implementor2 = new GreeterImplMixedStyle(" version2");
    EndpointImpl ep2 = (EndpointImpl) Endpoint.publish(address, implementor2);
    ep2.getServer().getEndpoint().put("version", "2");
    MultipleEndpointObserver meo = (MultipleEndpointObserver) ep1.getServer().getDestination().getMessageObserver();
    meo.getRoutingInterceptors().clear();
    meo.getRoutingInterceptors().add(new MediatorInInterceptor());
}
Also used : MultipleEndpointObserver(org.apache.cxf.transport.MultipleEndpointObserver) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) LoggingInInterceptor(org.apache.cxf.ext.logging.LoggingInInterceptor) GreeterImplMixedStyle(org.apache.hello_world_mixedstyle.GreeterImplMixedStyle)

Aggregations

LoggingInInterceptor (org.apache.cxf.ext.logging.LoggingInInterceptor)1 EndpointImpl (org.apache.cxf.jaxws.EndpointImpl)1 MultipleEndpointObserver (org.apache.cxf.transport.MultipleEndpointObserver)1 GreeterImplMixedStyle (org.apache.hello_world_mixedstyle.GreeterImplMixedStyle)1